blob: 2c80f0a3d1ffce61dd2c7c83716fdcdde0f11afb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
module Enemy where
import Vec2 (..)
import Board (boardDiagonal)
type Enemy =
{ initTime : Float
, initPos : Vec2
, initDest : Vec2
, move : Float -> Vec2 -> Vec2 -> Float -> Vec2
}
enemyMove : Enemy -> Float -> Vec2
enemyMove enemy time =
enemy.move enemy.initTime enemy.initPos enemy.initDest time
enemySize : Float
enemySize = 8
enemySpeed : Float -> Float
enemySpeed dt = dt / 25
enemySpawnDist : Float
enemySpawnDist = boardDiagonal * 3 / 5
enemyAwayDist : Float
enemyAwayDist = boardDiagonal
|