codename-routes/godot/world/Tilemap.gd
2022-05-08 17:05:33 +02:00

8 lines
231 B
GDScript

extends TileMap
func set_tile_graphics(pos: Vector2, id: int):
var flip = true
set_cell(pos.x,pos.y,0,false,false,false,get_atlas_vec_for_id(id))
func get_atlas_vec_for_id(id: int) -> Vector2:
return Vector2(randi() % 4, id)