a little refactoring (Player.runPhysicsAndInput function now does just that, instead of also checking for collisions with enemy)
This commit is contained in:
@@ -13,19 +13,21 @@ struct
|
||||
, fallingEnemies
|
||||
} = game
|
||||
|
||||
val player = Player.runPhysicsAndInput (game, input)
|
||||
|
||||
val enemyTree = Enemy.generateTree enemies
|
||||
val player = Player.runPhysicsAndInput (game, input, enemyTree)
|
||||
val player = Player.checkEnemyCollisions (player, enemies, enemyTree)
|
||||
|
||||
val enemies = Enemy.update
|
||||
(enemies, walls, wallTree, platforms, platformTree, player, graph)
|
||||
|
||||
(* update state of falling enemies and possibly filter *)
|
||||
(* todo: use enemy map
|
||||
val fallingEnemies = FallingEnemies.updateList
|
||||
(Vector.length fallingEnemies - 1, fallingEnemies, player, [])
|
||||
|
||||
val fallingEnemies = Vector.fromList fallingEnemies
|
||||
*)
|
||||
(* update state of falling enemies and possibly filter *)
|
||||
(* todo: use enemy map
|
||||
val fallingEnemies = FallingEnemies.updateList
|
||||
(Vector.length fallingEnemies - 1, fallingEnemies, player, [])
|
||||
|
||||
val fallingEnemies = Vector.fromList fallingEnemies
|
||||
*)
|
||||
in
|
||||
{ player = player
|
||||
, walls = walls
|
||||
|
||||
Reference in New Issue
Block a user