Refactor character and enemy AI movement logic; implement delta time for smoother updates and replace object (a reserved keyword) with prop.
This commit is contained in:
@@ -5,9 +5,9 @@ class EnemyHandler
|
||||
@enemies = []
|
||||
end
|
||||
|
||||
def update
|
||||
def update(dt)
|
||||
spawn!
|
||||
@enemies.each(&:update)
|
||||
@enemies.each { |enemy| enemy.update(dt) }
|
||||
end
|
||||
|
||||
def spawn!
|
||||
|
||||
Reference in New Issue
Block a user