C# 클래스 Source.Game1

This is the main type for your game.
상속: Microsoft.Xna.Framework.Game
파일 보기 프로젝트 열기: HarkerGameDev/TheGame 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
currentPlatform System.Platform
drops List
fontSmall Microsoft.Xna.Framework.Graphics.SpriteFont
obstacles List
particles List
platforms List
playerControls List
players List
rand System.Random
smear Microsoft.Xna.Framework.Graphics.Texture2D
whiteRect Microsoft.Xna.Framework.Graphics.Texture2D

공개 메소드들

메소드 설명
Game1 ( ) : System
ToggleButton ( PlayerIndex playerIndex, Buttons button ) : bool
ToggleKey ( Keys key ) : bool

보호된 메소드들

메소드 설명
Draw ( GameTime gameTime ) : void

This is called when the game should draw itself.

Initialize ( ) : void

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.

LoadContent ( ) : void

LoadContent will be called once per game and is the place to load all of your content.

UnloadContent ( ) : void

UnloadContent will be called once per game and is the place to unload game-specific content.

Update ( GameTime gameTime ) : void

Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.

비공개 메소드들

메소드 설명
CheckPlayer ( float deltaTime ) : void

Updates player and checks if the user is off the level, and resets the player if it is. Also updates the camera position. Basically, the non-collision update for the game

DrawBackground ( Vector2 averagePos ) : void
DrawCharacter ( ) : void
DrawGame ( double deltaTime ) : void
DrawRect ( Vector2 position, Color color, float rotation, Vector2 origin, Vector2 scale ) : void

Draws a rectangle. Make sure this is called AFTER spriteBatch.Begin()

DrawScene ( double deltaTime, Vector2 averagePos ) : void
HandleEditLevel ( ) : void

Handles all keypresses for editing a level. These are the controls: - Press 'E' to enter edit level mode. - Shift-drag to select a platform (move your mouse slowly) - Backspace to delete selected platform - Alt-drag to modify currently selected platform - Tap left, right, up, or down to move selected platform - Ctrl-drag to create a new platform - Ctrl-S to save your current level as a new level in the Levels folder - Ctrl-O to open the last level -- NOTE, this will override ANY changes you made, so be careful - + and - zoom in and out - Drag mouse with nothing held down to pan camera - Press f when a floor is selected to change its solid state

HandleInput ( float deltaTime ) : void

Handles all keyboard and gamepad input for the game. Moves all players and recalculates wobble-screen.

HandlePlayerInput ( Player player, int controller, float deltaTime ) : void

Handles input for a single player for given input keys

LoadBackground ( int loadLevel ) : void

Loads a level and stores it into background

LoadLevel ( int loadLevel ) : void
LoadReplay ( int replay ) : void
LoadSettings ( ) : void
LoadUI ( Menu type ) : void
ParseButtons ( ) : void
ProjectPointToLine ( Vector2 start, Vector2 end, Vector2 point ) : float

Projects a point onto a line and returns the progress along that line segment.

Raycast ( Vector2 start, Vector2 dir ) : float

Casts a ray from start in the given direction, returning the number of "dir" vector it takes to get to the closest contact

Reset ( ) : void
SaveLevel ( int saveLevel ) : void
SaveSettings ( ) : void
StartGame ( ) : void
UpdateMenu ( double elapsedTime ) : void
graphics_DeviceCreated ( object sender, EventArgs e ) : void
graphics_PreparingDeviceSettings ( object sender, Microsoft.Xna.Framework.PreparingDeviceSettingsEventArgs e ) : void
wobbleScreen ( float amplifier ) : void

메소드 상세

Draw() 보호된 메소드

This is called when the game should draw itself.
protected Draw ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
리턴 void

Game1() 공개 메소드

public Game1 ( ) : System
리턴 System

Initialize() 보호된 메소드

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.
protected Initialize ( ) : void
리턴 void

LoadContent() 보호된 메소드

LoadContent will be called once per game and is the place to load all of your content.
protected LoadContent ( ) : void
리턴 void

ToggleButton() 공개 메소드

public ToggleButton ( PlayerIndex playerIndex, Buttons button ) : bool
playerIndex PlayerIndex
button Buttons
리턴 bool

ToggleKey() 공개 메소드

public ToggleKey ( Keys key ) : bool
key Keys
리턴 bool

UnloadContent() 보호된 메소드

UnloadContent will be called once per game and is the place to unload game-specific content.
protected UnloadContent ( ) : void
리턴 void

Update() 보호된 메소드

Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.
protected Update ( GameTime gameTime ) : void
gameTime Microsoft.Xna.Framework.GameTime Provides a snapshot of timing values.
리턴 void

프로퍼티 상세

currentPlatform 공개적으로 프로퍼티

public Platform,System currentPlatform
리턴 System.Platform

drops 공개적으로 프로퍼티

public List drops
리턴 List

fontSmall 공개적으로 프로퍼티

public SpriteFont,Microsoft.Xna.Framework.Graphics fontSmall
리턴 Microsoft.Xna.Framework.Graphics.SpriteFont

obstacles 공개적으로 프로퍼티

public List obstacles
리턴 List

particles 공개적으로 프로퍼티

public List particles
리턴 List

platforms 공개적으로 프로퍼티

public List platforms
리턴 List

playerControls 공개적으로 프로퍼티

public List playerControls
리턴 List

players 공개적으로 프로퍼티

public List players
리턴 List

rand 공개적으로 프로퍼티

public Random,System rand
리턴 System.Random

smear 공개적으로 정적으로 프로퍼티

public static Texture2D,Microsoft.Xna.Framework.Graphics smear
리턴 Microsoft.Xna.Framework.Graphics.Texture2D

whiteRect 공개적으로 정적으로 프로퍼티

public static Texture2D,Microsoft.Xna.Framework.Graphics whiteRect
리턴 Microsoft.Xna.Framework.Graphics.Texture2D