C# Class PrinceGame.Player

Inheritance: Sprite
Afficher le fichier Open project: salvadorc17/Prince-Monogame

Méthodes publiques

Méthode Description
Advance ( ) : void
Bump ( ) : void
Bump ( Enumeration priority ) : void
Bump ( Enumeration priority, Enumeration reverse ) : void
Burned ( Enumeration priority ) : void
CheckItemOnFloor ( ) : void
ClimbDown ( ) : void
ClimbFail ( ) : void
ClimbUp ( ) : void
Crawl ( ) : void
Crouch ( ) : void
Crouch ( Enumeration priority ) : void
Crouch ( Enumeration priority, System stoppable ) : void
Crouch ( Enumeration priority, System stoppable, Vector2 offset ) : void
Crouch ( System stoppable ) : void
Draw ( GameTime gameTime, SpriteBatch spriteBatch ) : void

Draws the animated player.

DrinkPotion ( ) : void
DrinkPotionBig ( ) : void
Engarde ( ) : void
Engarde ( Enumeration priority, System stoppable ) : void
Engarde ( Enumeration priority, System stoppable, Vector2 offset ) : void
Engarde ( System stoppable ) : void
GoDown ( ) : void
GoDown ( Enumeration priority ) : void
GoDown ( Enumeration priority, Vector2 offSet ) : void
GoDown ( Vector2 offSet ) : void
HandleCollisionsNew ( ) : void
Hang ( ) : void
HangDrop ( ) : void
HighJump ( ) : void
Impale ( ) : void
Impale ( Enumeration priority ) : void
JumpHangLong ( ) : void
JumpHangMed ( ) : void
OnReachedExit ( ) : void

Called when this player reaches the level's exit.

ParseInput ( Enumeration input ) : void
PickupSword ( ) : void
Player ( RoomNew room, Vector2 position, Point roomcoords, GraphicsDevice GraphicsDevice__1, SpriteEffects spriteEffect ) : System

Constructors a new player.

Question ( ) : void
RJumpFall ( ) : void
RJumpFall ( Enumeration priority ) : void
RJumpFall ( Enumeration priority, Enumeration reverse ) : void
Reset ( SpriteEffects spriteeffect ) : void
Reset ( Vector2 position, SpriteEffects spriteEffect ) : void

Resets the player to life.

Retreat ( ) : void
RunJump ( ) : void
RunStop ( ) : void
RunStop ( Enumeration priority ) : void
RunTurn ( ) : void
Stand ( ) : void
Stand ( Enumeration priority ) : void
Stand ( Enumeration priority, System stoppable ) : void
Stand ( bool stoppable ) : void
StandJump ( ) : void
StandJump ( Enumeration priority ) : void
StandUp ( ) : void
StandUp ( Enumeration priority ) : void
Start ( Vector2 position ) : void

Start position the player to life.

StartLevel ( RoomNew room ) : void
StartRunning ( ) : void
StepFall ( ) : void
StepFall ( Enumeration priority ) : void
StepFall ( Enumeration priority, Vector2 offSet ) : void
StepForward ( ) : void
Stoop ( ) : void
Stoop ( Enumeration priority ) : void
Stoop ( Enumeration priority, Vector2 offSet ) : void
Stoop ( Vector2 offSet ) : void
Strike ( ) : void
Strike ( Enumeration priority ) : void
Turn ( ) : void
Update ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void

Handles input, performs physics, and animates the player sprite.

We pass in all of the input states so that our game is only polling the hardware once per frame. We also pass the game's orientation because when using the accelerometer, we need to reverse our motion when the orientation is in the LandscapeRight orientation.

Private Methods

Méthode Description
GetInput ( KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : Enumeration.Input

Gets player horizontal movement and jump commands from input.

IsDownOfBlock ( bool isForClimbDown ) : System.Nullable
IsFrontOfBlock ( bool isForHang ) : System.Nullable
LoadContent ( ) : void

Loads the player sprite sheet and sounds.

isBehind ( Rectangle tileBounds, Rectangle playerBounds ) : bool
isClimbable ( ) : Enumeration.State

Remnber: for example the top gate is x=3 y=1 first row bottom = 2 the top row = 0..

isClimbableDown ( ) : bool
isLoosable ( ) : bool

Method Details

Advance() public méthode

public Advance ( ) : void
Résultat void

Bump() public méthode

public Bump ( ) : void
Résultat void

Bump() public méthode

public Bump ( Enumeration priority ) : void
priority Enumeration
Résultat void

Bump() public méthode

public Bump ( Enumeration priority, Enumeration reverse ) : void
priority Enumeration
reverse Enumeration
Résultat void

Burned() public méthode

public Burned ( Enumeration priority ) : void
priority Enumeration
Résultat void

CheckItemOnFloor() public méthode

public CheckItemOnFloor ( ) : void
Résultat void

ClimbDown() public méthode

public ClimbDown ( ) : void
Résultat void

ClimbFail() public méthode

public ClimbFail ( ) : void
Résultat void

ClimbUp() public méthode

public ClimbUp ( ) : void
Résultat void

Crawl() public méthode

public Crawl ( ) : void
Résultat void

Crouch() public méthode

public Crouch ( ) : void
Résultat void

Crouch() public méthode

public Crouch ( Enumeration priority ) : void
priority Enumeration
Résultat void

Crouch() public méthode

public Crouch ( Enumeration priority, System stoppable ) : void
priority Enumeration
stoppable System
Résultat void

Crouch() public méthode

public Crouch ( Enumeration priority, System stoppable, Vector2 offset ) : void
priority Enumeration
stoppable System
offset Vector2
Résultat void

Crouch() public méthode

public Crouch ( System stoppable ) : void
stoppable System
Résultat void

Draw() public méthode

Draws the animated player.
public Draw ( GameTime gameTime, SpriteBatch spriteBatch ) : void
gameTime Microsoft.Xna.Framework.GameTime
spriteBatch Microsoft.Xna.Framework.Graphics.SpriteBatch
Résultat void

DrinkPotion() public méthode

public DrinkPotion ( ) : void
Résultat void

DrinkPotionBig() public méthode

public DrinkPotionBig ( ) : void
Résultat void

Engarde() public méthode

public Engarde ( ) : void
Résultat void

Engarde() public méthode

public Engarde ( Enumeration priority, System stoppable ) : void
priority Enumeration
stoppable System
Résultat void

Engarde() public méthode

public Engarde ( Enumeration priority, System stoppable, Vector2 offset ) : void
priority Enumeration
stoppable System
offset Vector2
Résultat void

Engarde() public méthode

public Engarde ( System stoppable ) : void
stoppable System
Résultat void

GoDown() public méthode

public GoDown ( ) : void
Résultat void

GoDown() public méthode

public GoDown ( Enumeration priority ) : void
priority Enumeration
Résultat void

GoDown() public méthode

public GoDown ( Enumeration priority, Vector2 offSet ) : void
priority Enumeration
offSet Vector2
Résultat void

GoDown() public méthode

public GoDown ( Vector2 offSet ) : void
offSet Vector2
Résultat void

HandleCollisionsNew() public méthode

public HandleCollisionsNew ( ) : void
Résultat void

Hang() public méthode

public Hang ( ) : void
Résultat void

HangDrop() public méthode

public HangDrop ( ) : void
Résultat void

HighJump() public méthode

public HighJump ( ) : void
Résultat void

Impale() public méthode

public Impale ( ) : void
Résultat void

Impale() public méthode

public Impale ( Enumeration priority ) : void
priority Enumeration
Résultat void

JumpHangLong() public méthode

public JumpHangLong ( ) : void
Résultat void

JumpHangMed() public méthode

public JumpHangMed ( ) : void
Résultat void

OnReachedExit() public méthode

Called when this player reaches the level's exit.
public OnReachedExit ( ) : void
Résultat void

ParseInput() public méthode

public ParseInput ( Enumeration input ) : void
input Enumeration
Résultat void

PickupSword() public méthode

public PickupSword ( ) : void
Résultat void

Player() public méthode

Constructors a new player.
public Player ( RoomNew room, Vector2 position, Point roomcoords, GraphicsDevice GraphicsDevice__1, SpriteEffects spriteEffect ) : System
room RoomNew
position Vector2
roomcoords Point
GraphicsDevice__1 GraphicsDevice
spriteEffect SpriteEffects
Résultat System

Question() public méthode

public Question ( ) : void
Résultat void

RJumpFall() public méthode

public RJumpFall ( ) : void
Résultat void

RJumpFall() public méthode

public RJumpFall ( Enumeration priority ) : void
priority Enumeration
Résultat void

RJumpFall() public méthode

public RJumpFall ( Enumeration priority, Enumeration reverse ) : void
priority Enumeration
reverse Enumeration
Résultat void

Reset() public méthode

public Reset ( SpriteEffects spriteeffect ) : void
spriteeffect SpriteEffects
Résultat void

Reset() public méthode

Resets the player to life.
public Reset ( Vector2 position, SpriteEffects spriteEffect ) : void
position Vector2 The position to come to life at.
spriteEffect SpriteEffects
Résultat void

Retreat() public méthode

public Retreat ( ) : void
Résultat void

RunJump() public méthode

public RunJump ( ) : void
Résultat void

RunStop() public méthode

public RunStop ( ) : void
Résultat void

RunStop() public méthode

public RunStop ( Enumeration priority ) : void
priority Enumeration
Résultat void

RunTurn() public méthode

public RunTurn ( ) : void
Résultat void

Stand() public méthode

public Stand ( ) : void
Résultat void

Stand() public méthode

public Stand ( Enumeration priority ) : void
priority Enumeration
Résultat void

Stand() public méthode

public Stand ( Enumeration priority, System stoppable ) : void
priority Enumeration
stoppable System
Résultat void

Stand() public méthode

public Stand ( bool stoppable ) : void
stoppable bool
Résultat void

StandJump() public méthode

public StandJump ( ) : void
Résultat void

StandJump() public méthode

public StandJump ( Enumeration priority ) : void
priority Enumeration
Résultat void

StandUp() public méthode

public StandUp ( ) : void
Résultat void

StandUp() public méthode

public StandUp ( Enumeration priority ) : void
priority Enumeration
Résultat void

Start() public méthode

Start position the player to life.
public Start ( Vector2 position ) : void
position Vector2 The position to come to life at.
Résultat void

StartLevel() public méthode

public StartLevel ( RoomNew room ) : void
room RoomNew
Résultat void

StartRunning() public méthode

public StartRunning ( ) : void
Résultat void

StepFall() public méthode

public StepFall ( ) : void
Résultat void

StepFall() public méthode

public StepFall ( Enumeration priority ) : void
priority Enumeration
Résultat void

StepFall() public méthode

public StepFall ( Enumeration priority, Vector2 offSet ) : void
priority Enumeration
offSet Vector2
Résultat void

StepForward() public méthode

public StepForward ( ) : void
Résultat void

Stoop() public méthode

public Stoop ( ) : void
Résultat void

Stoop() public méthode

public Stoop ( Enumeration priority ) : void
priority Enumeration
Résultat void

Stoop() public méthode

public Stoop ( Enumeration priority, Vector2 offSet ) : void
priority Enumeration
offSet Vector2
Résultat void

Stoop() public méthode

public Stoop ( Vector2 offSet ) : void
offSet Vector2
Résultat void

Strike() public méthode

public Strike ( ) : void
Résultat void

Strike() public méthode

public Strike ( Enumeration priority ) : void
priority Enumeration
Résultat void

Turn() public méthode

public Turn ( ) : void
Résultat void

Update() public méthode

Handles input, performs physics, and animates the player sprite.
We pass in all of the input states so that our game is only polling the hardware once per frame. We also pass the game's orientation because when using the accelerometer, we need to reverse our motion when the orientation is in the LandscapeRight orientation.
public Update ( GameTime gameTime, KeyboardState keyboardState, GamePadState gamePadState, TouchCollection touchState, AccelerometerState accelState, DisplayOrientation orientation ) : void
gameTime Microsoft.Xna.Framework.GameTime
keyboardState Microsoft.Xna.Framework.Input.KeyboardState
gamePadState Microsoft.Xna.Framework.Input.GamePadState
touchState TouchCollection
accelState AccelerometerState
orientation DisplayOrientation
Résultat void