#include <MovingPlaform.hpp>
◆ MovingPlaform()
pk::MovingPlaform::MovingPlaform |
( |
b2World * |
world, |
|
|
GLTexture & |
texture, |
|
|
GLRect |
rect, |
|
|
glm::vec2 |
endPosition, |
|
|
float |
platformSpeed |
|
) |
| |
◆ ~MovingPlaform()
virtual pk::MovingPlaform::~MovingPlaform |
( |
| ) |
|
|
virtual |
◆ getSprite()
Get the sprite for the moving platform.
- Returns
- GLSprite& - a reference to a GLSprite object.
◆ setPlatformSpeed()
void pk::MovingPlaform::setPlatformSpeed |
( |
float |
speed | ) |
|
|
inline |
Set the platform speed.
- Parameters
-
float | speed - the speed given as a float. |
◆ update()
void pk::MovingPlaform::update |
( |
| ) |
|
Update the platform position. Call this function in the update portion of the game loop.
◆ m_body
◆ m_direction
int pk::MovingPlaform::m_direction |
|
private |
facing direction of the platform.
◆ m_endPosition
glm::vec2 pk::MovingPlaform::m_endPosition |
|
private |
ending position of the platform.
◆ m_initialPosition
glm::vec2 pk::MovingPlaform::m_initialPosition |
|
private |
initial position of the platform.
◆ m_platformSpeed
float pk::MovingPlaform::m_platformSpeed |
|
private |
speed of the platform movement.
◆ m_sprite
◆ m_world
b2World* pk::MovingPlaform::m_world |
|
private |
a pointer to a Box2D world.
The documentation for this class was generated from the following file: