Player

Class representing the dinosaur

Constructors

this
this()

Default constructor

Members

Functions

displacement
float displacement()

Distance that the player has covered in the LAST FRAME

displacement_tot
float displacement_tot()

Returns the total displacement

gravity
float gravity()

Actual downards acceleration

jump
bool jump()

Attempts to jump

position
Vector2f position()

Position of the player

size
Vector2f size()

Effective size

texture
const(Texture) texture()

Current texture

update
void update()

Applies gravitational acceleration, moves the player etc.

Static variables

gravity_acc
float gravity_acc;

Gravitational acceleration

horizontal_offset
float horizontal_offset;

Distance from the left side of the window at which a player stays

initial_jump_speed
float initial_jump_speed;

Initial vertical speed immediately after jumping

size_crouching
Vector2f size_crouching;

Size of the crouching player

size_normal
Vector2f size_normal;

Size of the standing player

Variables

dead
bool dead;

Dead Player has a different texture

height
float height;

Distance from the ground

speed
float speed;

Speed at which the player moves to the right

vert_velocity
float vert_velocity;

Vertical velocity, positive means up

window_height
float window_height;

Height of the window in which player resides

Inherited Members

From Collidable

collider
Collider collider()

Returns a rectangle to be used for collision detection;

Meta