C# Класс Source.Game1

This is the main type for your game.
Наследование: Microsoft.Xna.Framework.Game
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
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