Remove dependency on local state in step()
authorThomas Perl <thp@thpinfo.com>
Tue, 4 Aug 2009 16:55:34 +0000 (4 18:55 +0200)
committerThomas Perl <thp@thpinfo.com>
Tue, 4 Aug 2009 16:55:34 +0000 (4 18:55 +0200)
Allows for adding network support easier later.

game.c
game.h

diff --git a/game.c b/game.c
index d6d3a6e..06941f5 100644 (file)
--- a/game.c
+++ b/game.c
@@ -385,7 +385,7 @@ bool step( GameState* s) {
     SDL_PumpEvents();
     keys = SDL_GetKeyState(NULL);
 
-    if(!(SDL_GetTicks() < fading_start+FADE_DURATION) && s->winner == WINNER_NONE) {
+    if(s->winner == WINNER_NONE) {
         for (p=1; p<=MAXPLAYERS; p++) {
             if( PLAYER(s, p).type == PLAYER_TYPE_HUMAN) {
                 input_human(s, p);
@@ -642,7 +642,7 @@ float get_move_y( GameState* s, unsigned char player) {
     } else {
         x_len = s->ball.x - GAME_X_MIN;
     }
-    y_len = dest - by + MOVE_Y_SEED-rand()%MOVE_Y_SEED*2;
+    y_len = dest - by;
 
     /* return the should-be value for move_y */
     return (y_len*move_x)/(x_len);
diff --git a/game.h b/game.h
index f18b764..8ab43b9 100644 (file)
--- a/game.h
+++ b/game.h
@@ -270,8 +270,6 @@ typedef struct {
 #define POWER_DOWN_FACTOR 0.9
 #define PLAYER_POWER_MAX 100
 
-#define MOVE_Y_SEED 3
-
 #define PLAYER(s, num) (s->players[num-1])
 
 /* Comment out the following #define to enable mouse control */