summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosias <justjosias@tutanota.com>2020-01-22 17:58:39 +0000
committerJosias <justjosias@tutanota.com>2020-01-22 17:58:39 +0000
commitb6bfde2eb985d0f5e79cec3f709e1420e8c48f3f (patch)
tree7db8e32fb9a67bd2b0c0f69d1af0184371e73728
parent3f4f419c0799a64aeb411ce0ed7c0471d119bfcc (diff)
Fix flickering
-rw-r--r--blockbreak.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/blockbreak.c b/blockbreak.c
index 58a053e..b397041 100644
--- a/blockbreak.c
+++ b/blockbreak.c
@@ -1,6 +1,6 @@
/*
* blockbreak - a simple ncurses game where you break blocks with a ball
- *
+ *
*/
#include <ncurses.h>
#include <stdlib.h>
@@ -129,7 +129,7 @@ int main()
}
}
- clear();
+ erase();
decorations(max_x, max_y);
refresh_score(lives, blocks_left, max_y - 1);
print_paddle(PADDLE_SIZE, max_y - 2, paddle_x);
@@ -145,7 +145,7 @@ int main()
ball_next_y = ball_y + ball_direction_y;
/* Check if the ball is going to hit the paddle */
- if (ball_next_x > paddle_x - PADDLE_SIZE
+ if (ball_next_x > paddle_x - PADDLE_SIZE
&& ball_next_x < paddle_x + 1
&& ball_next_y >= max_y - 2) {
ball_direction_y *= -1;