2018-10-09 16:58:51 +02:00
|
|
|
using Godot;
|
|
|
|
|
2022-03-28 02:05:07 +02:00
|
|
|
public partial class Mob : RigidDynamicBody2D
|
2018-10-09 16:58:51 +02:00
|
|
|
{
|
|
|
|
public override void _Ready()
|
|
|
|
{
|
2022-03-26 11:00:50 +01:00
|
|
|
var animSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
2020-10-06 11:28:27 +02:00
|
|
|
animSprite.Playing = true;
|
|
|
|
string[] mobTypes = animSprite.Frames.GetAnimationNames();
|
|
|
|
animSprite.Animation = mobTypes[GD.Randi() % mobTypes.Length];
|
2018-10-09 16:58:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public void OnVisibilityScreenExited()
|
|
|
|
{
|
|
|
|
QueueFree();
|
|
|
|
}
|
|
|
|
}
|