diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 9 | ||||
-rw-r--r-- | src/pong.h | 2 | ||||
-rw-r--r-- | src/title.c | 2 |
3 files changed, 9 insertions, 4 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); diff --git a/src/pong.h b/src/pong.h index fff6065..70e9215 100644 --- a/src/pong.h +++ b/src/pong.h @@ -47,4 +47,4 @@ extern const int MUSIC_VICTORY; extern const int MUSIC_TITLE; extern const int STOP_ALL_SOUNDS; -#endif \ No newline at end of file +#endif diff --git a/src/title.c b/src/title.c index 806c0d0..1f2a51d 100644 --- a/src/title.c +++ b/src/title.c @@ -68,4 +68,4 @@ void title_screen() { EndDrawing(); } return; -} \ No newline at end of file +} |