This commit is contained in:
Jonas Braus
2024-08-04 17:23:08 +02:00
parent 2e845bf217
commit 08f75b79d8
18 changed files with 392 additions and 129 deletions
+3 -1
View File
@@ -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
+3 -1
View File
@@ -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