| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
1 |
/* |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
2 |
=========================================================================== |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
3 |
blockattack - Block Attack - Rise of the Blocks |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
4 |
Copyright (C) 2005-2012 Poul Sander |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
5 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
6 |
This program is free software: you can redistribute it and/or modify |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
7 |
it under the terms of the GNU General Public License as published by |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
8 |
the Free Software Foundation, either version 2 of the License, or |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
9 |
(at your option) any later version. |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
10 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
11 |
This program is distributed in the hope that it will be useful, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
12 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
13 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
14 |
GNU General Public License for more details. |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
15 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
16 |
You should have received a copy of the GNU General Public License |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
17 |
along with this program. If not, see http://www.gnu.org/licenses/ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
18 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
19 |
Source information and contacts persons can be found at |
| 021de090 |
sago007 |
2015-12-30 18:56 |
20 |
http://blockattack.net |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
21 |
=========================================================================== |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
22 |
*/ |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
23 |
|
| 6d48320c |
sago007 |
2009-03-28 17:06 |
24 |
//Make sure it is only included once |
| 6d48320c |
sago007 |
2009-03-28 17:06 |
25 |
#ifndef _MAINVARS_HPP |
| 6d48320c |
sago007 |
2009-03-28 17:06 |
26 |
#define _MAINVARS_HPP |
| 6d48320c |
sago007 |
2009-03-28 17:06 |
27 |
|
| c6bde3e3 |
sago007 |
2015-12-22 16:56 |
28 |
#include "sago/SagoSprite.hpp" |
| c6bde3e3 |
sago007 |
2015-12-22 16:56 |
29 |
|
| c6bde3e3 |
sago007 |
2015-12-22 16:56 |
30 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
31 |
//main variables and constants |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
32 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
33 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
34 |
//Animation lengths: |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
35 |
#define READYTIME 500 |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
36 |
#define BOMBTIME 200 |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
37 |
#define CURSORTIME 200 |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
38 |
|
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
39 |
#ifndef SHAREDIR |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
40 |
#define SHAREDIR "." |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
41 |
#endif |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
42 |
|
| 56241205 |
sago007 |
2012-08-05 11:15 |
43 |
const char sharedir[] = SHAREDIR; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
44 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
45 |
//All graphic in the game (as pointers): |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
46 |
sago::SagoSprite backgroundImage; //Stores the background image |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
47 |
static sago::SagoSprite backBoard; //Stores the background to the board |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
48 |
static sago::SagoSprite bBack; //The "Back" button |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
49 |
static sago::SagoSprite bForward; //The "forward" button |
| 2f30c381 |
sago007 |
2008-09-14 13:08 |
50 |
#if NETWORK |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
51 |
//static sago::SagoSprite bNetwork; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
52 |
//static sago::SagoSprite bConnect; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
53 |
//static sago::SagoSprite bHost; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
54 |
#endif |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
55 |
static sago::SagoSprite bHighScore; //The High Score botton |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
56 |
static sago::SagoSprite blackLine; //The seperator in stage clear |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
57 |
static sago::SagoSprite stageBobble; //The bobble instage clear |
| 078900fe |
sago007 |
2015-12-05 15:31 |
58 |
SDL_Renderer *screen; //The whole screen; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
59 |
static sago::SagoSprite iGameOver; //The gameOver image |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
60 |
static sago::SagoSprite iWinner; //the "winner" image |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
61 |
static sago::SagoSprite iDraw; //the "draw" image |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
62 |
static sago::SagoSprite iLoser; //the "loser" image |
| c1bd83fb |
sago007 |
2015-12-23 19:41 |
63 |
static sago::SagoSprite iChainFrame; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
64 |
//Animations: |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
65 |
static sago::SagoSprite cursor; //The animated cursor |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
66 |
static sago::SagoSprite bomb; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
67 |
static sago::SagoSprite ready; //Before the blocks fall |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
68 |
static sago::SagoSprite explosion[4]; //Then a block explodes |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
69 |
//Animations end |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
70 |
static sago::SagoSprite counter[3]; //Counts down from 3 |
| c6bde3e3 |
sago007 |
2015-12-22 16:56 |
71 |
static sago::SagoSprite bricks[7]; //The bricks, saved in an array of pointers |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
72 |
static sago::SagoSprite crossover; //Cross the bricks that will be cleared soon |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
73 |
static sago::SagoSprite balls[7]; //The balls (the small ones that jump around) |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
74 |
static sago::SagoSprite dialogBox; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
75 |
static sago::SagoSprite iLevelCheck; //To the level select screen |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
76 |
static sago::SagoSprite iLevelCheckBox; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
77 |
static sago::SagoSprite iLevelCheckBoxMarked; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
78 |
static sago::SagoSprite iCheckBoxArea; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
79 |
static sago::SagoSprite boardBackBack; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
80 |
static sago::SagoSprite garbageTL; //the Garbage Blocks |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
81 |
static sago::SagoSprite garbageT; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
82 |
static sago::SagoSprite garbageTR; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
83 |
static sago::SagoSprite garbageR; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
84 |
static sago::SagoSprite garbageBR; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
85 |
static sago::SagoSprite garbageB; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
86 |
static sago::SagoSprite garbageBL; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
87 |
static sago::SagoSprite garbageL; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
88 |
static sago::SagoSprite garbageFill; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
89 |
static sago::SagoSprite garbageM; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
90 |
static sago::SagoSprite garbageML; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
91 |
static sago::SagoSprite garbageMR; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
92 |
static sago::SagoSprite smiley[4]; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
93 |
static sago::SagoSprite garbageGM; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
94 |
static sago::SagoSprite garbageGML; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
95 |
static sago::SagoSprite garbageGMR; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
96 |
static sago::SagoSprite transCover; //The transperant block, covers the upcomming |
| 1572de2b |
sago007 |
2008-09-11 18:15 |
97 |
#if LEVELEDITOR |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
98 |
static sago::SagoSprite bCreateFile; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
99 |
static sago::SagoSprite bDeletePuzzle; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
100 |
static sago::SagoSprite bLoadFile; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
101 |
static sago::SagoSprite bMoveBack; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
102 |
static sago::SagoSprite bMoveDown; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
103 |
static sago::SagoSprite bMoveForward; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
104 |
static sago::SagoSprite bMoveLeft; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
105 |
static sago::SagoSprite bMoveRight; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
106 |
static sago::SagoSprite bMoveUp; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
107 |
static sago::SagoSprite bNewPuzzle; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
108 |
static sago::SagoSprite bSaveFileAs; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
109 |
static sago::SagoSprite bSavePuzzle; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
110 |
static sago::SagoSprite bSaveToFile; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
111 |
static sago::SagoSprite bTestPuzzle; |
| 1572de2b |
sago007 |
2008-09-11 18:15 |
112 |
#endif |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
113 |
static sago::SagoSprite bSkip; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
114 |
static sago::SagoSprite bRetry; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
115 |
static sago::SagoSprite bNext; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
116 |
|
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
117 |
sago::SagoSprite menuMarked; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
118 |
sago::SagoSprite menuUnmarked; |
| 1d2e2129 |
sago007 |
2015-12-23 15:41 |
119 |
sago::SagoSprite mouse; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
120 |
|
| 925b7e58 |
sago007 |
2011-04-25 16:35 |
121 |
static NFont nf_button_font; //Font used for buttons! |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
122 |
NFont nf_scoreboard_font; |
| 925b7e58 |
sago007 |
2011-04-25 16:35 |
123 |
static NFont nf_standard_blue_font; //Font used instead of the old blue SFont |
| 925b7e58 |
sago007 |
2011-04-25 16:35 |
124 |
static NFont nf_standard_small_font; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
125 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
126 |
static Mix_Music *bgMusic; //backgroundMusic |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
127 |
static Mix_Music *highbeatMusic; //Background music with higher beat |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
128 |
static Mix_Chunk *boing; //boing sound when clearing |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
129 |
static Mix_Chunk *applause; //Applause, then the player is good |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
130 |
static Mix_Chunk *photoClick; //clickSound |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
131 |
static Mix_Chunk *typingChunk; //When writing |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
132 |
static Mix_Chunk *counterChunk; //When counting down |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
133 |
static Mix_Chunk *counterFinalChunk; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
134 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
135 |
Highscore theTopScoresEndless; //Stores highscores for endless |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
136 |
Highscore theTopScoresTimeTrial; //Stores highscores for timetrial |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
137 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
138 |
static bool bMouseUp; //true if the mouse(1) is unpressed |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
139 |
static bool bMouseUp2; //true if the mouse(2) is unpressed |
| 2f30c381 |
sago007 |
2008-09-14 13:08 |
140 |
#if NETWORK |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
141 |
static bool bNetworkOpen; //Show the network menu |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
142 |
#endif |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
143 |
static bool bScreenLocked; //Don't take input or allow any mouse interaction! Used for dialogbox and warningbox |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
144 |
static bool showDialog; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
145 |
static bool NoSound; //if true, absolutely no sound will be played, can be set from the commandline |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
146 |
//prevents crash on systems without a soundcard |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
147 |
bool MusicEnabled; //true if background music is enabled |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
148 |
bool SoundEnabled; //true if sound effects is enabled |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
149 |
static bool bNearDeathPrev; //Near death status last time checked. |
| 26ddb424 |
sago007 |
2011-06-09 20:06 |
150 |
bool bFullscreen; //true if game is running fullscreen |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
151 |
static bool puzzleLoaded; //true if the puzzle levels have been loaded |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
152 |
static bool drawBalls; //if true balls are drawed to the screen, this might lower framerate too much |
| b7590374 |
sago007 |
2011-05-19 16:15 |
153 |
bool highPriority; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
154 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
155 |
static bool editorMode = false; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
156 |
static bool editorModeTest = false; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
157 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
158 |
//Things for network play: |
| 2f30c381 |
sago007 |
2008-09-14 13:08 |
159 |
#if NETWORK |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
160 |
static bool networkPlay; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
161 |
static bool networkActive; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
162 |
//sockets here |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
163 |
#define SERVERPORT 41780 |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
164 |
#define CLIENTPORT 41781 |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
165 |
|
| 2f30c381 |
sago007 |
2008-09-14 13:08 |
166 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
167 |
static char serverAddress[30]; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
168 |
#endif |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
169 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
170 |
//other ball constants: |
| b37fa2db |
sago007 |
2015-12-04 20:44 |
171 |
const double gravity = 200.8; //acceleration |
| b37fa2db |
sago007 |
2015-12-04 20:44 |
172 |
const double startVelocityY = 50.0; |
| b37fa2db |
sago007 |
2015-12-04 20:44 |
173 |
const double VelocityX = 50.0; |
| b37fa2db |
sago007 |
2015-12-04 20:44 |
174 |
const int ballSize = 16; |
| b37fa2db |
sago007 |
2015-12-04 20:44 |
175 |
const double minVelocity = 200.0; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
176 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
177 |
//global settings (reset everytime the game starts) |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
178 |
static Uint8 player1Speed=0; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
179 |
static Uint8 player2Speed=0; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
180 |
static bool player1AI=false; //Is AI enabled? |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
181 |
static bool player2AI=false; //Is AI enabled for player 2 (opponent in single player) |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
182 |
static Uint8 player1AIlevel=3; //What level is AI? 0 min, 6 max |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
183 |
static Uint8 player2AIlevel=3; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
184 |
static const Uint8 AIlevels=7; //7 possible levels: 0..6 |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
185 |
static Uint8 player1handicap=0; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
186 |
static Uint8 player2handicap=0; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
187 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
188 |
unsigned long int currentTime; //contains the current time, so we don't call SDL_GetTickets() too often... |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
189 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
190 |
static int xsize = 1024; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
191 |
static int ysize = 768; |
| 970c4ebe |
sago007 |
2015-08-22 18:08 |
192 |
static const int bsize = 50; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
193 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
194 |
//Stores the players names (way to long, but at least no buffer overflows (max length is 16 for display reasons)) |
| f6707482 |
sago007 |
2015-12-04 22:55 |
195 |
std::string player1name; |
| f6707482 |
sago007 |
2015-12-04 22:55 |
196 |
std::string player2name; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
197 |
|
| f72abf8b |
sago007 |
2010-01-16 20:00 |
198 |
bool twoPlayers; //True if two players are playing |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
199 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
200 |
//Old Stage Clear Buble |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
201 |
static int oldBubleX, oldBubleY; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
202 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
203 |
static bool singlePuzzle = false; //if true we are just in a little 300x600 window |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
204 |
static int singlePuzzleNr = 0; |
| 90e6c797 |
sago007 |
2015-11-22 21:46 |
205 |
static std::string singlePuzzleFile; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
206 |
|
| 1572de2b |
sago007 |
2008-09-11 18:15 |
207 |
#if DEBUG |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
208 |
//frame counter (fps) |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
209 |
unsigned long int Frames, Ticks; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
210 |
char FPS[10]; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
211 |
#endif |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
212 |
|
| 56241205 |
sago007 |
2012-08-05 11:15 |
213 |
int verboseLevel = 0; |
| 56241205 |
sago007 |
2012-08-05 11:15 |
214 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
215 |
//keySetup |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
216 |
int player1keys, player2keys; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
217 |
bool mouseplay1=false; //The mouse works on the play field |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
218 |
bool mouseplay2=false; //Same for player2 |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
219 |
bool joyplay1=false; //Player one uses the joypad |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
220 |
bool joyplay2=false; //Player two uses the joypad |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
221 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
222 |
//Stores the controls |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
223 |
struct control |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
224 |
{ |
| 078900fe |
sago007 |
2015-12-05 15:31 |
225 |
SDL_Keycode up; |
| 078900fe |
sago007 |
2015-12-05 15:31 |
226 |
SDL_Keycode down; |
| 078900fe |
sago007 |
2015-12-05 15:31 |
227 |
SDL_Keycode left; |
| 078900fe |
sago007 |
2015-12-05 15:31 |
228 |
SDL_Keycode right; |
| 078900fe |
sago007 |
2015-12-05 15:31 |
229 |
SDL_Keycode change; |
| 078900fe |
sago007 |
2015-12-05 15:31 |
230 |
SDL_Keycode push; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
231 |
}; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
232 |
|
| 593aeae4 |
sago007 |
2011-06-25 22:42 |
233 |
control keySettings[3]; //array to hold the controls (default and two custom) |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
234 |
|
| 95bc02ff |
sago007 |
2009-03-15 02:46 |
235 |
#define KEYMENU_MAXWITH 4 |
| 95bc02ff |
sago007 |
2009-03-15 02:46 |
236 |
#define KEYMENU_MAXDEPTH 7 |
| 95bc02ff |
sago007 |
2009-03-15 02:46 |
237 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
238 |
enum stageButton {SBdontShow, SBstageClear, SBpuzzleMode}; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
239 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
240 |
static stageButton stageButtonStatus = SBdontShow; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
241 |
|
| 30f910dd |
sago007 |
2010-11-10 21:02 |
242 |
static const int buttonXsize = 120; |
| 30f910dd |
sago007 |
2010-11-10 21:02 |
243 |
static const int buttonYsize = 40; |
| 9050a50a |
sago007 |
2008-12-09 13:35 |
244 |
|
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
245 |
struct ButtonCords |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
246 |
{ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
247 |
int x; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
248 |
int y; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
249 |
int xsize; |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
250 |
int ysize; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
251 |
}; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
252 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
253 |
ButtonCords cordNextButton = |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
254 |
{ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
255 |
cordNextButton.x = 3*bsize+(3*bsize-buttonXsize)/2, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
256 |
cordNextButton.y = 10*bsize, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
257 |
cordNextButton.xsize = buttonXsize, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
258 |
cordNextButton.ysize = buttonYsize |
| 6d48320c |
sago007 |
2009-03-28 17:06 |
259 |
}; |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
260 |
|
| c53e6443 |
sago007 |
2012-04-17 11:04 |
261 |
ButtonCords cordRetryButton = |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
262 |
{ |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
263 |
cordRetryButton.x = (3*bsize-buttonXsize)/2, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
264 |
cordRetryButton.y = 10*bsize, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
265 |
cordRetryButton.xsize = buttonXsize, |
| c53e6443 |
sago007 |
2012-04-17 11:04 |
266 |
cordRetryButton.ysize = buttonYsize |
| 89c4a3a6 |
sago007 |
2008-08-29 14:32 |
267 |
}; |
| 6d48320c |
sago007 |
2009-03-28 17:06 |
268 |
|
| eec83b7d |
sago007 |
2009-03-29 15:46 |
269 |
#endif |
|
|
1970-01-01 00:00 |
270 |
|