Updates to support changes to CyberarmEngine

This commit is contained in:
2023-03-30 10:49:47 -05:00
parent e8702f2b2e
commit b418c402fb
5 changed files with 28 additions and 24 deletions

View File

@@ -14,7 +14,7 @@ class IMICRTS
@entities = []
@orders = []
@camera = Camera.new(viewport: [0, 0, $window.width, $window.height])
@camera = Camera.new
@last_camera_position = @camera.position.clone
@camera_moved = true
@camera_move_threshold = 5
@@ -27,7 +27,10 @@ class IMICRTS
@camera_moved = (@last_camera_position - @camera.position.clone).sum > @camera_move_threshold
@last_camera_position = @camera.position.clone
@entities.each { |ent| ent.tick(tick_id); @visiblity_map.update(ent) }
@entities.each do |ent|
ent.tick(tick_id)
@visiblity_map.update(ent)
end
end
def update
@@ -58,4 +61,4 @@ class IMICRTS
end
end
end
end
end