Skip to content
Permalink
Browse files

Only increment the score and pause once per win

  • Loading branch information...
magopian committed Aug 7, 2019
1 parent 194042e commit c9cc341ce66ff28c0922a9a2c04ad70569fa939b
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/Main.elm
@@ -177,11 +177,8 @@ update msg model =
updatePaddle model.leftPaddleMovement model.leftPaddle

( gameStatus, score, cmd ) =
case maybeWinner updatedBall of
Nothing ->
( NoWinner, model.score, Cmd.none )

Just player ->
case ( maybeWinner updatedBall, model.gameStatus ) of
( Just player, NoWinner ) ->
let
alwaysSleepDone : a -> Msg
alwaysSleepDone =
@@ -195,6 +192,9 @@ update msg model =
updateScores model.score player
in
( Winner player, updatedScore, delayCmd )

_ ->
( model.gameStatus, model.score, Cmd.none )
in
( { model
| ball = updatedBall

0 comments on commit c9cc341

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