PROTO::KLUDGE  0.1
Quick prototyping library for games using SDL and OpenGL.
pk::CharacterController Class Reference

#include <CharacterController.hpp>

Inheritance diagram for pk::CharacterController:
Inheritance graph
Collaboration diagram for pk::CharacterController:
Collaboration graph

Public Member Functions

 CharacterController ()
 
 CharacterController (b2World *world, GLTexture &texture, int player, GLRect rect)
 
virtual ~CharacterController ()
 
std::vector< pk::Bullet > & getBullets ()
 
bool requestPause ()
 
void handleInput ()
 
void update ()
 
GLSpritegetSprite ()
 
int getPlayerID ()
 
void BeginContact (b2Contact *contact) override
 
void EndContact (b2Contact *contact) override
 

Private Attributes

b2World * m_world
 
pk::GLSprite m_sprite
 
pk::CharacterBody m_body
 
std::vector< pk::Bulletm_bullets
 
pk::GameController m_controller
 
int m_playerID
 
bool m_pressedFire
 
bool m_pressedJump
 
bool m_pressedLeft
 
bool m_pressedRight
 
bool m_pressedUp
 
bool m_pressedDown
 
bool m_pressedLeftTrigger
 
bool m_pressedRightTrigger
 
bool m_pressedLeftShoulder
 
bool m_pressedRightShoulder
 
int m_facingDirection
 
unsigned int m_fireCounter
 
double m_fireTime
 
double m_fireDelay
 
float m_fireVelocity
 
float m_velocity
 
double m_jumpTime
 
double m_jumpDelay
 
float m_jumpVelocity
 
float m_dashVelocity
 
bool m_pressedPause
 
bool m_paused
 
double m_pauseTimer
 
Mix_Chunk * m_shotSound
 
Mix_Chunk * m_jumpSound
 
Mix_Chunk * m_dashSound
 

Constructor & Destructor Documentation

◆ CharacterController() [1/2]

pk::CharacterController::CharacterController ( )

◆ CharacterController() [2/2]

pk::CharacterController::CharacterController ( b2World *  world,
GLTexture texture,
int  player,
GLRect  rect 
)

◆ ~CharacterController()

virtual pk::CharacterController::~CharacterController ( )
virtual

Member Function Documentation

◆ BeginContact()

void pk::CharacterController::BeginContact ( b2Contact *  contact)
override

◆ EndContact()

void pk::CharacterController::EndContact ( b2Contact *  contact)
override

◆ getBullets()

std::vector<pk::Bullet>& pk::CharacterController::getBullets ( )
inline

◆ getPlayerID()

int pk::CharacterController::getPlayerID ( )
inline

◆ getSprite()

GLSprite& pk::CharacterController::getSprite ( )
inline

◆ handleInput()

void pk::CharacterController::handleInput ( )

◆ requestPause()

bool pk::CharacterController::requestPause ( )
inline

◆ update()

void pk::CharacterController::update ( )

Member Data Documentation

◆ m_body

pk::CharacterBody pk::CharacterController::m_body
private

◆ m_bullets

std::vector<pk::Bullet> pk::CharacterController::m_bullets
private

◆ m_controller

pk::GameController pk::CharacterController::m_controller
private

◆ m_dashSound

Mix_Chunk* pk::CharacterController::m_dashSound
private

◆ m_dashVelocity

float pk::CharacterController::m_dashVelocity
private

◆ m_facingDirection

int pk::CharacterController::m_facingDirection
private

◆ m_fireCounter

unsigned int pk::CharacterController::m_fireCounter
private

◆ m_fireDelay

double pk::CharacterController::m_fireDelay
private

◆ m_fireTime

double pk::CharacterController::m_fireTime
private

◆ m_fireVelocity

float pk::CharacterController::m_fireVelocity
private

◆ m_jumpDelay

double pk::CharacterController::m_jumpDelay
private

◆ m_jumpSound

Mix_Chunk* pk::CharacterController::m_jumpSound
private

◆ m_jumpTime

double pk::CharacterController::m_jumpTime
private

◆ m_jumpVelocity

float pk::CharacterController::m_jumpVelocity
private

◆ m_paused

bool pk::CharacterController::m_paused
private

◆ m_pauseTimer

double pk::CharacterController::m_pauseTimer
private

◆ m_playerID

int pk::CharacterController::m_playerID
private

◆ m_pressedDown

bool pk::CharacterController::m_pressedDown
private

◆ m_pressedFire

bool pk::CharacterController::m_pressedFire
private

◆ m_pressedJump

bool pk::CharacterController::m_pressedJump
private

◆ m_pressedLeft

bool pk::CharacterController::m_pressedLeft
private

◆ m_pressedLeftShoulder

bool pk::CharacterController::m_pressedLeftShoulder
private

◆ m_pressedLeftTrigger

bool pk::CharacterController::m_pressedLeftTrigger
private

◆ m_pressedPause

bool pk::CharacterController::m_pressedPause
private

◆ m_pressedRight

bool pk::CharacterController::m_pressedRight
private

◆ m_pressedRightShoulder

bool pk::CharacterController::m_pressedRightShoulder
private

◆ m_pressedRightTrigger

bool pk::CharacterController::m_pressedRightTrigger
private

◆ m_pressedUp

bool pk::CharacterController::m_pressedUp
private

◆ m_shotSound

Mix_Chunk* pk::CharacterController::m_shotSound
private

◆ m_sprite

pk::GLSprite pk::CharacterController::m_sprite
private

◆ m_velocity

float pk::CharacterController::m_velocity
private

◆ m_world

b2World* pk::CharacterController::m_world
private

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