diff options
author | Joris Guyonvarch | 2014-10-05 23:10:18 +0200 |
---|---|---|
committer | Joris Guyonvarch | 2014-10-05 23:10:32 +0200 |
commit | 4521cdf1bb5725c9d497e5fb0c03943ad03a052f (patch) | |
tree | 8b7247e9b1b2c950c7bec39548bfe860965c5126 /src/EnemyState.elm | |
parent | c2583cf7ff8684d1194c61ab132e23d7ccebcd51 (diff) |
Adding multiple moving points to catch
Diffstat (limited to 'src/EnemyState.elm')
-rw-r--r-- | src/EnemyState.elm | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/EnemyState.elm b/src/EnemyState.elm deleted file mode 100644 index fed2981..0000000 --- a/src/EnemyState.elm +++ /dev/null @@ -1,29 +0,0 @@ -module EnemyState where - -import Enemy (..) -import Player (..) -import Geometry (distance) - -type EnemyState = - { enemies : [Enemy] - , spawn : Float - , lastSpawn : Float - } - -initEnemyState : EnemyState -initEnemyState = - let spawn = 200 - in { enemies = [] - , spawn = spawn - , lastSpawn = -spawn - } - -playerEnemiesCollision : Float -> Player -> [Enemy] -> Bool -playerEnemiesCollision time player enemies = - let collision = playerEnemyCollision time player - in length (filter collision enemies) > 0 - -playerEnemyCollision : Float -> Player -> Enemy -> Bool -playerEnemyCollision time player enemy = - let enemyPos = enemyMove enemy time - in (distance enemyPos player.pos) < enemySize + playerSize |