added on_order handler to entities and components, added visibility map

This commit is contained in:
2021-01-15 17:41:06 -06:00
parent e30d73d4d7
commit 19c5fc8d73
22 changed files with 164 additions and 51 deletions

View File

@@ -1,6 +1,7 @@
class IMICRTS
class Camera
attr_reader :viewport, :position, :velocity, :zoom, :drag
def initialize(viewport:, scroll_speed: 10, position: CyberarmEngine::Vector.new(0.0, 0.0))
@viewport = CyberarmEngine::BoundingBox.new(viewport[0], viewport[1], viewport[2], viewport[3])
@scroll_speed = scroll_speed
@@ -15,7 +16,9 @@ class IMICRTS
@grab_drag = 0.5 # Used when camera is panned using middle mouse button
end
def window; $window; end
def window;
$window;
end
def draw(&block)
if block