First commit

This commit is contained in:
2025-12-04 11:13:48 -05:00
commit 5d8452c70d
39 changed files with 1509 additions and 0 deletions

4
scripts/autos/game.gd Normal file
View File

@@ -0,0 +1,4 @@
extends Node
var player : Player

View File

@@ -0,0 +1 @@
uid://cro6hr2qds783

View File

@@ -0,0 +1,30 @@
extends Node
const SERVER_PORT = 8080
const SERVER_IP = "127.0.0.1"
func become_host() -> void:
print("Starting host!")
var server_peer = ENetMultiplayerPeer.new()
server_peer.create_server(SERVER_PORT)
multiplayer.multiplayer_peer = server_peer
multiplayer.peer_connected.connect(_add_player_to_game)
multiplayer.peer_disconnected.connect(_remove_player_from_game)
func join_game() -> void:
print("Player 2 joining.")
var client_peer = ENetMultiplayerPeer.new()
client_peer.create_client(SERVER_IP, SERVER_PORT)
func _add_player_to_game(id : int) -> void:
print("Player %s joined the game!" % id)
func _remove_player_from_game(id : int) -> void:
print("Player %s left the game!" % id)

View File

@@ -0,0 +1 @@
uid://dhrl1x443cqt1