about summary refs log tree commit diff stats
path: root/src/main.c
diff options
context:
space:
mode:
authorCharadon <dev@iotib.net>2022-06-01 17:34:51 -0400
committerCharadon <dev@iotib.net>2022-06-01 17:34:51 -0400
commit01a21af4c041c6f3133b4202ca35c156ffb00f32 (patch)
tree7a118b37c09e744325cf3740a62e2857ae839ea0 /src/main.c
parent081187244a0f69a0043d15dd7ad2cf5f127c60be (diff)
downloadPong-C-01a21af4c041c6f3133b4202ca35c156ffb00f32.tar.gz
Migrate to meson
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 89422ba..9339b92 100644
--- a/src/main.c
+++ b/src/main.c
@@ -1,5 +1,6 @@
 #include "pong.h"
 #include "sounds.h"
+#include <raylib.h>
 #include <setjmp.h>
 
 
@@ -67,7 +68,7 @@ int audio() {
 }
 
 bool play_audio(int SoundEffect) {
-	int i;
+	unsigned int i;
 	while(mtx_trylock(&AudioQueueBeingModified) == thrd_busy);
 	for(i = 1; i != 20; i++) {
 		if (AudioQueue[i-1] == -1) {
@@ -94,6 +95,7 @@ int main() {
 	SetWindowIcon(Icon);
 	SetWindowState(FLAG_VSYNC_HINT);
 	SetWindowState(FLAG_WINDOW_RESIZABLE);
+	SetWindowMinSize(1280, 720);
 	
 	//Initialize Variables
 	Camera2D MainCamera;
@@ -101,7 +103,7 @@ int main() {
 	MainCamera.offset = (Vector2){0, 0};
 	MainCamera.rotation = 0;
 	//Populate Audio Queue
-	for(int i = 0; i < sizeof(AudioQueue); i++) {
+	for(unsigned int i = 0; i < sizeof(AudioQueue); i++) {
 		AudioQueue[i] = -1;
 	}
 	mtx_init(&AudioQueueBeingModified, mtx_plain);
@@ -153,6 +155,9 @@ int main() {
 	
 	while(!WindowShouldClose() && GameGoing == true) {
 		MainCamera.zoom = GetScreenHeight()/720.0f;
+		MainCamera.offset = (Vector2){GetScreenWidth()/2.0f, GetScreenHeight()/2.0f};
+		MainCamera.target = (Vector2){1280/2.0f, 720/2.0f};
+
 		if (Enemy.Score >= 5) {
 			play_audio(MUSIC_DEFEAT);
 			longjmp(RestartGame, 0);