Working prototype
This commit is contained in:
parent
3de181134d
commit
1ed0ec226d
24 changed files with 682 additions and 31 deletions
34
Game.gd
Normal file
34
Game.gd
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
extends Node3D
|
||||
|
||||
var is_blacks_turn: bool = false
|
||||
|
||||
var current_turn: int = 1
|
||||
|
||||
@onready var map: HexGrid = $HexGrid
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
GameEvents.insect_tile_finished_moving.connect(_on_insect_tile_finished_moving)
|
||||
GameEvents.insect_tile_created.connect(_on_insect_tile_created)
|
||||
|
||||
GameEvents.game_started.emit()
|
||||
|
||||
func advance_turn():
|
||||
GameEvents.turn_ended.emit(current_turn, map)
|
||||
is_blacks_turn = !is_blacks_turn
|
||||
current_turn = current_turn + 1
|
||||
print(current_turn)
|
||||
GameEvents.turn_started.emit(current_turn, map, is_blacks_turn)
|
||||
|
||||
func _on_insect_tile_finished_moving(tile: InsectTile, target: Vector4i) -> void:
|
||||
print("moved")
|
||||
print(multiplayer.is_server())
|
||||
advance_turn()
|
||||
|
||||
func _on_insect_tile_created(tile: InsectTile, pos: Vector4i) -> void:
|
||||
print("created")
|
||||
advance_turn()
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue