25 lines
459 B
C#
25 lines
459 B
C#
using Godot;
|
|
using System;
|
|
|
|
public partial class Potato : CharacterBase
|
|
{
|
|
private AnimatedSprite2D? _animatedSprite;
|
|
|
|
public override void _Ready()
|
|
{
|
|
_animatedSprite = GetNode<AnimatedSprite2D>("AnimatedSprite2D");
|
|
}
|
|
|
|
public override void _Process(double delta)
|
|
{
|
|
if (IsMoving)
|
|
{
|
|
_animatedSprite?.Play("walk");
|
|
}
|
|
else
|
|
{
|
|
_animatedSprite?.Stop();
|
|
}
|
|
}
|
|
}
|