Update coopa.gd
This commit is contained in:
@@ -27,10 +27,10 @@ func _physics_process(delta):
|
||||
if ray_cast_left_2 == null:
|
||||
return
|
||||
|
||||
if (ray_cast_left.is_colliding() or ray_cast_left_2.is_colliding()) and not is_down:
|
||||
if ray_cast_left.is_colliding() or ray_cast_left_2.is_colliding():
|
||||
speed = abs(speed)
|
||||
animated_sprite_2d.flip_h = true
|
||||
elif (ray_cast_right.is_colliding() or ray_cast_right_2.is_colliding()) and not is_down:
|
||||
elif ray_cast_right.is_colliding() or ray_cast_right_2.is_colliding():
|
||||
speed = -abs(speed)
|
||||
animated_sprite_2d.flip_h = false
|
||||
|
||||
@@ -82,6 +82,9 @@ func f_die():
|
||||
func f_shrink(body):
|
||||
die_sound.play()
|
||||
if not is_down:
|
||||
# collission mask only to walls
|
||||
ray_cast_left.collision_mask = pow(2, 1-1)
|
||||
ray_cast_right.collision_mask = pow(2, 1-1)
|
||||
speed = 0
|
||||
collision_shape_2d.shape.height -= 9
|
||||
die.position.y += 2
|
||||
|
||||
Reference in New Issue
Block a user