From 99c7181c3166831e0de1badfe910a03f4856d46e Mon Sep 17 00:00:00 2001 From: Thomas Perl Date: Sun, 10 Jun 2007 23:09:08 +0200 Subject: [PATCH] Bugfix for ball not moving completely off-screen This fix makes the game only stop when the ball is completely off-screen, so it doesn't look like the ball was stopped at the edge of the screen. --- game.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game.h b/game.h index 884fa8a..d320bec 100644 --- a/game.h +++ b/game.h @@ -89,8 +89,8 @@ typedef struct { #define PLAYER_Y_MIN 0.0 #define PLAYER_Y_MAX 1.0*HEIGHT -#define IS_OFFSCREEN_Y(y) (((y)<0) || ((y)>HEIGHT)) -#define IS_OFFSCREEN_X(x) (((x)<0) || ((x)>WIDTH)) +#define IS_OFFSCREEN_Y(y) (((y)<0-BALL_Y_MID*2) || ((y)>HEIGHT+BALL_Y_MID*2)) +#define IS_OFFSCREEN_X(x) (((x)<0-BALL_X_MID*2) || ((x)>WIDTH+BALL_X_MID*2)) #define IS_OFFSCREEN(x,y) ((IS_OFFSCREEN_X(x)) || (IS_OFFSCREEN_Y(y))) #define IS_OUT_Y(y) (yGAME_Y_MAX) #define IS_OUT_X(x) (xGAME_X_MAX) -- 2.11.4.GIT