Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
vor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
you can quite regardles of game state
[vor.git]
/
main.c
diff --git
a/main.c
b/main.c
index
0486c7e
..
1680129
100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-111,11
+111,6
@@
char *data_dir;
extern char *optarg;
extern int optind, opterr, optopt;
extern char *optarg;
extern int optind, opterr, optopt;
-float dist_sq(float x1, float y1, float x2, float y2)
-{
- return (x2-x1)*(x2-x1) + (y2-y1)*(y2-y1);
-}
-
// ************************************* FUNCS
float
// ************************************* FUNCS
float
@@
-775,6
+770,8
@@
gameloop() {
// Play the explosion sound
play_sound(0);
makebangdots(shipx,shipy,shipdx,shipdy,surf_ship,30);
// Play the explosion sound
play_sound(0);
makebangdots(shipx,shipy,shipdx,shipdy,surf_ship,30);
+ shipdx = 0;
+ shipdy = 0;
if(--nships <= 0) {
gameover = 1;
state = GAME_OVER;
if(--nships <= 0) {
gameover = 1;
state = GAME_OVER;
@@
-785,18
+782,12
@@
gameloop() {
else {
state = DEAD_PAUSE;
state_timeout = DEAD_PAUSE_LENGTH;
else {
state = DEAD_PAUSE;
state_timeout = DEAD_PAUSE_LENGTH;
- shipdx = 0;
- shipdy = 0;
}
}
SDL_PumpEvents();
keystate = SDL_GetKeyState(NULL);
}
}
SDL_PumpEvents();
keystate = SDL_GetKeyState(NULL);
- if(state != HIGH_SCORE_ENTRY && (keystate[SDLK_q] || keystate[SDLK_ESCAPE])) {
- return 0;
- }
-
if(keystate[SDLK_SPACE] && (state == HIGH_SCORE_DISPLAY || state == TITLE_PAGE)) {
reset_rocks();
if(keystate[SDLK_SPACE] && (state == HIGH_SCORE_DISPLAY || state == TITLE_PAGE)) {
reset_rocks();
@@
-850,6
+841,11
@@
gameloop() {
state_timeout = -1;
}
}
state_timeout = -1;
}
}
+
+ if(state != HIGH_SCORE_ENTRY && (keystate[SDLK_q] || keystate[SDLK_ESCAPE])) {
+ return 0;
+ }
+
}
}
}
}