mirror of
https://github.com/cyberarm/i-mic-fps.git
synced 2025-12-15 15:42:35 +00:00
Fixed map editor state crashing
This commit is contained in:
@@ -10,7 +10,8 @@ class IMICFPS
|
|||||||
# in to a Scene or Scene3D container object
|
# in to a Scene or Scene3D container object
|
||||||
# and refactor Game to use it.
|
# and refactor Game to use it.
|
||||||
Publisher.new
|
Publisher.new
|
||||||
@map = Map.new(map_parser: @options[:map_parser])
|
window.director.load_map(map_parser: @options[:map_parser])
|
||||||
|
@map = window.director.map
|
||||||
@camera = PerspectiveCamera.new(position: Vector.new, aspect_ratio: window.aspect_ratio)
|
@camera = PerspectiveCamera.new(position: Vector.new, aspect_ratio: window.aspect_ratio)
|
||||||
@editor = IMICFPS::Editor.new(manifest: Manifest.new(package: "base", name: "editor"))
|
@editor = IMICFPS::Editor.new(manifest: Manifest.new(package: "base", name: "editor"))
|
||||||
@camera_controller = CameraController.new(camera: @camera, entity: @editor)
|
@camera_controller = CameraController.new(camera: @camera, entity: @editor)
|
||||||
@@ -37,7 +38,7 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def control_editor
|
def control_editor
|
||||||
InputMapper.each_key do |key, pressed|
|
InputMapper.keys.each do |key, pressed|
|
||||||
next unless pressed
|
next unless pressed
|
||||||
|
|
||||||
actions = InputMapper.actions(key)
|
actions = InputMapper.actions(key)
|
||||||
|
|||||||
@@ -79,8 +79,6 @@ class IMICFPS
|
|||||||
end
|
end
|
||||||
|
|
||||||
def draw_cursor
|
def draw_cursor
|
||||||
size = 16
|
|
||||||
|
|
||||||
@cursor.draw(mouse_x, mouse_y, Float::INFINITY)
|
@cursor.draw(mouse_x, mouse_y, Float::INFINITY)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user