OSDN Git Service

Project: Starfighter 1.4 オリジナル
[starfighter-jp/starfighter-jp.git] / src / engine.cpp
1 /*
2 Copyright (C) 2003 Parallel Realities
3 Copyright (C) 2011, 2012, 2013 Guus Sliepen
4 Copyright (C) 2015 Julian Marchant
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either version 3
9 of the License, or (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program.  If not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #include "Starfighter.h"
21
22 Engine engine;
23
24 void engine_init()
25 {
26         engine.musicVolume = 100;
27         engine.useAudio = true;
28
29         engine.maxAliens = 9;
30
31         engine.ssx = 0;
32         engine.ssy = 0;
33         engine.smx = 0;
34         engine.smy = 0;
35
36         engine.bulletHead = new object;
37         engine.bulletHead->next = NULL;
38         engine.bulletTail = engine.bulletHead;
39
40         engine.explosionHead = new object;
41         engine.explosionHead->next = NULL;
42         engine.explosionTail = engine.explosionHead;
43
44         engine.collectableHead = new collectables;
45         engine.collectableHead->next = NULL;
46         engine.collectableTail = engine.collectableHead;
47
48         engine.debrisHead = new object;
49         engine.debrisHead->next = NULL;
50         engine.debrisTail = engine.debrisHead;
51
52         engine.commsSection = 0;
53
54         for (int i = 0; i < KEY_LAST; i++)
55                 engine.keyState[i] = 0;
56
57         engine.eventTimer = 0;
58         engine.counter2 = 0;
59         engine.timeTaken = 0;
60         engine.timeMission = 0;
61         engine.counter = 0;
62         engine.seconds = 0;
63         engine.minutes = 0;
64         engine.paused = false;
65         engine.gameSection = SECTION_TITLE;
66
67         engine.cheat = false;
68         engine.cheatShield = false;
69         engine.cheatAmmo = false;
70         engine.cheatCash = false;
71 }