12 lines
379 B
C#
12 lines
379 B
C#
using Godot;
|
|
|
|
namespace Tutorial1.Scripts;
|
|
|
|
public partial class Character : Node {
|
|
private Sprite2D sprite2D;
|
|
public override void _Ready() => sprite2D = GetChild<Sprite2D>(0);
|
|
|
|
public override void _UnhandledInput(InputEvent @event) {
|
|
if (@event is InputEventMouseButton { Pressed: true } buttonEvent) sprite2D.Position = buttonEvent.GlobalPosition;
|
|
}
|
|
} |