Browse Source

fix(#6539) Update C# documentation for Godot 4 (#6548)

* fix(#6539) Update C# documentation for Godot 4
Josh Creek 2 years ago
parent
commit
fbf70a7c6b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      getting_started/first_2d_game/03.coding_the_player.rst

+ 3 - 3
getting_started/first_2d_game/03.coding_the_player.rst

@@ -38,7 +38,7 @@ Start by declaring the member variables this object will need:
     using Godot;
     using System;
 
-    public class Player : Area2D
+    public partial class Player : Area2D
     {
         [Export]
         public int Speed = 400; // How fast the player will move (pixels/sec).
@@ -195,7 +195,7 @@ which returns ``true`` if it's pressed or ``false`` if it isn't.
 
  .. code-tab:: csharp
 
-    public override void _Process(float delta)
+    public override void _Process(double delta)
     {
         var velocity = Vector2.Zero; // The player's movement vector.
 
@@ -290,7 +290,7 @@ the ``_process`` function (make sure it's not indented under the `else`):
 
  .. code-tab:: csharp
 
-        Position += velocity * delta;
+        Position += velocity * (float)delta;
         Position = new Vector2(
             x: Mathf.Clamp(Position.x, 0, ScreenSize.x),
             y: Mathf.Clamp(Position.y, 0, ScreenSize.y)