ScummVM API documentation
bbloogie.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef BBVS_MINIGAMES_BBLOOGIE_H
23 #define BBVS_MINIGAMES_BBLOOGIE_H
24 
25 #include "bbvs/minigames/minigame.h"
26 
27 namespace Bbvs {
28 
29 class MinigameBbLoogie : public Minigame {
30 public:
31  MinigameBbLoogie(BbvsEngine *vm) : Minigame(vm) {};
32  bool run(bool fromMainGame) override;
33 public:
34 
35  struct Obj {
36  int kind;
37  int x, y;
38  int xIncr, yIncr;
39  const ObjAnimation *anim;
40  int frameIndex;
41  int ticks;
42  int status;
43  int16 frameIndexAdd;
44  int16 unk2;
45  };
46 
47  enum {
48  kMaxObjectsCount = 256
49  };
50 
51  enum {
52  kGSTitleScreen = 0, // Title screen
53  kGSMainGame = 1, // Game when called as part of the main game
54  kGSStandaloneGame = 2, // Game when called as standalone game
55  kGSScoreCountUp = 3 // Score countup and next level text
56  };
57 
58  Obj _objects[kMaxObjectsCount];
59 
60  int _playerKind;
61  const ObjAnimation *_playerAnim;
62  const uint *_playerSounds1, *_playerSounds2;
63  uint _playerSounds1Count, _playerSounds2Count;
64 
65  int _level, _levelTimeLeft, _levelTimeDelay;
66  int _numberOfHits, _currScore, _hiScore;
67  int _doubleScore, _megaLoogieCount;
68 
69  int _dispLevelScore, _nextLevelScore;
70 
71  int _timeBonusCtr, _bonusDisplayDelay1, _bonusDisplayDelay2, _bonusDisplayDelay3;
72 
73  int _carDelay;
74  int _bikeDelay;
75  int _squirrelDelay;
76  bool _squirrelDirection;
77  int _paperPlaneDelay;
78  int _principalDelay;
79 
80  int _prevPrincipalStatus;
81  int _principalCtr, _principalFirstFrameIndex, _principalLastFrameIndex;
82  bool _principalAngry;
83 
84  char _prefix[20];
85 
86  const ObjAnimation *getAnimation(int animIndex);
87 
88  void buildDrawList(DrawList &drawList);
89  void buildDrawList0(DrawList &drawList);
90  void buildDrawList1(DrawList &drawList);
91  void buildDrawList2(DrawList &drawList);
92  void buildDrawList3(DrawList &drawList);
93 
94  void drawSprites();
95 
96  void initObjs();
97  Obj *getFreeObject();
98  Obj *findLoogieObj(int startObjIndex);
99  bool isHit(Obj *obj1, Obj *obj2);
100  bool isCursorAtObj(int objIndex);
101 
102  void initObjects();
103  void initObjects0();
104  void initObjects1();
105  void initObjects3();
106 
107  void initVars();
108  void initVars0();
109  void initVars1();
110  void initVars2();
111  void initVars3();
112 
113  bool updateStatus(int mouseX, int mouseY, uint mouseButtons);
114  bool updateStatus0(int mouseX, int mouseY, uint mouseButtons);
115  bool updateStatus1(int mouseX, int mouseY, uint mouseButtons);
116  bool updateStatus2(int mouseX, int mouseY, uint mouseButtons);
117  bool updateStatus3(int mouseX, int mouseY, uint mouseButtons);
118 
119  void updateObjs(uint mouseButtons);
120  void updatePlayer(int objIndex, uint mouseButtons);
121  void updateObjKind2(int objIndex);
122  void updateLoogie(int objIndex);
123  void updateCar(int objIndex);
124  void updateBike(int objIndex);
125  void updateSquirrel(int objIndex);
126  void updatePaperPlane(int objIndex);
127  void updateIndicator(int objIndex);
128  void updatePrincipal(int objIndex);
129 
130  void incNumberOfHits();
131  void incScore(int incrAmount);
132  void playRndSound();
133 
134  void update();
135 
136  void loadSounds();
137 
138 };
139 
140 } // End of namespace Bbvs
141 
142 #endif // BBVS_MINIGAMES_BBLOOGIE_H
Definition: graphics.h:38
Definition: minigame.h:47
Definition: minigame.h:40
Definition: bbloogie.h:29
Definition: bbvs.h:42
Definition: bbloogie.h:35
Definition: bbvs.h:248