added gumba mushroom and sound

This commit is contained in:
Jonas Braus
2024-07-29 18:54:40 +02:00
parent e06f422597
commit b339ef3c29
60 changed files with 1142 additions and 9 deletions
+20
View File
@@ -0,0 +1,20 @@
extends RigidBody2D
@export var speed = 70
@onready var ray_cast_left = $RayCastLeft
@onready var ray_cast_right = $RayCastRight
@onready var animation_player = $AnimationPlayer
func _physics_process(delta):
linear_velocity.x = speed
if ray_cast_left.is_colliding():
speed = abs(speed)
elif ray_cast_right.is_colliding():
speed = abs(speed) * -1
func _on_area_2d_body_entered(body):
body.grow()
speed = 0
animation_player.play("pickup")