Skip to content

Commit

Permalink
Play song when score reaches 19
Browse files Browse the repository at this point in the history
  • Loading branch information
TheodoreEhrenborg committed Jun 15, 2024
1 parent d58ac26 commit 417ee46
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ initActiveModel =
, koala = Position (gridSize.width * cellSize.width // 2) (gridSize.height * cellSize.height - 50) 0
, time = Nothing
}
, playFromElm "assets/happy_birthday.m4a"
, Cmd.none
, Audio.cmdNone
)

Expand Down Expand Up @@ -209,7 +209,7 @@ update _ msg model =
generateLeaf

else
Cmd.none
if nextScore == year && act_model.score /= year then playFromElm "assets/happy_birthday.m4a" else Cmd.none
, Audio.cmdNone
)

Expand Down Expand Up @@ -312,14 +312,14 @@ view _ model =
else
[]
)
++ (if act_model.score >= 19 then
++ (if act_model.score >= year then
[ text_ [ x "300", y "200", Svg.Attributes.style "fill: white" ] [ text "Happy birthday!" ] ]

else
[]
)
)

year = 19

renderLeaf : Position -> Html Msg
renderLeaf pos =
Expand Down

0 comments on commit 417ee46

Please sign in to comment.