dodge-the-creeps/Scripts/Mob.gd
2024-02-20 18:56:39 +03:00

22 lines
610 B
GDScript

extends RigidBody2D
class_name Mob
var _sprite: AnimatedSprite2D
var _shape: CollisionShape2D
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
_sprite = $Sprite
_shape = $Shape
var mob_types := _sprite.sprite_frames.get_animation_names()
_sprite.play(
mob_types[randi() % mob_types.size()]
)
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
func _on_visible_on_screen_enabler_2d_screen_exited() -> void:
queue_free()
pass # Replace with function body.