Property | Type | Description | |
---|---|---|---|
LastColors | float>.Dictionary |
Method | Description | |
---|---|---|
Draw ( |
||
Player ( |
||
TileIntersectsPlayer ( |
Checks for tile intersections/collision depth between a player and a tile
|
|
Update ( |
Updates the player physics, states, etc
|
Method | Description | |
---|---|---|
DoJump ( float velocityY, |
Calculates the Y velocity accounting for jumping and animates accordingly. During the accent of a jump, the Y velocity is completely overridden by a power curve. During the decent, gravity takes over. The jump velocity is controlled by the jumpTime field which measures time into the accent of the current jump. |
|
HandleCollisions ( CollisionDirection direction, |
Detects and resolves all collisions between the player and his neighboring tiles. When a collision is detected, the player is pushed away along one axis to prevent overlapping. There is some special logic for the Y axis to handle platforms which behave differently depending on direction of movement.
|
Method | Description | |
---|---|---|
ApplyPhysics ( |
Apply client-side physics to the character, calculate velocity from movement and gravity, handle collisions
|
|
DrawTag ( |
Draws the players username above them
|
|
HandleCollisions ( |
Handles collisions for a given block
|
|
HandleInput ( ) : bool |
Handles movement of the character (Jumping, Moving, etc)
|
|
HorizontalCollision ( |
||
Interpolate ( |
||
VerticalCollision ( |
protected DoJump ( float velocityY, |
||
velocityY | float | /// The player's current velocity along the Y axis. /// |
gameTime | ||
return | float |
public Draw ( |
||
spriteBatch | ||
gameTime | ||
return | void |
protected HandleCollisions ( CollisionDirection direction, |
||
direction | CollisionDirection | |
gameTime | ||
return | void |
public Player ( |
||
map | ||
position | Vector2 | |
name | string | |
id | int | |
return | System |
public static TileIntersectsPlayer ( |
||
player | A player's bounding rectangle | |
block | A block's brounding rectangle | |
direction | CollisionDirection | Collision direction |
depth | Vector2 | Returned depth of the collision |
return | bool |
public Update ( |
||
gameTime | ||
return | void |