Pong/Levels/Game.h

36 lines
720 B
C
Raw Permalink Normal View History

2023-11-11 18:56:55 -08:00
#pragma once
2024-06-29 22:28:46 -07:00
#include <lwe/Level.h>
#include <lwe/RenderWindow.h>
2023-11-11 18:56:55 -08:00
class Game : public lwe::Level
{
2023-11-14 00:07:42 -08:00
private:
static const float paddleSpeed;
static const float ballSpeed;
2024-06-29 22:28:46 -07:00
ehs::UInt_64 plyScore;
ehs::UInt_64 aiScore;
2023-11-14 00:07:42 -08:00
bool started;
2023-11-11 18:56:55 -08:00
public:
~Game() override;
Game();
Game(const Game& lvl);
Game& operator=(const Game& lvl);
2024-06-29 22:28:46 -07:00
void SetupResources(lwe::GpuInterface *inf) override;
2023-11-11 18:56:55 -08:00
2024-06-29 22:28:46 -07:00
void Setup(lwe::GpuInterface *inf) override;
2023-11-11 18:56:55 -08:00
void PostInitialize(lwe::GpuCmdBuffer* cmdBuffer) override;
2024-06-29 22:28:46 -07:00
void OnUpdate(lwe::RenderWindow* win, ehs::Input* input, const float delta) override;
2023-11-11 18:56:55 -08:00
void PreRender(lwe::GpuCmdBuffer* cmdBuffer) override;
2023-11-14 00:07:42 -08:00
private:
void ResetGame(const lwe::Entity* bounds, lwe::Entity* ball);
2023-11-11 18:56:55 -08:00
};