Added construction complete order, added jeep overlay image to show windscreen, added rotors component for helicopter; more work needed, replaced all build and vehicle assets with ones that are 6x larger to prevent pixelization when zoomed in, misc.

This commit is contained in:
2021-01-08 12:41:04 -06:00
parent 0d449b9375
commit a3c3939f50
45 changed files with 149 additions and 66 deletions

View File

@@ -12,12 +12,18 @@ class IMICRTS
@entities = []
@orders = []
@camera = Camera.new(viewport: [0, 0, $window.width, $window.height])
@last_camera_position = @camera.position.clone
@camera_moved = true
@camera_move_threshold = 5
@selected_entities = []
@current_entity_id = 0
end
def tick(tick_id)
@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) }
end
@@ -33,6 +39,10 @@ class IMICRTS
@current_entity_id += 1
end
def camera_moved?
@camera_moved
end
class ScheduledOrder
attr_reader :order_id, :tick_id, :serialized_order
def initialize(order_id, tick_id, serialized_order)