Untitled
Anonymous
C#
01/12/2025 1:40 PM
523 B
17
Indexable
Never
public void Movement(float delta)
{
// Only restrict movement when dashing
if (!isDashing)
{
float SPEED = 500f;
if (Input.IsKeyPressed(Key.W))
{
Position += new Vector2(0, -SPEED) * delta;
}
if (Input.IsKeyPressed(Key.A))
{
Position += new Vector2(-SPEED, 0) * delta;
}
if (Input.IsKeyPressed(Key.S))
{
Position += new Vector2(0, SPEED) * delta;
}
if (Input.IsKeyPressed(Key.D))
{
Position += new Vector2(SPEED, 0) * delta;
}
}Editor is loading...
Leave a Comment