trying to get essentials working

This commit is contained in:
anonoe 2026-02-09 20:49:52 +01:00
parent c30449c479
commit 34ba37312a
Signed by: anonoe
SSH key fingerprint: SHA256:OnAs6gNQelOnDiY5tBpDYKQiuTgBvnmIdMo5P09cdqg
9 changed files with 80 additions and 16 deletions

18
scripts/Player.cs Normal file
View file

@ -0,0 +1,18 @@
/// <summary>
/// Moves the player using top-down controls.
/// </summary>
using Godot;
//using System;
public partial class Player : CharacterBody2D
{
[Export] public float Speed = 220f;
public override void _PhysicsProcess(double delta)
{
Vector2 input = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
Velocity = input * Speed;
MoveAndSlide();
}
}