From 9e4797d2fe599acfbf13ed626df46650a88ef891 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Tue, 20 Feb 2024 18:33:42 -0500 Subject: Changed loading of the sprite --- pong.h | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'pong.h') diff --git a/pong.h b/pong.h index 8520db3..3bdc715 100644 --- a/pong.h +++ b/pong.h @@ -3,15 +3,20 @@ #include -typedef struct point_t { +constexpr int PADDLE_WIDTH = 16; +constexpr int PADDLE_HEIGHT = 128; +constexpr int BALL_WIDTH = 16; +constexpr int BALL_HEIGHT = 16; + +typedef struct vector_t { int32_t x; int32_t y; -} point_t; +} vector_t; /* paddles have a fixed x position and velocity */ struct moveable_t { - point_t position; - point_t velocity; + vector_t position; + vector_t velocity; uint8_t width; uint8_t height; }; @@ -19,7 +24,7 @@ struct moveable_t { typedef struct moveable_t ball_t; typedef struct moveable_t paddle_t; -void UpdatePosition ( point_t * const position, const point_t velocity ); +void UpdatePosition ( vector_t * const position, const vector_t velocity ); bool CheckMoveableCollision ( const struct moveable_t m1, const struct moveable_t m2 ); bool CheckLeftWallCollision ( const struct moveable_t m ); bool CheckRightWallCollision ( const struct moveable_t m ); -- cgit v1.2.3