Skip to content
Permalink
Browse files

Rename SleepDone to RestartGame

  • Loading branch information...
magopian committed Aug 7, 2019
1 parent abbaf2d commit b88ffa27688628881cc89a96a5034deb7224d6f8
Showing with 6 additions and 6 deletions.
  1. +6 −6 src/Main.elm
@@ -62,7 +62,7 @@ type Msg
= OnAnimationFrame Float
| KeyDown PlayerAction
| KeyUp PlayerAction
| SleepDone
| RestartGame
| NewWinner Player


@@ -153,16 +153,16 @@ update msg model =

NewWinner player ->
let
alwaysSleepDone : a -> Msg
alwaysSleepDone =
always SleepDone
alwaysRestartGame : a -> Msg
alwaysRestartGame =
always RestartGame

updatedScore =
updateScores model.score player
in
( { model | gameStatus = Winner player, score = updatedScore }
, Process.sleep 500
|> Task.perform alwaysSleepDone
|> Task.perform alwaysRestartGame
)

KeyDown playerAction ->
@@ -209,7 +209,7 @@ update msg model =
, Cmd.none
)

SleepDone ->
RestartGame ->
( { model
| ball = initBall
, gameStatus = NoWinner

0 comments on commit b88ffa2

Please sign in to comment.
You can’t perform that action at this time.