From 955f6ae56cdd3b20eabb44e7c9b931bdb17c2b3e Mon Sep 17 00:00:00 2001 From: quou Date: Sun, 7 May 2023 17:09:58 +1000 Subject: Basic music and sound. --- game.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'game.c') diff --git a/game.c b/game.c index 064fc22..bb96e43 100644 --- a/game.c +++ b/game.c @@ -3,6 +3,7 @@ #include "game.h" #include "input.h" #include "platform.h" +#include "sound.h" #include "sprite.h" #include "standard.h" #include "systems.h" @@ -18,6 +19,8 @@ void gameplay_new(Game* game) { init_player(&world->player, world); init_waver(&world->waver); world->gmemory = gmemory_max; + + set_song(song_main); } void gameplay_next_wave(Game* game) { @@ -68,6 +71,8 @@ static void menu_init(Game* game) { font = get_default_font(); + set_song(song_menu); + init_menu(&game->menu, game); menu_add(&game->menu, "Play", menu_start, font); menu_add(&game->menu, "Credits", menu_credits, font); @@ -266,7 +271,6 @@ static void credits_init(Game* game) { } static void credits_update(Game* game) { - Colour colour; const BM_Font* font; font = get_default_font(); @@ -282,7 +286,7 @@ static void credits_update(Game* game) { rfont_text(font, 0, 10, "Design: quou"); rfont_text(font, 0, 20, "Sound: quou"); rfont_text(font, 0, 30, "Graphics: quou"); - rfont_text(font, 0, 40, "Music: drummyfish"); + rfont_text(font, 0, 20, "Music: tejeez"); rfont_text(font, 0, 50, "Source Code: git.quou.xyz"); } @@ -293,6 +297,8 @@ static void dead_init(Game* game) { const BM_Font* font; Menu* menu; + set_song(song_dead); + menu = &game->menu; font = get_default_font(); init_menu(menu, game); @@ -324,11 +330,12 @@ static void dead_update(Game* game) { "Out of Memory" ); } else if (world->oom == -1) { - rfont_text( + rfont_text_col( font, renderer_w / 2 - 35, game->menu.y - 15, - "You win" + "YOU WIN", + make_colour(0xc00000, 255) ); } else { rfont_text( -- cgit v1.2.3-54-g00ecf