diff options
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 |