resized textures, first draft of moving. TODO: Use cubecoordinates EVERYWHERE. Find out a way to check if moving would break a hive
This commit is contained in:
parent
aa4343309c
commit
b9df0b4361
68 changed files with 1509 additions and 17 deletions
|
|
@ -5,10 +5,14 @@ var hovered: bool = false
|
|||
var insect_resource: TileResource
|
||||
var is_black: bool = false
|
||||
|
||||
var insect_tile: InsectTile
|
||||
|
||||
var hex_pos: Vector2i = Vector2i.ZERO
|
||||
|
||||
var tile: Node3D
|
||||
|
||||
var is_moving: bool = false
|
||||
|
||||
const BUILD_GHOST = preload("res://InsectTiles/BuildGhost.tscn")
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
|
|
@ -16,7 +20,13 @@ func _ready():
|
|||
print("Should not happen!")
|
||||
return
|
||||
|
||||
GameEvents.insect_placed.connect(_on_insect_placed)
|
||||
if is_moving:
|
||||
GameEvents.insect_tile_moved.connect(_on_insect_tile_moved)
|
||||
else:
|
||||
GameEvents.insect_placed.connect(_on_insect_placed)
|
||||
|
||||
func _on_insect_tile_moved(tile: InsectTile, to: Vector2i) -> void:
|
||||
queue_free()
|
||||
|
||||
func _on_insect_placed(resource: TileResource, is_black: bool, pos: Vector2i) -> void:
|
||||
queue_free()
|
||||
|
|
@ -25,11 +35,11 @@ func _on_insect_placed(resource: TileResource, is_black: bool, pos: Vector2i) ->
|
|||
func _process(delta):
|
||||
if Input.is_action_just_pressed("place_tile"):
|
||||
if hovered:
|
||||
GameEvents.insect_placed.emit(insect_resource, is_black, hex_pos)
|
||||
print("Place me pls")
|
||||
pass
|
||||
|
||||
|
||||
if is_moving:
|
||||
GameEvents.insect_tile_moved.emit(insect_tile, hex_pos)
|
||||
else:
|
||||
GameEvents.insect_placed.emit(insect_resource, is_black, hex_pos)
|
||||
|
||||
func _on_mouse_entered():
|
||||
hovered = true
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue