Refactored to use Vector4i. Added Spider/Grasshopper. TODO: Ant

This commit is contained in:
Sch1nken 2024-03-14 19:30:18 +01:00
parent ff4aa93845
commit 11f8a71f52
19 changed files with 482 additions and 326 deletions

View file

@ -2,7 +2,7 @@ extends Area3D
var hovered: bool = false
var coordinates: HexGrid.CubeCoordinates
var coordinates: Vector4i
var insect_resource: TileResource
var is_black: bool = false
@ -13,6 +13,8 @@ var tile: Node3D
var is_moving: bool = false
var map_reference: HexGrid
const BUILD_GHOST = preload("res://InsectTiles/BuildGhost.tscn")
# Called when the node enters the scene tree for the first time.
func _ready():
@ -25,10 +27,10 @@ func _ready():
else:
GameEvents.insect_placed.connect(_on_insect_placed)
func _on_insect_tile_moved(tile: InsectTile, to: HexGrid.CubeCoordinates) -> void:
func _on_insect_tile_moved(tile: InsectTile, to: Vector4i) -> void:
queue_free()
func _on_insect_placed(resource: TileResource, is_black: bool, pos: HexGrid.CubeCoordinates) -> void:
func _on_insect_placed(resource: TileResource, is_black: bool, pos: Vector4i) -> void:
queue_free()
# Called every frame. 'delta' is the elapsed time since the previous frame.
@ -46,6 +48,7 @@ func _on_mouse_entered():
tile = BUILD_GHOST.instantiate()
tile.resource = insect_resource
tile.is_black = is_black
tile.map_reference = map_reference
add_child(tile)