Move about the GoDot geezers boat race

This commit is contained in:
2026-08-18 15:09:10 +01:00
parent f28d1184cc
commit de0e8d8d1f
6 changed files with 71 additions and 1 deletions

31
Player.cs Normal file
View File

@@ -0,0 +1,31 @@
using Godot;
public partial class Player : Sprite2D
{
// Speed in pixels per second
private float _speed = 400.0f;
public override void _Process(double delta)
{
Vector2 velocity = Vector2.Zero;
if (Input.IsActionPressed("ui_right"))
{
velocity.X += 1.0f;
}
if (Input.IsActionPressed("ui_left"))
{
velocity.X -= 1.0f;
}
if (Input.IsActionPressed("ui_down"))
{
velocity.Y += 1.0f;
}
if (Input.IsActionPressed("ui_up"))
{
velocity.Y -= 1.0f;
}
Position += velocity * _speed * (float)delta;
}
}