From ad22993557296b02bc0c947cb3bb6247fac8f47f Mon Sep 17 00:00:00 2001 From: banana Date: Fri, 22 Mar 2024 13:46:36 -0700 Subject: Initial commit --- constants.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 constants.h (limited to 'constants.h') diff --git a/constants.h b/constants.h new file mode 100644 index 0000000..4e44ec2 --- /dev/null +++ b/constants.h @@ -0,0 +1,40 @@ +#define GAME_TITLE "pong" + +#define FALSE 0 +#define TRUE 1 + +#define WINDOW_WIDTH 800 +#define WINDOW_HEIGHT 600 + +#define FPS 30 + +#define FRAME_TARGET_TIME (1000 / FPS) + +#define INPUT_RESET 0b10000000 +#define PADDLE_1_UP 0b00001000 +#define PADDLE_1_DOWN 0b00000100 +#define PADDLE_2_UP 0b00000010 +#define PADDLE_2_DOWN 0b00000001 + +#define CENTER_LINE_WIDTH WINDOW_WIDTH / 100 +#define CENTER_LINE_HEIGHT WINDOW_HEIGHT / 8 + +#define SCORE_TALLY_WIDTH WINDOW_WIDTH / 100 +#define SCORE_TALLY_HEIGHT WINDOW_HEIGHT / 16 +#define PLAYER1_SCORE_TALLY_X WINDOW_WIDTH * 0.25 - CENTER_LINE_WIDTH / 2 +#define PLAYER2_SCORE_TALLY_X WINDOW_WIDTH * 0.75 - CENTER_LINE_WIDTH / 2 +#define SCORE_TALLY_Y SCORE_TALLY_HEIGHT + +#define BALL_RADIUS WINDOW_WIDTH / 50 +#define BALL_INIT_X WINDOW_WIDTH / 2 - BALL_RADIUS / 2 +#define BALL_INIT_Y WINDOW_HEIGHT / 2 - BALL_RADIUS / 2 +#define BALL_INIT_SPEED 300 + +#define PADDLE_WIDTH WINDOW_WIDTH / 50 +#define PADDLE_HEIGHT WINDOW_HEIGHT / 4 +#define PADDLE1_X PADDLE_WIDTH * 2 +#define PADDLE2_X WINDOW_WIDTH - PADDLE_WIDTH * 3 +#define PADDLE_Y WINDOW_HEIGHT / 2 - PADDLE_HEIGHT / 2 +#define PADDLE_SPEED WINDOW_HEIGHT / 2 + +#define MAX_SND_CHANNELS 1 -- cgit v1.2.3