This commit is contained in:
MarcEricMartel
2021-12-07 18:59:50 -05:00
parent 078cb33c27
commit 8e2169420e
16 changed files with 204 additions and 36 deletions

View File

@@ -14,6 +14,7 @@
#include "array2d.h"
#include "world.h"
#include "perlin.h"
#include "bullet.h"
class Engine : public OpenglContext {
public:
@@ -32,7 +33,7 @@ public:
private:
bool LoadTexture(Texture& texture, const std::string& filename, bool stopOnError = true);
void DrawHud(float elapsedTime);
void DrawHud(float elapsedTime, BlockType bloc);
void PrintText(unsigned int x, unsigned int y, const std::string& t);
int GetFps(float elapsedTime) const;
@@ -56,8 +57,14 @@ private:
Skybox m_skybox;
Audio m_audio = Audio(AUDIO_PATH "music01.wav");
irrklang::ISound* m_powpow;
irrklang::ISound* m_step;
irrklang::ISound* m_scream;
Player m_player = Player(Vector3f(0, CHUNK_SIZE_Y + 1.8f, 0));
Bullet* m_bullets[MAX_BULLETS];
bool m_keyW = false;
bool m_keyA = false;
bool m_keyS = false;
@@ -71,6 +78,7 @@ private:
bool m_mouseWD = false;
bool m_block = false;
bool m_flash = true;
};