Use new API for 4.0

This commit is contained in:
shane pope
2023-01-29 22:39:09 -06:00
committed by GitHub
parent 229a7c78f6
commit 1981fd404f
@@ -117,8 +117,8 @@ and randomly choose one of the three animation types:
public override void _Ready()
{
var animSprite2D = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
animSprite2D.Playing = true;
string[] mobTypes = animSprite2D.Frames.GetAnimationNames();
animSprite2D.Play();
string[] mobTypes = animSprite2D.SpriteFrames.GetAnimationNames();
animSprite2D.Animation = mobTypes[GD.Randi() % mobTypes.Length];
}