look like it works now, i did a workaround, dunno what this issue was 💀
This commit is contained in:
parent
7584cf0b19
commit
8c0860a840
8 changed files with 64 additions and 44 deletions
|
|
@ -21,19 +21,21 @@ func _ready() -> void:
|
|||
target_pos = position
|
||||
start_pos = position
|
||||
get_new_target()
|
||||
become_real()
|
||||
|
||||
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta: float) -> void:
|
||||
move_progress += delta * snake_speed
|
||||
if Input.is_action_just_pressed("left"):
|
||||
want_direction = Vector2.LEFT
|
||||
elif Input.is_action_just_pressed("right"):
|
||||
want_direction = Vector2.RIGHT
|
||||
elif Input.is_action_just_pressed("up"):
|
||||
want_direction = Vector2.UP
|
||||
elif Input.is_action_just_pressed("down"):
|
||||
want_direction = Vector2.DOWN
|
||||
if(!Router.player_mode):
|
||||
if Input.is_action_just_pressed("left"):
|
||||
want_direction = Vector2.LEFT
|
||||
elif Input.is_action_just_pressed("right"):
|
||||
want_direction = Vector2.RIGHT
|
||||
elif Input.is_action_just_pressed("up"):
|
||||
want_direction = Vector2.UP
|
||||
elif Input.is_action_just_pressed("down"):
|
||||
want_direction = Vector2.DOWN
|
||||
position = lerp(start_pos,target_pos,move_progress)
|
||||
if move_progress >= 1:
|
||||
get_new_target()
|
||||
|
|
@ -55,7 +57,7 @@ func become_real():
|
|||
pass
|
||||
|
||||
func become_fake():
|
||||
z_index = 0
|
||||
modulate = Color.DIM_GRAY
|
||||
collision_layer = 2
|
||||
#z_index = 0
|
||||
#modulate = Color.DIM_GRAY
|
||||
#collision_layer = 2
|
||||
pass
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue