Skip to content

Commit

Permalink
Rename SleepDone to RestartGame
Browse files Browse the repository at this point in the history
  • Loading branch information
magopian committed Aug 7, 2019
1 parent abbaf2d commit b88ffa2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ type Msg
= OnAnimationFrame Float
| KeyDown PlayerAction
| KeyUp PlayerAction
| SleepDone
| RestartGame
| NewWinner Player


Expand Down Expand Up @@ -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 ->
Expand Down Expand Up @@ -209,7 +209,7 @@ update msg model =
, Cmd.none
)

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

0 comments on commit b88ffa2

Please sign in to comment.