Zen
0.3.0
Loading...
Searching...
No Matches
Player.h
1
#pragma once
2
#include <glm/glm.hpp>
3
#include <particles/ZEN_ParticleSystem.h>
4
#include <zen/time/ZEN_DeltaTime.h>
5
6
class
Player
{
7
public
:
8
glm::vec2 pos{0.0f, 0.0f};
9
float
vy = 0.0f;
10
11
float
gravity = -50.0f;
// units/s^2
12
float
jumpPower = 18.0f;
// units/s
13
float
width = 1.0f;
14
float
height = 1.0f;
15
glm::vec4 colour = {1.0f, 0.0f, 0.0f, 1.0f};
16
17
Zen::ParticleEmitter
emitter{
18
{0, 0},
19
{1, 1},
20
{1, 1, 1, 1}
21
};
22
23
bool
onGround()
const
;
24
void
update(
Zen::DeltaTime
deltaTime,
bool
jumpPressed);
25
26
bool
wasOnGround()
const
{
return
m_wasOnGround; }
27
bool
justJumped()
const
{
return
m_justJumped; }
28
glm::vec2 getSize()
const
{
return
{width, height}; }
29
30
private
:
31
bool
m_wasOnGround =
true
;
32
bool
m_justJumped =
false
;
33
};
Player
Definition
Player.h:6
Zen::DeltaTime
Definition
ZEN_DeltaTime.h:4
Zen::ParticleEmitter
Definition
ZEN_ParticleSystem.h:61
editor
src
Player.h
Generated by
1.14.0