aboutsummaryrefslogtreecommitdiff
path: root/game.c
diff options
context:
space:
mode:
authorquou <quou@disroot.org>2023-05-07 17:09:58 +1000
committerquou <quou@disroot.org>2023-05-07 17:09:58 +1000
commit955f6ae56cdd3b20eabb44e7c9b931bdb17c2b3e (patch)
tree62f5dc92a675a5fdc48a0474d11d229cb5f2780d /game.c
parent1867e71ac2870f904e0856fd3b093abed6e8a58b (diff)
Basic music and sound.
Diffstat (limited to 'game.c')
-rw-r--r--game.c15
1 files changed, 11 insertions, 4 deletions
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(