slowed the snake down, now the doors are much more reliable
This commit is contained in:
parent
5197d10172
commit
7584cf0b19
11 changed files with 71 additions and 10 deletions
12
braincell.gd
12
braincell.gd
|
|
@ -23,3 +23,15 @@ func _physics_process(delta: float) -> void:
|
|||
velocity = velocity.move_toward(Vector2(0,0), SPEED)
|
||||
|
||||
move_and_slide()
|
||||
|
||||
|
||||
func _on_door_box_area_entered(area: Area2D) -> void:
|
||||
print(area.name)
|
||||
if area.name == "DoorIn":
|
||||
global_position = area.get_parent().get_parent().door_out_node.global_position
|
||||
Router.activate_seg.emit(Router.cur_id + 1)
|
||||
# +1 seg
|
||||
elif area.name == "DoorOut":
|
||||
global_position = area.get_parent().get_parent().door_in_node.global_position
|
||||
Router.activate_seg.emit(Router.cur_id - 1)
|
||||
# -1 seg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue