level 5
This commit is contained in:
@@ -14,6 +14,7 @@ var is_down = false
|
||||
@onready var collision_shape_2d = $CollisionShape2D
|
||||
@onready var ray_cast_left_3 = $RayCastLeft3
|
||||
@onready var ray_cast_right_3 = $RayCastRight3
|
||||
@onready var player = %player
|
||||
|
||||
func _ready():
|
||||
var coll = CapsuleShape2D.new()
|
||||
@@ -22,7 +23,8 @@ func _ready():
|
||||
collision_shape_2d.shape = coll
|
||||
|
||||
func _physics_process(delta):
|
||||
linear_velocity.x = speed
|
||||
if abs(position.x - player.position.x) < 220 or is_down:
|
||||
linear_velocity.x = speed
|
||||
|
||||
if ray_cast_left_2 == null:
|
||||
return
|
||||
|
||||
@@ -11,9 +11,11 @@ extends RigidBody2D
|
||||
var innocent = false
|
||||
@onready var timer_2 = $Timer2
|
||||
@onready var gumba = $"."
|
||||
@onready var player = %player
|
||||
|
||||
func _physics_process(delta):
|
||||
linear_velocity.x = speed
|
||||
if abs(position.x - player.position.x) < 220:
|
||||
linear_velocity.x = speed
|
||||
|
||||
if ray_cast_left_2 == null:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user