mirror of
https://github.com/cyberarm/i-mic-rts.git
synced 2025-12-15 15:52:34 +00:00
Added spawn points to test_map, Debug text now shows type of tile under mouse
This commit is contained in:
@@ -2,7 +2,7 @@ class IMICRTS
|
||||
class Map
|
||||
Tile = Struct.new(:position, :color, :image, :state, :type)
|
||||
|
||||
attr_reader :tiles, :ores
|
||||
attr_reader :tile_size, :tiles, :ores
|
||||
def initialize(map_file:)
|
||||
@tiled_map = TiledMap.new(map_file)
|
||||
|
||||
|
||||
@@ -90,6 +90,7 @@ class IMICRTS
|
||||
end
|
||||
|
||||
mouse = @player.camera.transform(window.mouse)
|
||||
tile = @director.map.tile_at(mouse.x / @director.map.tile_size, mouse.y / @director.map.tile_size)
|
||||
@debug_info.text = %(
|
||||
FPS: #{Gosu.fps}
|
||||
Aspect Ratio: #{@player.camera.aspect_ratio}
|
||||
@@ -104,6 +105,7 @@ class IMICRTS
|
||||
World Mouse Y: #{mouse.y}
|
||||
|
||||
Director Tick: #{@director.current_tick}
|
||||
Tile: X: #{tile.position.x} Y: #{tile.position.y} Type: #{tile.type}
|
||||
).lines.map { |line| line.strip }.join("\n")
|
||||
|
||||
@debug_info.x = @sidebar.width + 20
|
||||
|
||||
Reference in New Issue
Block a user