Merge branch 'tower' of ssh://git.sjkillen.ca:2222/sjkillen/grounders-slowjam-2024 into tower
This commit is contained in:
commit
79df0710c0
|
@ -71,7 +71,6 @@ func server_add_player(id: int):
|
|||
%PlayerSpawner.spawn(id)
|
||||
|
||||
static func find_level(node: Node) -> Level:
|
||||
var parent := node
|
||||
while not (node is Level):
|
||||
node = node.get_parent()
|
||||
return node
|
||||
|
|
|
@ -27,6 +27,7 @@ func is_on_ground() -> bool:
|
|||
|
||||
|
||||
func _physics_process(delta):
|
||||
print(is_on_ground())
|
||||
if not is_on_floor():
|
||||
velocity.y -= gravity * delta
|
||||
|
||||
|
@ -58,7 +59,7 @@ func get_first_bumper() -> Player:
|
|||
func _on_tag_detection_area_entered(area):
|
||||
if not (area.get_parent() is Player):
|
||||
return
|
||||
var other_player: Player = area.get_parent()
|
||||
var _other_player: Player = area.get_parent()
|
||||
if is_bumping.is_connected(_bump_check):
|
||||
return
|
||||
is_bumping.connect(_bump_check)
|
||||
|
@ -66,7 +67,7 @@ func _on_tag_detection_area_entered(area):
|
|||
func _on_tag_detection_area_exited(area):
|
||||
if not (area.get_parent() is Player):
|
||||
return
|
||||
var other_player: Player = area.get_parent()
|
||||
var _other_player: Player = area.get_parent()
|
||||
if not is_bumping.is_connected(_bump_check):
|
||||
return
|
||||
is_bumping.disconnect(_bump_check)
|
||||
|
@ -74,6 +75,7 @@ func _on_tag_detection_area_exited(area):
|
|||
|
||||
func _on_tag_detection_body_entered(body):
|
||||
if body.is_in_group("ground"):
|
||||
print("fuck")
|
||||
if not is_grounded.is_connected(body.grounded):
|
||||
is_grounded.connect(body.grounded)
|
||||
|
||||
|
|
|
@ -3,8 +3,12 @@ extends Control
|
|||
signal join_lobby(addr: String, port: int)
|
||||
|
||||
@rpc("reliable", "authority", "call_local")
|
||||
func add(addr: String, port: int):
|
||||
func add(port: int):
|
||||
var lobby_button := preload("res://server/lobby_list_entry.tscn").instantiate()
|
||||
var addr := "127.0.0.1"
|
||||
var peer := (multiplayer.multiplayer_peer as ENetMultiplayerPeer).get_peer(1)
|
||||
if peer != null:
|
||||
addr = peer.get_remote_address()
|
||||
lobby_button.address = addr
|
||||
lobby_button.port = port
|
||||
$Lobbies.add_child(lobby_button, true)
|
||||
|
|
|
@ -19,14 +19,14 @@ func _ready():
|
|||
func peer_connected(id: int):
|
||||
print("Client " + str(id) + " connected to master server")
|
||||
for lobby in %LobbyList.lobbies():
|
||||
%LobbyList.add.rpc_id(id, lobby.address, lobby.port)
|
||||
%LobbyList.add.rpc_id(id, lobby.port)
|
||||
|
||||
func create_lobby():
|
||||
var lobby := preload("res://server/lobby.tscn").instantiate()
|
||||
lobby.port = next_port_num
|
||||
next_port_num += 1
|
||||
%Lobbies.add_child(lobby)
|
||||
%LobbyList.add.rpc(external_address, lobby.port)
|
||||
%LobbyList.add.rpc(lobby.port)
|
||||
|
||||
func _on_create_lobby_pressed():
|
||||
create_lobby()
|
||||
|
|
Loading…
Reference in New Issue