additional refactoring, moving player type into its own directory

This commit is contained in:
2025-02-14 10:13:03 +00:00
parent d1e23b5455
commit 46a1836ae2
12 changed files with 88 additions and 114 deletions

View File

@@ -1,11 +1,10 @@
structure EnemyBehaviour =
struct
open GameType
open EnemyType
open EntityType
(* if player is attacking, does enemy collide with attack? *)
fun isCollidingWithPlayerAttack (player: player, enemy: enemy) =
fun isCollidingWithPlayerAttack (player: PlayerType.player, enemy: enemy) =
let
val {x = px, y = py, facing, mainAttack, ...} = player
val pSize = Constants.playerSize
@@ -14,7 +13,7 @@ struct
val eSize = Constants.enemySize
in
case mainAttack of
MAIN_ATTACKING {length, ...} =>
PlayerType.MAIN_ATTACKING {length, ...} =>
(case facing of
FACING_RIGHT =>
let
@@ -359,7 +358,14 @@ struct
end
fun getFollowPatches
(player: player, enemy, wallTree, platformTree, platforms, graph, acc) =
( player: PlayerType.player
, enemy
, wallTree
, platformTree
, platforms
, graph
, acc
) =
let
val pID = #platID player
val eID = #platID enemy