Push project up
This commit is contained in:
34
scripts/data/game_data.gd
Normal file
34
scripts/data/game_data.gd
Normal file
@@ -0,0 +1,34 @@
|
||||
class_name GameData extends Node
|
||||
|
||||
|
||||
var client1: int
|
||||
var client2: int
|
||||
var player_id: String = ""
|
||||
|
||||
var game_address: String = "0.0.0.0"
|
||||
var game_port: int = 8080
|
||||
var game_mode: String = ""
|
||||
|
||||
enum PlayerType {
|
||||
Player1,
|
||||
Player2
|
||||
}
|
||||
|
||||
|
||||
func _init() -> void:
|
||||
Globals.game_data = self
|
||||
|
||||
@rpc("authority", "reliable")
|
||||
func set_game_address(address: String) -> void:
|
||||
game_address = address
|
||||
|
||||
@rpc("authority", "reliable")
|
||||
func set_game_port(port: String) -> void:
|
||||
game_port = int(port)
|
||||
|
||||
|
||||
func set_game_mode(_mode: String) -> void:
|
||||
pass
|
||||
|
||||
func set_player_id(is_player_1: bool) -> void:
|
||||
player_id = "Player 1" if is_player_1 else "Player 2"
|
||||
Reference in New Issue
Block a user