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

Public Member Functions

 Obstacle (ObstacleType t, float x=12.0f)
void update (Zen::DeltaTime dt)
void reset (float x=12.0f)
bool collidesWith (const glm::vec2 &otherPos, const glm::vec2 &otherSize) const
float getBottomY () const

Public Attributes

glm::vec2 pos {12.0f, 0.0f}
glm::vec2 size {1.0f, 1.0f}
glm::vec4 colour {1.0f, 0.5f, 0.0f, 1.0f}
ObstacleType type = ObstacleType::SmallBox
float speed = 5.0f
bool active = true
Zen::ParticleEmitter emitter

Detailed Description

Definition at line 12 of file Obstacle.h.

Constructor & Destructor Documentation

◆ Obstacle()

Obstacle::Obstacle ( ObstacleType t,
float x = 12.0f )

Definition at line 3 of file Obstacle.cpp.

Member Function Documentation

◆ collidesWith()

bool Obstacle::collidesWith ( const glm::vec2 & otherPos,
const glm::vec2 & otherSize ) const

Definition at line 76 of file Obstacle.cpp.

◆ getBottomY()

float Obstacle::getBottomY ( ) const
inline

Definition at line 37 of file Obstacle.h.

◆ reset()

void Obstacle::reset ( float x = 12.0f)

Definition at line 56 of file Obstacle.cpp.

◆ update()

void Obstacle::update ( Zen::DeltaTime dt)

Definition at line 41 of file Obstacle.cpp.

Member Data Documentation

◆ active

bool Obstacle::active = true

Definition at line 20 of file Obstacle.h.

◆ colour

glm::vec4 Obstacle::colour {1.0f, 0.5f, 0.0f, 1.0f}

Definition at line 16 of file Obstacle.h.

◆ emitter

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

Definition at line 22 of file Obstacle.h.

◆ pos

glm::vec2 Obstacle::pos {12.0f, 0.0f}

Definition at line 14 of file Obstacle.h.

◆ size

glm::vec2 Obstacle::size {1.0f, 1.0f}

Definition at line 15 of file Obstacle.h.

◆ speed

float Obstacle::speed = 5.0f

Definition at line 19 of file Obstacle.h.

◆ type

ObstacleType Obstacle::type = ObstacleType::SmallBox

Definition at line 18 of file Obstacle.h.


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