aboutsummaryrefslogtreecommitdiff
path: root/src/Input.elm
diff options
context:
space:
mode:
Diffstat (limited to 'src/Input.elm')
-rw-r--r--src/Input.elm23
1 files changed, 15 insertions, 8 deletions
diff --git a/src/Input.elm b/src/Input.elm
index 69e7503..1015302 100644
--- a/src/Input.elm
+++ b/src/Input.elm
@@ -16,7 +16,7 @@ getInput : Signal Input
getInput =
let dtSignal = delta
dirSignal = lift recordIntToVec2 Keyboard.arrows
- randomFloatsSignal = Random.floatList (lift (\_ -> 5) dtSignal)
+ randomFloatsSignal = Random.floatList (lift (\_ -> 6) dtSignal)
randomValuesSignal = lift floatsToRandomValues randomFloatsSignal
in sampleOn dtSignal <| Input <~ dirSignal
~ dtSignal
@@ -32,10 +32,17 @@ recordIntToVec2 {x, y} =
}
floatsToRandomValues : [Float] -> RandomValues
-floatsToRandomValues [enemyAngle, enemyX, enemyY, targetX, targetY] =
- { enemyAngle = enemyAngle
- , enemyX = enemyX
- , enemyY = enemyY
- , targetX = targetX
- , targetY = targetY
- }
+floatsToRandomValues [angle1, x1, y1, angle2, x2, y2] =
+ let greenPoint =
+ { angle = angle1
+ , x = x1
+ , y = y1
+ }
+ redPoint =
+ { angle = angle2
+ , x = x2
+ , y = y2
+ }
+ in { greenPoint = greenPoint
+ , redPoint = redPoint
+ }