Pabloader 4 anos atrás
pai
commit
905615b152
4 arquivos alterados com 12 adições e 2 exclusões
  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 Ver arquivo

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

BIN
res/bonuses.png Ver arquivo


+ 8
- 1
src/bonus.cpp Ver arquivo

@@ -8,7 +8,7 @@ Bonus::Bonus(Debuggers* game)
8 8
     : Entity(game, &game->bonusesSprite)
9 9
 {
10 10
     tileCols = 1;
11
-    tileRows = 2;
11
+    tileRows = 3;
12 12
 #ifdef _DEBUG
13 13
     DEBUG_COLOR = olc::YELLOW;
14 14
 #endif
@@ -18,4 +18,11 @@ BonusType Bonus::GetType()
18 18
 {
19 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 Ver arquivo

@@ -178,6 +178,7 @@ bool Debuggers::OnUserUpdate(float fElapsedTime)
178 178
     DrawString(1, 55, "Bonuses: " + std::to_string(bonuses.size()));
179 179
     DrawString(1, 64, "DBG: " + std::to_string(bonusesCatched[BONUS_DEBUGGER]));
180 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 183
     if (GetKey(olc::B).bPressed) {
183 184
         SpawnBug();

Carregando…
Cancelar
Salvar