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 *)
|
(* filter out if decrementing health by one = 0 *)
|
||||||
acc
|
acc
|
||||||
else
|
else
|
||||||
{ health = health - 1
|
let
|
||||||
, x = x
|
val patches = EnemyPhysics.getPatches enemy
|
||||||
, y = y
|
val patches = EnemyPatch.W_HEALTH (health - 1) :: patches
|
||||||
, id = id
|
val enemy = EnemyPatch.withPatches (enemy, patches)
|
||||||
, xAxis = xAxis
|
in
|
||||||
, yAxis = yAxis
|
enemy :: acc
|
||||||
} :: acc
|
end
|
||||||
else
|
else
|
||||||
enemy :: acc
|
let
|
||||||
|
val patches = EnemyPhysics.getPatches enemy
|
||||||
|
val enemy = EnemyPatch.withPatches (enemy, patches)
|
||||||
|
in
|
||||||
|
enemy :: acc
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
(* filter enemy projectiles when player is not attacking *)
|
(* filter enemy projectiles when player is not attacking *)
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ struct
|
|||||||
, y = 945
|
, y = 945
|
||||||
, health = 5
|
, health = 5
|
||||||
, xAxis = STAY_STILL
|
, xAxis = STAY_STILL
|
||||||
, yAxis = ON_GROUND
|
, yAxis = FALLING
|
||||||
}
|
}
|
||||||
val enemy2 =
|
val enemy2 =
|
||||||
{ id = 2
|
{ id = 2
|
||||||
@@ -165,7 +165,7 @@ struct
|
|||||||
, y = 945
|
, y = 945
|
||||||
, health = 5
|
, health = 5
|
||||||
, xAxis = STAY_STILL
|
, xAxis = STAY_STILL
|
||||||
, yAxis = ON_GROUND
|
, yAxis = FALLING
|
||||||
}
|
}
|
||||||
val enemy3 =
|
val enemy3 =
|
||||||
{ id = 3
|
{ id = 3
|
||||||
@@ -173,7 +173,7 @@ struct
|
|||||||
, y = 945
|
, y = 945
|
||||||
, health = 5
|
, health = 5
|
||||||
, xAxis = STAY_STILL
|
, xAxis = STAY_STILL
|
||||||
, yAxis = ON_GROUND
|
, yAxis = FALLING
|
||||||
}
|
}
|
||||||
val enemies = Vector.fromList [enemy1, enemy2, enemy3]
|
val enemies = Vector.fromList [enemy1, enemy2, enemy3]
|
||||||
in
|
in
|
||||||
|
|||||||
4
oms.mlb
4
oms.mlb
@@ -14,13 +14,13 @@ end
|
|||||||
|
|
||||||
fcore/wall.sml
|
fcore/wall.sml
|
||||||
fcore/platform.sml
|
fcore/platform.sml
|
||||||
fcore/enemy.sml
|
|
||||||
fcore/game-type.sml
|
fcore/game-type.sml
|
||||||
|
|
||||||
fcore/player-patch.sml
|
fcore/player-patch.sml
|
||||||
fcore/enemy-patch.sml
|
fcore/enemy-patch.sml
|
||||||
|
|
||||||
fcore/physics.sml
|
fcore/physics.sml
|
||||||
|
|
||||||
|
fcore/enemy.sml
|
||||||
fcore/player.sml
|
fcore/player.sml
|
||||||
fcore/projectile.sml
|
fcore/projectile.sml
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user