Pabloader 5 years ago
parent
commit
905615b152
4 changed files with 12 additions and 2 deletions
  1. 3
    1
      include/bonus.h
  2. BIN
      res/bonuses.png
  3. 8
    1
      src/bonus.cpp
  4. 1
    0
      src/debuggers.cpp

+ 3
- 1
include/bonus.h View File

7
 
7
 
8
 enum BonusType {
8
 enum BonusType {
9
     BONUS_DEBUGGER = 0,
9
     BONUS_DEBUGGER = 0,
10
-    BONUS_UNIT_TEST = 1
10
+    BONUS_UNIT_TEST = 1,
11
+    BONUS_DOCUMENTATION = 2
11
 };
12
 };
12
 
13
 
13
 class Bonus : public Entity {
14
 class Bonus : public Entity {
14
 public:
15
 public:
15
     Bonus(Debuggers* game);
16
     Bonus(Debuggers* game);
16
     BonusType GetType();
17
     BonusType GetType();
18
+    void ResetPosition() override;
17
 };
19
 };
18
 }
20
 }
19
 
21
 

BIN
res/bonuses.png View File


+ 8
- 1
src/bonus.cpp View File

8
     : Entity(game, &game->bonusesSprite)
8
     : Entity(game, &game->bonusesSprite)
9
 {
9
 {
10
     tileCols = 1;
10
     tileCols = 1;
11
-    tileRows = 2;
11
+    tileRows = 3;
12
 #ifdef _DEBUG
12
 #ifdef _DEBUG
13
     DEBUG_COLOR = olc::YELLOW;
13
     DEBUG_COLOR = olc::YELLOW;
14
 #endif
14
 #endif
18
 {
18
 {
19
     return static_cast<BonusType>(tileX * 4 + tileY);
19
     return static_cast<BonusType>(tileX * 4 + tileY);
20
 }
20
 }
21
+
22
+void Bonus::ResetPosition()
23
+{
24
+    Entity::ResetPosition();
25
+    rotation = 0;
26
+    rotationSpeed = 0;
27
+}
21
 }
28
 }

+ 1
- 0
src/debuggers.cpp View File

178
     DrawString(1, 55, "Bonuses: " + std::to_string(bonuses.size()));
178
     DrawString(1, 55, "Bonuses: " + std::to_string(bonuses.size()));
179
     DrawString(1, 64, "DBG: " + std::to_string(bonusesCatched[BONUS_DEBUGGER]));
179
     DrawString(1, 64, "DBG: " + std::to_string(bonusesCatched[BONUS_DEBUGGER]));
180
     DrawString(1, 73, "UTS: " + std::to_string(bonusesCatched[BONUS_UNIT_TEST]));
180
     DrawString(1, 73, "UTS: " + std::to_string(bonusesCatched[BONUS_UNIT_TEST]));
181
+    DrawString(1, 82, "DOC: " + std::to_string(bonusesCatched[BONUS_DOCUMENTATION]));
181
     
182
     
182
     if (GetKey(olc::B).bPressed) {
183
     if (GetKey(olc::B).bPressed) {
183
         SpawnBug();
184
         SpawnBug();

Loading…
Cancel
Save