ScummVM API documentation
shootemup.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 /*
23 * This code is based on the original source code of Lord Avalot d'Argent version 1.3.
24 * Copyright (c) 1994-1995 Mike, Mark and Thomas Thurman.
25 */
26 
27 #ifndef AVALANCHE_SHOOTEMUP_H
28 #define AVALANCHE_SHOOTEMUP_H
29 
30 namespace Avalanche {
31 class AvalancheEngine;
32 
33 class ShootEmUp {
34 public:
36 
37  uint16 run();
38 
39 private:
40  struct Sprite {
41  int8 _ix, _iy;
42  int16 _x, _y;
43  int8 _p;
44  int16 _timeout;
45  bool _cameo;
46  byte _cameoFrame;
47  bool _missile;
48  bool _wipe;
49  };
50 
51  struct Runner {
52  int16 _x, _y;
53  byte _frame;
54  byte _tooHigh;
55  byte _lowest;
56  int8 _ix, _iy;
57  byte _frameDelay;
58  };
59 
60  static const byte kStocks;
61  static const byte kAvvyShoots;
62  static const byte kFacingRight;
63  static const byte kFacingLeft;
64  static const long int kFlag;
65  static const byte kFrameDelayMax;
66  static const byte kAvvyY;
67  static const byte kShooting[7];
68  static const byte kTimesASecond;
69  static const byte kFlashTime;
70  static const byte kLeftMargin;
71  static const int16 kRightMargin;
72 
73  AvalancheEngine *_vm;
74 
75  uint16 _score;
76  byte _time;
77  byte _stockStatus[7];
78  Sprite _sprites[99];
79  byte _rectNum; // Original: 'rsize'
80  Common::Rect _rectangles[99];
81  uint16 _avvyWas;
82  uint16 _avvyPos;
83  byte _avvyAnim;
84  byte _avvyFacing;
85  bool _altWasPressedBefore;
86  byte _throwNext;
87  bool _firing;
88  Runner _running[4];
89  bool _hasEscaped[7];
90  byte _count321;
91  byte _howManyHaveEscaped;
92  uint16 _escapeCount;
93  bool _escaping;
94  byte _timeThisSecond;
95  bool _cp;
96  byte _wasFacing;
97  byte _escapeStock;
98  bool _gotOut;
99 
100  bool overlap(uint16 a1x, uint16 a1y, uint16 a2x, uint16 a2y, uint16 b1x, uint16 b1y, uint16 b2x, uint16 b2y);
101  byte getStockNumber(byte index);
102  void blankIt();
103  void moveThem();
104  void blank(Common::Rect rect);
105  void plotThem();
106  void define(int16 x, int16 y, int8 p, int8 ix, int8 iy, int16 time, bool isAMissile, bool doWeWipe);
107  void defineCameo(int16 x, int16 y, int8 p, int16 time);
108  void showStock(byte index);
109  void drawNumber(int number, int size, int x);
110  void showScore();
111  void showTime();
112  void gain(int8 howMuch);
113  void newEscape();
114  void nextPage(); // Internal function of 'instructions' in the original.
115  void instructions();
116  void setup();
117  void initRunner(int16 xx, int16 yy, byte f1, byte f2, int8 ixx, int8 iyy);
118  void moveAvvy();
119  void readKbd();
120  void animate();
121  void collisionCheck();
122  void turnAround(byte who, bool randomX);
123  void bumpFolk();
124  void peopleRunning();
125  void updateTime();
126  void hitPeople();
127  void escapeCheck();
128  void check321();
129 };
130 
131 } // End of namespace Avalanche
132 
133 #endif // AVALANCHE_SHOOTEMUP_H
Definition: animation.h:32
Definition: rect.h:144
Definition: avalanche.h:74
Definition: shootemup.h:33