JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
oops, can't remember that && has higher precedence than ||.
authorJoshua Grams <josh@qualdan.com>
Mon, 13 Dec 2004 22:01:25 +0000 (22:01 +0000)
committerJoshua Grams <josh@qualdan.com>
Mon, 13 Dec 2004 22:01:25 +0000 (22:01 +0000)
Also need to move blast (and ship) forwards if we're at the left edge.

main.c

diff --git a/main.c b/main.c
index 68c77a4..de95347 100644 (file)
--- a/main.c
+++ b/main.c
@@ -1005,8 +1005,6 @@ int gameloop() {
                                                state = GAMEPLAY;
                                                play_tune(1);
                                                xship -= 50;
                                                state = GAMEPLAY;
                                                play_tune(1);
                                                xship -= 50;
-                                               // xvel = 3;
-                                               // yvel = 0;
                                        break;
                                        case GAME_OVER:
                                                state = HIGH_SCORE_ENTRY;
                                        break;
                                        case GAME_OVER:
                                                state = HIGH_SCORE_ENTRY;
@@ -1054,6 +1052,7 @@ int gameloop() {
                        } else {
                                if(state == DEAD_PAUSE) {
                                        float blast_radius = START_RAD * state_timeout / 50.0;
                        } else {
                                if(state == DEAD_PAUSE) {
                                        float blast_radius = START_RAD * state_timeout / 50.0;
+                                       if(xship < 60) xship = 60;
                                        for(i = 0; i<MAXROCKS; i++ ) {
                                                float dx, dy, n;
                                                if(rock[i].x <= 0) continue;
                                        for(i = 0; i<MAXROCKS; i++ ) {
                                                float dx, dy, n;
                                                if(rock[i].x <= 0) continue;
@@ -1118,7 +1117,7 @@ int gameloop() {
                        for(i = 0; i<MAXROCKS; i++) if(rock[i].active) {
                                rock[i].x += rock[i].xvel*movementrate;
                                rock[i].y += rock[i].yvel*movementrate + yscroll;
                        for(i = 0; i<MAXROCKS; i++) if(rock[i].active) {
                                rock[i].x += rock[i].xvel*movementrate;
                                rock[i].y += rock[i].yvel*movementrate + yscroll;
-                               if(rock[i].dead && rock[i].y < 0 || rock[i].y > YSIZE) rock[i].active = 0;
+                               if(rock[i].dead && (rock[i].y < 0 || rock[i].y > YSIZE)) rock[i].active = 0;
                                if(rock[i].y > YSIZE) {
                                        rock[i].y -= YSIZE;
                                        rock[i].y -= rock[i].image->w;
                                if(rock[i].y > YSIZE) {
                                        rock[i].y -= YSIZE;
                                        rock[i].y -= rock[i].image->w;