diff --git a/fcore/enemy/enemy-behaviour.sml b/fcore/enemy/enemy-behaviour.sml index 8331609..62f376b 100644 --- a/fcore/enemy/enemy-behaviour.sml +++ b/fcore/enemy/enemy-behaviour.sml @@ -425,7 +425,7 @@ struct * fallingEnemies *) let val fallingList = - {x = x, y = y, variant = #variant enemy, jumped = 0} :: fallingList + {x = x, y = y, variant = #variant enemy} :: fallingList in (enemyList, fallingList) end @@ -472,7 +472,7 @@ struct * fallingEnemies *) let val fallingList = - {x = x, y = y, variant = #variant enemy, jumped = 0} :: fallingList + {x = x, y = y, variant = #variant enemy} :: fallingList in (enemyList, fallingList) end diff --git a/fcore/enemy/falling-enemies.sml b/fcore/enemy/falling-enemies.sml index ac466e1..abf3e5e 100644 --- a/fcore/enemy/falling-enemies.sml +++ b/fcore/enemy/falling-enemies.sml @@ -49,7 +49,7 @@ struct acc else let - val {x, y, jumped, variant} = Vector.sub (vec, pos) + val {x, y, variant} = Vector.sub (vec, pos) val size = Constants.enemySize val ww = Constants.worldWidth @@ -59,21 +59,10 @@ struct (* filter out if player is attacking falling enemy *) updateList (pos - 1, vec, player, acc) else if Collision.isCollidingPlus (x, y, size, size, 0, 0, ww, wh) then - (* move falling enemy up or down depending on jumped *) + (* move falling enemy upwards *) let val updated = - if jumped < Constants.jumpLimit then - { x = x - , y = y - Constants.moveEnemyBy - , jumped = jumped + Constants.moveEnemyBy - , variant = variant - } - else - { x = x - , y = y + Constants.moveEnemyBy - , jumped = jumped - , variant = variant - } + {x = x, y = y - Constants.moveEnemyBy, variant = variant} in updateList (pos - 1, vec, player, updated :: acc) end @@ -89,7 +78,7 @@ struct Vector.concat acc else let - val {x, y, variant = _, jumped = _} = Vector.sub (fallingVec, pos) + val {x, y, variant = _} = Vector.sub (fallingVec, pos) val x = Real32.fromInt x * ratio + xOffset val y = Real32.fromInt y * ratio + yOffset diff --git a/fcore/game-type.sml b/fcore/game-type.sml index 097d7e8..8e264a7 100644 --- a/fcore/game-type.sml +++ b/fcore/game-type.sml @@ -58,7 +58,7 @@ sig , nextPlatID: int } - type falling_enemy = {x: int, y: int, variant: EnemyVariants.t, jumped: int} + type falling_enemy = {x: int, y: int, variant: EnemyVariants.t} type game_type = { player: player @@ -135,7 +135,7 @@ struct , nextPlatID: int } - type falling_enemy = {x: int, y: int, variant: EnemyVariants.t, jumped: int} + type falling_enemy = {x: int, y: int, variant: EnemyVariants.t} type game_type = { player: player