Zen 0.3.0
Loading...
Searching...
No Matches
Player Class Reference

Public Member Functions

bool onGround () const
void update (Zen::DeltaTime deltaTime, bool jumpPressed)
bool wasOnGround () const
bool justJumped () const
glm::vec2 getSize () const

Public Attributes

glm::vec2 pos {0.0f, 0.0f}
float vy = 0.0f
float gravity = -50.0f
float jumpPower = 18.0f
float width = 1.0f
float height = 1.0f
glm::vec4 colour = {1.0f, 0.0f, 0.0f, 1.0f}
Zen::ParticleEmitter emitter

Detailed Description

Definition at line 6 of file Player.h.

Member Function Documentation

◆ getSize()

glm::vec2 Player::getSize ( ) const
inline

Definition at line 28 of file Player.h.

◆ justJumped()

bool Player::justJumped ( ) const
inline

Definition at line 27 of file Player.h.

◆ onGround()

bool Player::onGround ( ) const

Definition at line 3 of file Player.cpp.

◆ update()

void Player::update ( Zen::DeltaTime deltaTime,
bool jumpPressed )

Definition at line 5 of file Player.cpp.

◆ wasOnGround()

bool Player::wasOnGround ( ) const
inline

Definition at line 26 of file Player.h.

Member Data Documentation

◆ colour

glm::vec4 Player::colour = {1.0f, 0.0f, 0.0f, 1.0f}

Definition at line 15 of file Player.h.

◆ emitter

Zen::ParticleEmitter Player::emitter
Initial value:
{
{0, 0},
{1, 1},
{1, 1, 1, 1}
}

Definition at line 17 of file Player.h.

◆ gravity

float Player::gravity = -50.0f

Definition at line 11 of file Player.h.

◆ height

float Player::height = 1.0f

Definition at line 14 of file Player.h.

◆ jumpPower

float Player::jumpPower = 18.0f

Definition at line 12 of file Player.h.

◆ pos

glm::vec2 Player::pos {0.0f, 0.0f}

Definition at line 8 of file Player.h.

◆ vy

float Player::vy = 0.0f

Definition at line 9 of file Player.h.

◆ width

float Player::width = 1.0f

Definition at line 13 of file Player.h.


The documentation for this class was generated from the following files: