Deleted rotation sync

This commit is contained in:
Kristofers Solo 2021-11-02 16:20:54 +02:00
parent bde1f29107
commit 0c38e87bb1
5 changed files with 10 additions and 10 deletions

View File

@ -36,7 +36,7 @@ func _physics_process(delta):
if get_tree().has_network_peer():
if is_network_master():
mode_switch(delta)
screen_wrap()
screen_wrap()
func mode_switch(delta):
@ -122,7 +122,6 @@ func _on_network_tick_rate_timeout():
if is_network_master():
rset_unreliable("puppet_position", global_position)
rset_unreliable("puppet_velocity", velocity)
rset_unreliable("puppet_rotation", rotation_degrees)
sync func update_position(pos):

View File

@ -1,6 +1,5 @@
extends Node
signal new_server
signal remove_server

View File

@ -3,7 +3,6 @@ extends Control
func _on_ok_pressed():
get_tree().change_scene("res://scenes/main_menu.tscn")
func set_text(text) -> void:

View File

@ -28,5 +28,8 @@ margin_top = 13.0
margin_bottom = -13.0
custom_fonts/font = ExtResource( 1 )
text = "Join"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="join_button" to="." method="_on_join_button_pressed"]

View File

@ -55,10 +55,10 @@ func movement(delta):
if Input.is_action_just_pressed("stop"):
velocity.x = 0
velocity.y = 0
if Input.is_action_pressed("move_left"):
if Input.is_action_pressed("inpt_left"):
if velocity.x > -MAX_SPEED:
velocity.x -= speed
elif Input.is_action_pressed("move_right"):
elif Input.is_action_pressed("inpt_right"):
if velocity.x < MAX_SPEED:
velocity.x += speed
@ -74,13 +74,13 @@ func movement(delta):
func flying():
var fly_speed = 1000
var velocity = Vector2()
if Input.is_action_pressed("move_right"):
if Input.is_action_pressed("inpt_right"):
velocity.x += 1
if Input.is_action_pressed("move_left"):
if Input.is_action_pressed("inpt_left"):
velocity.x -= 1
if Input.is_action_pressed("move_down"):
if Input.is_action_pressed("inpt_down"):
velocity.y += 1
if Input.is_action_pressed("move_up"):
if Input.is_action_pressed("inpt_up"):
velocity.y -= 1
velocity = velocity.normalized() * fly_speed