flower seed

This commit is contained in:
cyjullien1
2025-01-07 19:20:22 +01:00
parent 2c39110885
commit 0c20e2ae20
13 changed files with 51 additions and 47 deletions

View File

@@ -10,6 +10,7 @@
#include <SDL2/SDL_image.h>
#include <SDL2/SDL_render.h>
#include <SDL2/SDL_mixer.h>
#include <time.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
@@ -17,6 +18,8 @@
#define SIZE_PLAY 20
#define SIZE_MENU 200
// Définir une seed globale
unsigned int seed;
/**
@@ -28,7 +31,6 @@
*/
void playAudio(int sfx)
{
// Charger un fichier son
Mix_Chunk* sfx_win = Mix_LoadWAV("sfx/win.wav");
Mix_Chunk* sfx_lose = Mix_LoadWAV("sfx/lose.wav");
@@ -36,7 +38,6 @@ void playAudio(int sfx)
Mix_Chunk* sfx_block_on_target = Mix_LoadWAV("sfx/blockontarget.wav");
Mix_Chunk* sfx_move = Mix_LoadWAV("sfx/move.mp3");
Mix_Chunk* sfx_move_block = Mix_LoadWAV("sfx/moveblock.wav");
switch (sfx)
{
case 0:
@@ -60,9 +61,17 @@ void playAudio(int sfx)
}
Mix_FreeChunk(sfx_win);
Mix_FreeChunk(sfx_lose);
Mix_FreeChunk(sfx_cant_move);
Mix_FreeChunk(sfx_block_on_target);
Mix_FreeChunk(sfx_move);
Mix_FreeChunk(sfx_move_block);
}
int main ()
{
seed = (unsigned int)time(NULL);
dis display_user;
display_user.size_menu = SIZE_MENU;
display_user.size_box = SIZE_PLAY;