You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-21 14:57:09 +00:00
C#: Renames to follow .NET naming conventions
Renamed C# types and members to use PascalCase and follow .NET naming conventions.
This commit is contained in:
@@ -17,22 +17,22 @@ public partial class _CLASS_ : _BASE_
|
||||
|
||||
// Add the gravity.
|
||||
if (!IsOnFloor())
|
||||
velocity.y += gravity * (float)delta;
|
||||
velocity.Y += gravity * (float)delta;
|
||||
|
||||
// Handle Jump.
|
||||
if (Input.IsActionJustPressed("ui_accept") && IsOnFloor())
|
||||
velocity.y = JumpVelocity;
|
||||
velocity.Y = JumpVelocity;
|
||||
|
||||
// Get the input direction and handle the movement/deceleration.
|
||||
// As good practice, you should replace UI actions with custom gameplay actions.
|
||||
Vector2 direction = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
|
||||
if (direction != Vector2.Zero)
|
||||
{
|
||||
velocity.x = direction.x * Speed;
|
||||
velocity.X = direction.X * Speed;
|
||||
}
|
||||
else
|
||||
{
|
||||
velocity.x = Mathf.MoveToward(Velocity.x, 0, Speed);
|
||||
velocity.X = Mathf.MoveToward(Velocity.X, 0, Speed);
|
||||
}
|
||||
|
||||
Velocity = velocity;
|
||||
|
||||
Reference in New Issue
Block a user