trynna fix click handler being garbage collected
This commit is contained in:
@@ -61,6 +61,13 @@ world.spawn do |e| # Name is optional
|
||||
animation1 = {tiles: tiles[0..3], frame_rate: 10, loop: true}
|
||||
c.animations = {idle: animation1}
|
||||
c.current_animation = :idle
|
||||
## For tilemaps
|
||||
# tiles is an array of of tiles in sheet, largest one's w and h will be used. or width: height: to override
|
||||
c.tilemap = Tilemap.new tiles
|
||||
c.default_tile = tiles.first # default tile to use for empty spaces in the tilemap
|
||||
c.auto_tile = true # tiles must follow pattern
|
||||
# c.tile[x: 0, y: 0] = tiles[0] # set tile at position x,y in tilemap to a specific tile from the sheet (if no auto_tile is used)
|
||||
c.tile[x: 0, y: 0] = true # true/false otherwise
|
||||
end
|
||||
e.add_component :render do |c|
|
||||
c.z_index = 0
|
||||
|
||||
Reference in New Issue
Block a user