Skip to content

Commit

Permalink
Add music
Browse files Browse the repository at this point in the history
  • Loading branch information
wreckingballgames committed Dec 29, 2024
1 parent 8632681 commit 8060e21
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions main.odin
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ main :: proc() {
rl.InitWindow(WINDOW_WIDTH, WINDOW_HEIGHT, WINDOW_TITLE)
defer rl.CloseWindow()

rl.InitAudioDevice()
defer rl.CloseAudioDevice()

font := rl.LoadFont("PixAntiqua.ttf")

left_banner_image := rl.LoadTexture("images/left_banner.png")
Expand All @@ -101,6 +104,10 @@ main :: proc() {
owl_image := rl.LoadTexture("images/owl.png")
skinwalker_image := rl.LoadTexture("images/skinwalker.png")

music := rl.LoadMusicStream("universfield_quiet_moments.mp3")
defer rl.UnloadMusicStream(music)
rl.PlayMusicStream(music)

text_area_rect := rl.Rectangle {0, 420, 1280, 300,}
text_box_rect := rl.Rectangle {32, 430, 1216, 150,}
choice_box_rect := rl.Rectangle {32, 585, 1216, 130,}
Expand Down Expand Up @@ -319,6 +326,8 @@ main :: proc() {
mouse_position: rl.Vector2

for !rl.WindowShouldClose() {
rl.UpdateMusicStream(music);

mouse_position = rl.GetMousePosition()

choice1_selected: bool
Expand Down Expand Up @@ -389,6 +398,9 @@ main :: proc() {
rl.DrawTextEx(font, current_screen.choices[2].text, {choice_rect3.x, choice_rect3.y}, TEXT_SIZE, 0, CHOICE_TEXT_COLOR)
}
}

// Music credit https://freemusicarchive.org/music/universfield/ambient-music/quiet-moments/
rl.DrawTextEx(font, "Music is Quiet Moments by Universfield", {0, WINDOW_HEIGHT - 10}, 10, 0, rl.WHITE)
}
}

Expand Down Expand Up @@ -429,8 +441,6 @@ generate_ending :: proc() {
}),
}
}
} else {
fmt.println("it's fucked")
}
}

Expand Down
Binary file added universfield_quiet_moments.mp3
Binary file not shown.

0 comments on commit 8060e21

Please sign in to comment.