Refactored to allow hotseat and multiplayer. TODO: Create interface class for webrtc/enet multiplayer
This commit is contained in:
parent
d688eaf9c6
commit
5fe8f22ccb
27 changed files with 798 additions and 135 deletions
|
|
@ -2,7 +2,11 @@ extends Node
|
|||
|
||||
const WEBSOCKET_ENDPOINT: String = "wss://dev.bytesandpieces.xyz:9088"
|
||||
|
||||
var is_hot_seat: bool = false
|
||||
# By default, peer_id is 1. This should make everything work flawless for local hotseat
|
||||
var peer_id: int = 1
|
||||
|
||||
|
||||
var is_hot_seat: bool = true
|
||||
|
||||
var is_player_black: bool = false
|
||||
var debug: bool = false
|
||||
|
|
@ -10,13 +14,17 @@ var allow_selecting_in_stack: bool = false
|
|||
|
||||
var lobby_code: String = ""
|
||||
|
||||
var has_bee_been_placed: bool = false
|
||||
var bees_placed: Dictionary = {}
|
||||
# false as key = white
|
||||
# true as key = black
|
||||
|
||||
# bees_placed.has(is_player_black) false/true -> white/black
|
||||
var bees_placed: Dictionary = {}
|
||||
|
||||
|
||||
var disconnect_reason: String = ""
|
||||
|
||||
func reset() -> void:
|
||||
is_hot_seat = false
|
||||
has_bee_been_placed = false
|
||||
disconnect_reason = ""
|
||||
bees_placed = {}
|
||||
peer_id = 1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue