diff --git a/assets/arctic.png b/assets/gfx/arctic.png similarity index 100% rename from assets/arctic.png rename to assets/gfx/arctic.png diff --git a/assets/enemy.png b/assets/gfx/enemy.png similarity index 100% rename from assets/enemy.png rename to assets/gfx/enemy.png diff --git a/assets/tux.png b/assets/gfx/tux.png similarity index 100% rename from assets/tux.png rename to assets/gfx/tux.png diff --git a/assets/sfx/hit.wav b/assets/sfx/hit.wav new file mode 100644 index 0000000..0b6acfd Binary files /dev/null and b/assets/sfx/hit.wav differ diff --git a/src/Main.c b/src/Main.c index 9fc6049..b97fff1 100644 --- a/src/Main.c +++ b/src/Main.c @@ -5,10 +5,10 @@ #include "Debug.h" #include "Copying.h" -// Functions +/* Functions */ -// Globles +/* Globles */ // Position Varaibles float EnemyPos_x = 482.0f, EnemyPos_y = 62.0f; @@ -26,16 +26,19 @@ void Setup() InitWindow(screenWidth, screenHeight, "Tux Vs Windows"); + InitAudioDevice(); + SetTargetFPS(60); } // GameLoop Code void MainGameLoop() { - // Load Textures - Texture2D tux = LoadTexture("assets/tux.png"); - Texture2D enemy = LoadTexture("assets/enemy.png"); - Texture2D arctic = LoadTexture("assets/arctic.png"); + // Load Assets + Texture2D tux = LoadTexture("assets/gfx/tux.png"); + Texture2D enemy = LoadTexture("assets/gfx/enemy.png"); + Texture2D arctic = LoadTexture("assets/gfx/arctic.png"); + Sound sfxHit = LoadSound("assets/sfx/hit.wav"); // Hitboxes Rectangle EnemyHitbox = { GetScreenWidth()/2.0f - 30, GetScreenHeight()/2.0f - 30, 290, 300}; @@ -77,6 +80,7 @@ void MainGameLoop() if (collision) { DrawText("FINALY BASIC AWFUL COLLISION", 50, 18, 20, MAROON); + PlaySound(sfxHit); } else { DrawText("Tux Vs X ENGINE PROTOTYPE please read the LINCENSE", 50, 18, 20, BLACK); } @@ -86,17 +90,21 @@ void MainGameLoop() EndDrawing(); } - // Unload Textures + // Unload Assets UnloadTexture(tux); UnloadTexture(enemy); UnloadTexture(arctic); + UnloadSound(sfxHit); } int main() { Setup(); MainGameLoop(); + + CloseAudioDevice(); CloseWindow(); + License(); return 0;