mirror of
https://github.com/Relintai/pandemonium_demo_projects.git
synced 2025-01-04 14:49:41 +01:00
18 lines
413 B
C#
18 lines
413 B
C#
using Godot;
|
|
|
|
public class Mob : RigidBody2D
|
|
{
|
|
public override void _Ready()
|
|
{
|
|
var animSprite = GetNode<AnimatedSprite>("AnimatedSprite");
|
|
animSprite.Playing = true;
|
|
string[] mobTypes = animSprite.Frames.GetAnimationNames();
|
|
animSprite.Animation = mobTypes[GD.Randi() % mobTypes.Length];
|
|
}
|
|
|
|
public void OnVisibilityScreenExited()
|
|
{
|
|
QueueFree();
|
|
}
|
|
}
|