From 4521cdf1bb5725c9d497e5fb0c03943ad03a052f Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sun, 5 Oct 2014 23:10:18 +0200 Subject: Adding multiple moving points to catch --- src/EnemyState.elm | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 src/EnemyState.elm (limited to 'src/EnemyState.elm') 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 -- cgit v1.2.3