mirror of
https://github.com/kristoferssolo/FuncIt.git
synced 2025-10-21 19:30:35 +00:00
Game #4 update
This commit is contained in:
parent
37b92eb551
commit
ea639e4259
@ -1,7 +1,7 @@
|
|||||||
extends KinematicBody2D
|
extends KinematicBody2D
|
||||||
|
|
||||||
const JUMP_FORCE = 500
|
const JUMP_FORCE = 500
|
||||||
const GRAVITY = 700
|
const GRAVITY = 500
|
||||||
const MAX_SPEED = 10000
|
const MAX_SPEED = 10000
|
||||||
|
|
||||||
var speed = 15
|
var speed = 15
|
||||||
@ -13,7 +13,6 @@ puppet var puppet_velocity = Vector2()
|
|||||||
puppet var puppet_rotaion = 0
|
puppet var puppet_rotaion = 0
|
||||||
onready var tween = $Tween
|
onready var tween = $Tween
|
||||||
|
|
||||||
|
|
||||||
func _physics_process(delta):
|
func _physics_process(delta):
|
||||||
if is_network_master():
|
if is_network_master():
|
||||||
mode_switch(delta)
|
mode_switch(delta)
|
||||||
@ -64,9 +63,9 @@ func flying():
|
|||||||
if Input.is_action_pressed("move_up"):
|
if Input.is_action_pressed("move_up"):
|
||||||
velocity.y -= 1
|
velocity.y -= 1
|
||||||
velocity = velocity.normalized() * speed
|
velocity = velocity.normalized() * speed
|
||||||
|
print(velocity)
|
||||||
|
|
||||||
velocity = move_and_slide(velocity)
|
velocity = move_and_slide(velocity)
|
||||||
print(velocity)
|
|
||||||
|
|
||||||
|
|
||||||
func screen_wrap():
|
func screen_wrap():
|
||||||
@ -75,10 +74,9 @@ func screen_wrap():
|
|||||||
if position.x >= get_viewport_rect().size.x + 10:
|
if position.x >= get_viewport_rect().size.x + 10:
|
||||||
position.x = 0
|
position.x = 0
|
||||||
|
|
||||||
|
|
||||||
func puppet_position_set(new_value) -> void:
|
func puppet_position_set(new_value) -> void:
|
||||||
puppet_position = new_value
|
puppet_position = new_value
|
||||||
tween.inturpolate_polarity(self, "global_position", global_position, puppet_position, 0.1)
|
tween.interpolate_property(self, "global_position", global_position, puppet_position, 0.1)
|
||||||
tween.start()
|
tween.start()
|
||||||
|
|
||||||
|
|
||||||
@ -86,3 +84,4 @@ func _on_network_tick_rate_timeout():
|
|||||||
if is_network_master():
|
if is_network_master():
|
||||||
rset_unreliable("puppet_position", global_position)
|
rset_unreliable("puppet_position", global_position)
|
||||||
rset_unreliable("puppet_velocity", velocity)
|
rset_unreliable("puppet_velocity", velocity)
|
||||||
|
rset_unreliable("puppet_rotation", rotation_degrees)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user