Grid.gd 299 B

1234567891011121314
  1. extends TileMap
  2. signal kace_broken
  3. enum Tile {
  4. BRICK = 0,
  5. }
  6. func _on_Ball_kace_contact(contact_pos:Vector2):
  7. var tile_pos = world_to_map(contact_pos)
  8. var cell = get_cellv(tile_pos)
  9. if cell != TileMap.INVALID_CELL and cell == Tile.BRICK:
  10. set_cellv(tile_pos, -1)
  11. emit_signal("kace_broken")