Merge branch 'master' of ssh.marcbarbier.fr:Marc/gamejam-polytech
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
+30
-1
@@ -16,6 +16,9 @@
|
|||||||
#define GRAVITY 10000.f
|
#define GRAVITY 10000.f
|
||||||
|
|
||||||
static Mix_Music * music;
|
static Mix_Music * music;
|
||||||
|
static Mix_Chunk * petMusic;
|
||||||
|
static Mix_Chunk * koMusic;
|
||||||
|
|
||||||
|
|
||||||
Scene_t gameScene;
|
Scene_t gameScene;
|
||||||
|
|
||||||
@@ -68,7 +71,7 @@ static RenderId_t strengthBarSliderId;
|
|||||||
static bool increaseStrengthBarSlider = true;
|
static bool increaseStrengthBarSlider = true;
|
||||||
|
|
||||||
#define STEROIDS_POSITION CAMERA_WIDTH * 0.4f
|
#define STEROIDS_POSITION CAMERA_WIDTH * 0.4f
|
||||||
#define SLIDER_SPEED (1.f/5000 / (adameStrength *0.5f))
|
#define SLIDER_SPEED ((adameStrength *0.5f)/5000)
|
||||||
|
|
||||||
void game_handleFKeyInput(void);
|
void game_handleFKeyInput(void);
|
||||||
|
|
||||||
@@ -87,6 +90,18 @@ static void playMusic(){
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
petMusic = Mix_LoadWAV("./assets/music/pet.mp3");
|
||||||
|
if(petMusic == NULL){
|
||||||
|
fprintf(stderr, "Pet audio not found!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
koMusic = Mix_LoadWAV("./assets/music/ko-effect-gain.mp3");
|
||||||
|
if(koMusic == NULL){
|
||||||
|
fprintf(stderr, "ko effect audio not found!\n");
|
||||||
|
exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
if(Mix_PlayMusic(music, 0) != 0){
|
if(Mix_PlayMusic(music, 0) != 0){
|
||||||
printf("Music sound could not be played!\n"
|
printf("Music sound could not be played!\n"
|
||||||
"SDL_Error: %s\n", Mix_GetError());
|
"SDL_Error: %s\n", Mix_GetError());
|
||||||
@@ -312,6 +327,20 @@ int game_render(float delta){
|
|||||||
scene_moveRenderObject(&gameScene, adame[0], ADAME_X, ADAME_Y);
|
scene_moveRenderObject(&gameScene, adame[0], ADAME_X, ADAME_Y);
|
||||||
adame_id = 0;
|
adame_id = 0;
|
||||||
kicked = true;
|
kicked = true;
|
||||||
|
if(strength > 1.5){
|
||||||
|
if(Mix_PlayChannel(-1, koMusic, 0) != 0){
|
||||||
|
printf("Music sound could not be played!\n"
|
||||||
|
"SDL_Error: %s\n", Mix_GetError());
|
||||||
|
Mix_FreeChunk(koMusic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(Mix_PlayChannel(-1, petMusic, 0) != 0){
|
||||||
|
printf("Music sound could not be played!\n"
|
||||||
|
"SDL_Error: %s\n", Mix_GetError());
|
||||||
|
Mix_FreeChunk(petMusic);
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
adame_id++;
|
adame_id++;
|
||||||
scene_moveRenderObject(&gameScene, adame[adame_id], ADAME_X, ADAME_Y);
|
scene_moveRenderObject(&gameScene, adame[adame_id], ADAME_X, ADAME_Y);
|
||||||
|
|||||||
Reference in New Issue
Block a user