have enemy physics working and applied to enemy
This commit is contained in:
@@ -28,15 +28,20 @@ struct
|
||||
(* filter out if decrementing health by one = 0 *)
|
||||
acc
|
||||
else
|
||||
{ health = health - 1
|
||||
, x = x
|
||||
, y = y
|
||||
, id = id
|
||||
, xAxis = xAxis
|
||||
, yAxis = yAxis
|
||||
} :: acc
|
||||
let
|
||||
val patches = EnemyPhysics.getPatches enemy
|
||||
val patches = EnemyPatch.W_HEALTH (health - 1) :: patches
|
||||
val enemy = EnemyPatch.withPatches (enemy, patches)
|
||||
in
|
||||
enemy :: acc
|
||||
end
|
||||
else
|
||||
enemy :: acc
|
||||
let
|
||||
val patches = EnemyPhysics.getPatches enemy
|
||||
val enemy = EnemyPatch.withPatches (enemy, patches)
|
||||
in
|
||||
enemy :: acc
|
||||
end
|
||||
end
|
||||
|
||||
(* filter enemy projectiles when player is not attacking *)
|
||||
|
||||
@@ -157,7 +157,7 @@ struct
|
||||
, y = 945
|
||||
, health = 5
|
||||
, xAxis = STAY_STILL
|
||||
, yAxis = ON_GROUND
|
||||
, yAxis = FALLING
|
||||
}
|
||||
val enemy2 =
|
||||
{ id = 2
|
||||
@@ -165,7 +165,7 @@ struct
|
||||
, y = 945
|
||||
, health = 5
|
||||
, xAxis = STAY_STILL
|
||||
, yAxis = ON_GROUND
|
||||
, yAxis = FALLING
|
||||
}
|
||||
val enemy3 =
|
||||
{ id = 3
|
||||
@@ -173,7 +173,7 @@ struct
|
||||
, y = 945
|
||||
, health = 5
|
||||
, xAxis = STAY_STILL
|
||||
, yAxis = ON_GROUND
|
||||
, yAxis = FALLING
|
||||
}
|
||||
val enemies = Vector.fromList [enemy1, enemy2, enemy3]
|
||||
in
|
||||
|
||||
Reference in New Issue
Block a user