Skip to content

Commit 671e4e4

Browse files
committed
cleanup
1 parent dd6b07a commit 671e4e4

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/Hexagon.elm

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ type alias Player =
1717
type Direction = Left | Right | Still
1818

1919
type alias Game =
20-
{
20+
{
2121
player : Player
2222
, direction : Direction
2323
, keyboardModel : Keyboard.Model
@@ -26,7 +26,7 @@ type alias Game =
2626
type Msg
2727
= Step Time
2828
| KeyboardExtraMsg Keyboard.Msg
29-
| Noop
29+
3030

3131
(gameWidth, gameHeight) = (1024, 576) -- 16:9
3232
(halfWidth, halfHeight) = (gameWidth/2, gameHeight/2)
@@ -41,7 +41,7 @@ playerRadius = gameWidth / 10.0
4141
updatePlayerAngle: Float -> Direction -> Float
4242
updatePlayerAngle angle dir =
4343
let
44-
sign =
44+
sign =
4545
if dir == Left then 1
4646
else if dir == Right then -1
4747
else 0
@@ -68,7 +68,7 @@ onUserInput keyMsg game =
6868
let
6969
( keyboardModel, keyboardCmd ) =
7070
Keyboard.update keyMsg game.keyboardModel
71-
direction =
71+
direction =
7272
if (Keyboard.arrows keyboardModel).x < 0 then Left
7373
else if (Keyboard.arrows keyboardModel).x > 0 then Right
7474
else Still
@@ -95,7 +95,6 @@ update msg game =
9595
case msg of
9696
KeyboardExtraMsg keyMsg -> onUserInput keyMsg game
9797
Step time -> onFrame time game
98-
_ -> (game, Cmd.none)
9998

10099

101100
-- VIEW
@@ -110,7 +109,7 @@ moveRadial angle radius =
110109

111110
makePlayer : Player -> Form
112111
makePlayer player =
113-
let
112+
let
114113
angle = player.angle - degrees 30
115114
in
116115
ngon 3 10
@@ -152,9 +151,7 @@ init =
152151
, keyboardModel = keyboardModel
153152
, direction = Still
154153
}
155-
, Cmd.batch
156-
[ Cmd.map KeyboardExtraMsg keyboardCmd
157-
]
154+
, Cmd.map KeyboardExtraMsg keyboardCmd
158155
)
159156

160157

0 commit comments

Comments
 (0)