Doxygen Samurai Engine 0.0.1
Doxygen Samurai Engine Documentation
Loading...
Searching...
No Matches
Player Struct Reference

#include <mario.h>

Collaboration diagram for Player:
Collaboration graph

Public Member Functions

void move (glm::vec2 dir)
 
void moveVelocityX (float dir)
 
void jump (float power)
 
void applyGravity (float gravity)
 
void updateMove ()
 
void updatePhisics (float deltaTime)
 
void resolveConstrains (Block *map)
 
void checkCollisionBrute (glm::vec2 &pos, glm::vec2 lastPos, Block *map, bool &upTouch, bool &downTouch, bool &leftTouch, bool &rightTouch)
 
glm::vec2 performCollision (Block *map, glm::vec2 pos, glm::vec2 size, glm::vec2 delta, bool &upTouch, bool &downTouch, bool &leftTouch, bool &rightTouch)
 

Public Attributes

Transform position = {glm::vec2(0,0), PLAYER_SIZE}
 
glm::vec2 lastPos {}
 
glm::vec2 velocity = {}
 
bool movingRight = 0
 
bool grounded = 0
 
bool movingThisFrame = false
 
int input = 0
 

Detailed Description

Definition at line 28 of file mario.h.

Member Function Documentation

◆ applyGravity()

void Player::applyGravity ( float gravity)

Definition at line 101 of file mario.cpp.

Here is the caller graph for this function:

◆ checkCollisionBrute()

void Player::checkCollisionBrute ( glm::vec2 & pos,
glm::vec2 lastPos,
Block * map,
bool & upTouch,
bool & downTouch,
bool & leftTouch,
bool & rightTouch )

Definition at line 180 of file mario.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jump()

void Player::jump ( float power)

Definition at line 94 of file mario.cpp.

Here is the caller graph for this function:

◆ move()

void Player::move ( glm::vec2 dir)

Definition at line 28 of file mario.cpp.

◆ moveVelocityX()

void Player::moveVelocityX ( float dir)

Definition at line 40 of file mario.cpp.

Here is the caller graph for this function:

◆ performCollision()

glm::vec2 Player::performCollision ( Block * map,
glm::vec2 pos,
glm::vec2 size,
glm::vec2 delta,
bool & upTouch,
bool & downTouch,
bool & leftTouch,
bool & rightTouch )

Definition at line 206 of file mario.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ resolveConstrains()

void Player::resolveConstrains ( Block * map)

Definition at line 283 of file mario.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateMove()

void Player::updateMove ( )

Definition at line 117 of file mario.cpp.

Here is the caller graph for this function:

◆ updatePhisics()

void Player::updatePhisics ( float deltaTime)

Definition at line 147 of file mario.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ grounded

bool Player::grounded = 0

Definition at line 37 of file mario.h.

◆ input

int Player::input = 0

Definition at line 65 of file mario.h.

◆ lastPos

glm::vec2 Player::lastPos {}

Definition at line 32 of file mario.h.

◆ movingRight

bool Player::movingRight = 0

Definition at line 36 of file mario.h.

◆ movingThisFrame

bool Player::movingThisFrame = false

Definition at line 47 of file mario.h.

◆ position

Transform Player::position = {glm::vec2(0,0), PLAYER_SIZE}

Definition at line 30 of file mario.h.

◆ velocity

glm::vec2 Player::velocity = {}

Definition at line 34 of file mario.h.


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