123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef DEBUGGERS_H
- #define DEBUGGERS_H
-
- #include "bug.h"
- #include "olcPGEX_Sound.h"
- #include "olcPixelGameEngine.h"
- #include "programmer.h"
- #include "player.h"
- #include <vector>
- #include <string>
-
- namespace pabloader {
- class Debuggers : public olc::PixelGameEngine {
- private:
- std::vector<Programmer*> programmers;
- uint32_t bugsCatched = 0;
- uint32_t bugsMissed = 0;
-
- uint8_t linesOfCode = 5;
- uint16_t totalLines;
- std::vector<std::string> sourceCode;
-
- public:
- Debuggers()
- {
- sAppName = "Debuggers";
- }
-
- public:
- bool OnUserCreate() override;
- bool OnUserUpdate(float fElapsedTime) override;
- bool OnUserDestroy() override;
- int GameScreenHeight() { return ScreenHeight() - linesOfCode * 10; };
-
- private:
- void SpawnProgrammer();
- void SpawnBug();
- Bug* CreateBug();
- bool GameOver();
-
- public:
- std::vector<Bug*> bugs;
-
- olc::ResourcePack pack;
- olc::Sprite playerSprite;
- olc::Sprite enemiesSprite;
- olc::Sprite backgroundSprite;
- int playerFallSample;
- int bugFallSample;
- int bugCatchSample;
- };
- }
-
- #endif
|