aboutsummaryrefslogtreecommitdiff
path: root/src/Input.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2014-10-03 16:18:24 +0200
committerJoris Guyonvarch2014-10-03 16:18:24 +0200
commita1a3dbadffaaab290a6b6bb4b61df787d3b8ffdd (patch)
tree039b6b171d9dbdc2c10101a3a5664125a4eddcbf /src/Input.elm
parentb3975b15a16fb22739f2d633caaeed0cb1c39ab7 (diff)
Adding a target to catch
Diffstat (limited to 'src/Input.elm')
-rw-r--r--src/Input.elm6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Input.elm b/src/Input.elm
index d8614b0..69e7503 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 (\_ -> 3) dtSignal)
+ randomFloatsSignal = Random.floatList (lift (\_ -> 5) dtSignal)
randomValuesSignal = lift floatsToRandomValues randomFloatsSignal
in sampleOn dtSignal <| Input <~ dirSignal
~ dtSignal
@@ -32,8 +32,10 @@ recordIntToVec2 {x, y} =
}
floatsToRandomValues : [Float] -> RandomValues
-floatsToRandomValues [enemyAngle, enemyX, enemyY] =
+floatsToRandomValues [enemyAngle, enemyX, enemyY, targetX, targetY] =
{ enemyAngle = enemyAngle
, enemyX = enemyX
, enemyY = enemyY
+ , targetX = targetX
+ , targetY = targetY
}