Compare commits
No commits in common. "bde9492c638e39870f2a460094085e37795e0f33" and "9283a3263f42c5324f4dc92e6054d871d4dc5196" have entirely different histories.
bde9492c63
...
9283a3263f
|
|
@ -23,8 +23,8 @@ onready var animated_sprite : AnimatedSprite = $AnimatedSprite_StateReceiver
|
|||
|
||||
## Multiplayer Variables
|
||||
puppet var puppet_pos = Vector2()
|
||||
#puppet var puppet_anim_sprite_frame :int
|
||||
#puppet var puppet_anim_sprite_name :String
|
||||
puppet var puppet_anim_sprite_frame :int
|
||||
puppet var puppet_anim_sprite_name :String
|
||||
puppet var puppet_transform: Transform2D
|
||||
|
||||
##TODO:
|
||||
|
|
@ -34,24 +34,24 @@ puppet var puppet_transform: Transform2D
|
|||
# interfaces for the state machines.
|
||||
|
||||
func _ready() -> void:
|
||||
# puppet_anim_sprite_name = animated_sprite.animation
|
||||
# puppet_anim_sprite_frame = animated_sprite.frame
|
||||
puppet_anim_sprite_name = animated_sprite.animation
|
||||
puppet_anim_sprite_frame = animated_sprite.frame
|
||||
puppet_transform = transform
|
||||
## Disable Process and Physics on puppets
|
||||
# if not is_network_master():
|
||||
# animated_sprite.set_process(false)
|
||||
# animated_sprite.set_physics_process(false)
|
||||
if not is_network_master():
|
||||
animated_sprite.set_process(false)
|
||||
animated_sprite.set_physics_process(false)
|
||||
#movement_state_machine.init_animated_actor(self)
|
||||
#movement_component.attack_function = funcref(self, "attack")
|
||||
# movement_component.player_number = player_number
|
||||
|
||||
#func _process(delta):
|
||||
# if is_network_master():
|
||||
# rset("puppet_anim_sprite_name", animated_sprite.animation)
|
||||
# rset("puppet_anim_sprite_frame", animated_sprite.frame)
|
||||
# else:
|
||||
# animated_sprite.animation = puppet_anim_sprite_name
|
||||
# animated_sprite.frame = puppet_anim_sprite_frame
|
||||
func _process(delta):
|
||||
if is_network_master():
|
||||
rset("puppet_anim_sprite_name", animated_sprite.animation)
|
||||
rset("puppet_anim_sprite_frame", animated_sprite.frame)
|
||||
else:
|
||||
animated_sprite.animation = puppet_anim_sprite_name
|
||||
animated_sprite.frame = puppet_anim_sprite_frame
|
||||
|
||||
func _unhandled_input(event: InputEvent) -> void:
|
||||
if is_network_master():
|
||||
|
|
|
|||
|
|
@ -80,9 +80,6 @@ func change_state(new_state: State) -> void:
|
|||
current_state = new_state
|
||||
current_state.enter()
|
||||
|
||||
#puppet puppet_change_state(new_state: State) -> void:
|
||||
# pass
|
||||
|
||||
# Seems like I don't have to do this every state change!
|
||||
# if(state_modifiers.size() > 0):
|
||||
# print("Active Modifiers:")
|
||||
|
|
@ -93,7 +90,7 @@ func change_state(new_state: State) -> void:
|
|||
|
||||
emit_signal("state_changed",current_state_name,current_state)
|
||||
|
||||
puppet func puppet_change_to_known_state(new_state_name: String) -> void:
|
||||
func change_to_known_state(new_state_name: String) -> void:
|
||||
if new_state_name.empty() == false:
|
||||
if states_index.has(new_state_name):
|
||||
change_state(states_index[new_state_name])
|
||||
|
|
@ -101,16 +98,6 @@ puppet func puppet_change_to_known_state(new_state_name: String) -> void:
|
|||
push_warning(get_parent().name + ": Attempt to switch state to unknown: " + new_state_name)
|
||||
change_state(states_index["default"])
|
||||
|
||||
func change_to_known_state(new_state_name: String) -> void:
|
||||
if is_network_master():
|
||||
if new_state_name.empty() == false:
|
||||
if states_index.has(new_state_name):
|
||||
change_state(states_index[new_state_name])
|
||||
else:
|
||||
push_warning(get_parent().name + ": Attempt to switch state to unknown: " + new_state_name)
|
||||
change_state(states_index["default"])
|
||||
rpc("puppet_change_to_known_state", new_state_name)
|
||||
|
||||
#func check_parent_before_state_change(new_state_name: String) -> bool:
|
||||
# ##TODO: Make this a verifiable funcref or something
|
||||
# if get_parent().has_method("check_state_change"):
|
||||
|
|
|
|||
|
|
@ -14,9 +14,6 @@ func _ready():
|
|||
else:
|
||||
var desktop_path = OS.get_system_dir(0).replace("\\", "/").split("/")
|
||||
$Connect/Name.text = desktop_path[desktop_path.size() - 2]
|
||||
|
||||
$Connect/Join.grab_focus()
|
||||
|
||||
|
||||
|
||||
func _on_host_pressed():
|
||||
|
|
@ -31,7 +28,7 @@ func _on_host_pressed():
|
|||
var player_name = $Connect/Name.text
|
||||
NetworkManager.host_game(player_name)
|
||||
refresh_lobby()
|
||||
$Players/Start.grab_focus()
|
||||
|
||||
|
||||
func _on_join_pressed():
|
||||
if $Connect/Name.text == "":
|
||||
|
|
@ -46,7 +43,6 @@ func _on_join_pressed():
|
|||
$Connect/ErrorLabel.text = ""
|
||||
$Connect/Host.disabled = true
|
||||
$Connect/Join.disabled = true
|
||||
$Players/Start.grab_focus()
|
||||
|
||||
var player_name = $Connect/Name.text
|
||||
NetworkManager.join_game(ip, player_name)
|
||||
|
|
|
|||
|
|
@ -129,14 +129,13 @@ margin_bottom = 109.0
|
|||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
text = "192.168.0.133"
|
||||
text = "127.0.0.1"
|
||||
|
||||
[node name="Host" type="Button" parent="Connect"]
|
||||
margin_left = 181.0
|
||||
margin_top = 31.0
|
||||
margin_right = 246.0
|
||||
margin_bottom = 51.0
|
||||
focus_neighbour_bottom = NodePath("../Join")
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
|
|
@ -147,7 +146,6 @@ margin_left = 181.0
|
|||
margin_top = 87.0
|
||||
margin_right = 246.0
|
||||
margin_bottom = 107.0
|
||||
focus_neighbour_top = NodePath("../Host")
|
||||
size_flags_horizontal = 2
|
||||
size_flags_vertical = 2
|
||||
custom_fonts/font = ExtResource( 2 )
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user