summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-05-30 22:18:05 -0400
committerCharadon <dev@iotib.net>2022-05-30 22:18:05 -0400
commitca6e7eb99e864ff662b2e14e6f9679e293ec17d8 (patch)
treef455ab47c3af47b7d3e3bc1971eace9e5299b4c8
parentd50c22c29464f0e1f69d00627984295278b3a634 (diff)
downloadPong-C-ca6e7eb99e864ff662b2e14e6f9679e293ec17d8.tar.gz
Fix potential undefined behavior
-rw-r--r--Makefile5
-rw-r--r--src/main.c4
2 files changed, 4 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index f9e7343..8f8e59f 100644
--- a/Makefile
+++ b/Makefile
@@ -28,6 +28,7 @@ install_flatpak:
 clean:
 	rm -fv *.o
 	rm -fv pong
-	rm -rf .flatpak-builder
-	rm -rf flatpak
+	rm -rf .flatpak-builder/
+	rm -rf flatpak/
+	rm -rf *.flatpak
 	cd raylib/src && $(MAKE) clean
diff --git a/src/main.c b/src/main.c
index 280b16c..89422ba 100644
--- a/src/main.c
+++ b/src/main.c
@@ -108,6 +108,7 @@ int main() {
 
 	// Init Player Variables
 	struct Players Player;
+	Player.Y = 0;
 	Player.Score = 0;
 	char PlayerScore[50]; // Used later to display score on screen.
 
@@ -136,9 +137,6 @@ int main() {
 	Ball.HitBox = (Rectangle){Ball.X, Ball.Y, BallSprite.width, BallSprite.height};
 	Enemy.BallDetector = (Rectangle){0, Enemy.Y+120, 1280, PaddleSprite.height/5.0f};
 
-	// Debug
-	Player.Y = 200;
-
 	// Initialize Internal Clock
 	thrd_t InternalClock;
 	thrd_create(&InternalClock, internal_clock, NULL);
'#n163'>163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214