aboutsummaryrefslogtreecommitdiff
path: root/src/Update
diff options
context:
space:
mode:
Diffstat (limited to 'src/Update')
-rw-r--r--src/Update/CloudUpdate.elm18
-rw-r--r--src/Update/Update.elm30
2 files changed, 25 insertions, 23 deletions
diff --git a/src/Update/CloudUpdate.elm b/src/Update/CloudUpdate.elm
index 1988b7f..ecbce8b 100644
--- a/src/Update/CloudUpdate.elm
+++ b/src/Update/CloudUpdate.elm
@@ -3,17 +3,17 @@ module Update.CloudUpdate
) where
import List
-import Random (..)
+import Random exposing (..)
-import Model.Vec2 (..)
-import Model.Player (..)
-import Model.Board (boardDiagonal)
-import Model.Point (..)
-import Model.Cloud (..)
-import Model.Config (..)
+import Model.Vec2 exposing (..)
+import Model.Player exposing (..)
+import Model.Board exposing (boardDiagonal)
+import Model.Point exposing (..)
+import Model.Cloud exposing (..)
+import Model.Config exposing (..)
-import Utils.Geometry (..)
-import Utils.Physics (getMove, getWaveMove)
+import Utils.Geometry exposing (..)
+import Utils.Physics exposing (getMove, getWaveMove)
cloudUpdate : Float -> Vec2 -> Seed -> Player -> Cloud -> (Cloud, Int, Seed)
cloudUpdate time boardSize seed player {points, spawn, lastSpawn} =
diff --git a/src/Update/Update.elm b/src/Update/Update.elm
index 2be00b0..97cf6e3 100644
--- a/src/Update/Update.elm
+++ b/src/Update/Update.elm
@@ -3,23 +3,25 @@ module Update.Update
) where
import List
-import Keyboard (KeyCode)
-import Char (fromCode, toCode)
+import Keyboard exposing (KeyCode)
+import Char exposing (fromCode, toCode)
import Maybe
+import Set
+import Set exposing (Set)
-import Model.Player (..)
-import Model.Vec2 (..)
-import Model.Config (otherConfig)
-import Model.Cloud (..)
-import Model.Game (..)
-import Model.Round (Round)
+import Model.Player exposing (..)
+import Model.Vec2 exposing (..)
+import Model.Config exposing (otherConfig)
+import Model.Cloud exposing (..)
+import Model.Game exposing (..)
+import Model.Round exposing (Round)
-import Utils.Geometry (..)
-import Utils.Physics (getNewPosAndSpeed)
+import Utils.Geometry exposing (..)
+import Utils.Physics exposing (getNewPosAndSpeed)
-import Update.CloudUpdate (cloudUpdate)
+import Update.CloudUpdate exposing (cloudUpdate)
-import Input (Input)
+import Input exposing (Input)
update : Input -> Game -> Game
update input game =
@@ -54,7 +56,7 @@ playerStep dt boardSize dir newKey player =
, config = newConfig
}
-newKeyCode : List KeyCode -> List KeyCode -> KeyCode -> Bool
+newKeyCode : Set KeyCode -> Set KeyCode -> KeyCode -> Bool
newKeyCode lastKeyCodes newKeyCodes keyCode =
- let contains = not << List.isEmpty << List.filter (\kc -> kc == keyCode)
+ let contains = not << List.isEmpty << List.filter (\kc -> kc == keyCode) << Set.toList
in not (contains lastKeyCodes) && (contains newKeyCodes)