GodotComponentTest/utils/GameTile.gd

21 lines
540 B
GDScript
Raw Normal View History

2022-09-21 14:09:31 +02:00
extends "res://addons/gdhexgrid/HexCell.gd"
2022-10-07 16:14:05 +02:00
class_name GameTile
2022-09-21 14:09:31 +02:00
2022-10-08 14:14:20 +02:00
enum TileType { Water, Sand, Grass, DeepGrass, Rock }
2022-09-21 14:09:31 +02:00
var type = TileType.Sand
func _init(coords=null):
# HexCells can be created with coordinates
if coords:
self.cube_coords = obj_to_coords(coords)
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func fromHexCell (hex_cell: HexCell):
cube_coords = hex_cell.cube_coords
offset_coords = hex_cell.offset_coords
axial_coords = hex_cell.axial_coords