Amulets & Armor
v1.02
Open Source Game
|
Player Object. More...
Macros | |
#define | easyabs(x) (((-x)<0)?(-(x)):(x)) |
#define | G_playerMove (G_playerObject->objMove) |
Player Object.
The player is just another object in the game system. These routines handle the movement and animation of that player object.
#define easyabs | ( | x) | (((-x)<0)?(-(x)):(x)) |
#define G_playerMove (G_playerObject->objMove) |
PlayerAccelDirection pushes the player in a given facing direction with the given amount of acceleration.
direction | – Direction to move toward |
accel | – Acceleration amount |
PlayerAccelXYZ gives the player a push in a given direction.
PlayerAddExternalObject moves the player along the x, y, and z dir.
dx | – X External velocity |
dy | – Y External velocity |
dz | – Z External velocity |
PlayerDraw draws what the player looks like at the given location on the current screen.
x | – X Location on the screen |
y | – Y Location on the screen |
PlayerFinish closes out anything that the player position was using.
Set the player object's type to zero to unlock the picture resources.
PlayerGetAngle gets the facing angle of the current player's location.
PlayerGetAreaSector returns the sector that the player is standing on top of.
T_word16 PlayerGetBodyPart | ( | T_bodyPartLocation | location) |
PlayerGetBodyPart reports the type of part for the given body location on the player.
location | – location of body part |
PlayerGetCenterSector returns the sector that is under the middle of the player.
PlayerGetFriction returns the friction of the surface under the player.
PlayerMoveNone cancels all declared movement for this frame.
PlayerGetNthAreaSecotr gets one of the sectors in the sector list of sectors that they are over.
PlayerGetNumAreaSectors tells how many area sectors the player is standing over.
T_3dObject* PlayerGetObject | ( | T_void | ) |
PlayerGetObject tells what the player object is.
PlayerGetStance returns what stance the player is at.
PlayerGetTravelDistance determines how far the player traveled on the last call to PlayerUpdate. Teleportation does not do this.
PlayerGetX gets the x location of the current player location.
PlayerGetY gets the y location of the current player location.
PlayerGetZ gets the z location of the current player location.
T_void PlayerInit | ( | T_3dObject * | p_obj) |
PlayerInit sets up the player's position information.
PlayerInitFirst sets up the player's basic information that won't change from level to level.
PlayerIsAboveGround checks to see if the player is above the ground (and probably falling).
PlayerJump causes the player to jump by moving the player up a little and accelerating in the up direction.
jumpPower | – Jump by how much |
PlayerJumpForward makes the player take a step forward regardless of anything else except for colllisions.
distance | – How far to jump forward |
PlayerMoveBackward moves the player backward the given speed.
fraction | – fractional amount allowed |
PlayerMoveForward moves the player forward the given speed.
fraction | – fractional amount allowed |
PlayerSetAngle changes the facing angle of the player.
angle | – new angle of the player |
T_void PlayerSetBodyPart | ( | T_bodyPartLocation | location, |
T_word16 | newPart | ||
) |
PlayerSetBodyPart changes a part on the body and sends it to all the other machines.
location | – location of body part |
newPart | – Number of new part |
PlayerSetMaxVelocity sets up the player's movement maximum velocity.
maxVelocity | – Jump by how much |
PlayerSetStance puts the player in another stance. If the player was hurt recently, it will time out after awhile.
stance | – stance number |
PlayerSetX sets the x location of the current player location.
x | – new X location of player |
PlayerSetY sets the y location of the current player location.
y | – new Y location of player |
PlayerSetZ sets the z location of the current player location.
z | – new Z location of player |
PlayerSlideLeft slides the player left the given speed.
fraction | – fractional amount allowed |
PlayerSlideRight slides the player right the given speed.
fraction | – fractional amount allowed |
PlayerTeleport is the major move all solution to moving the current POV. It moves the POV to the x, y, and angle as passed into the routine.
x | – Accurate X coordinate on map |
y | – Accurate Y coordinate on map |
angle | – Angle to face when moved. |
PlayerTeleportAlways is just like PlayerTeleport buts doesn't care if there is something in the way.
x | – Accurate X coordinate on map |
y | – Accurate Y coordinate on map |
angle | – Angle to face when moved. |
PlayerTurnLeft turns the player left by the given fractional amount.
fraction | – fractional amount allowed |
PlayerTurnRight turns the player right the given fractional speed.
fraction | – fractional amount allowed |
PlayerUpdate updates all the movement for the player over the given delta of time.
delta | – Number of timer ticks that have passed. |
What if delta is too big?
I'll break it up into pieces.