Compare commits

...

1 Commits

Author SHA1 Message Date
Return0ne 6987f4c2a5 added sound effects 2021-11-29 11:03:12 -05:00
5 changed files with 15 additions and 7 deletions

View File

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

View File

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
assets/sfx/hit.wav Normal file

Binary file not shown.

View File

@ -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;