Let's Create Global Script called (stats.gd) first
1. Create the Script File
-Create File: Right-click the scripts folder ==> Create New ==> Script...
-Inherits: Node
-Path: Set path to res://scripts/stats.gd
-Click Create.
Let's Create Global Script called (stats.gd) first
1. Create the Script File
-Create File: Right-click the scripts folder ==> Create New ==> Script...
-Inherits: Node
-Path: Set path to res://scripts/stats.gd
-Click Create.
2. Register as a Global Script (Autoload)
-Open Project Settings: Click Project ==> Project Settings... in the top menu.
-Globals Tab: Select the Globals tab at the top of the window (and ensure Autoload is selected).
-Select Script: Click the folder icon next to Path, navigate to res://scripts/stats.gd, and select stats.gd.
Enable: Click Add to register it as a global script available across your entire project.
3. player container (Node2D)
-Right-click the root main node → Add Child Node...
-Select Node2D and rename it to player.
4. Player Body (CharacterBody2D)
-Right-click the top player (Node2D) node → Add Child Node...
-Select CharacterBody2D and rename it to player.
-Position: In the Inspector under Node2D → Transform, set Position to x: 554.0, y: 605.0.
5. Set Player sprite (Sprite2D)
-Right-click player (CharacterBody2D) → Add Child Node...Select Sprite2D.
-Texture: Drag player.png into the Texture slot (or click Texture → Quick Load and search player.png).
-Scale: In the Inspector under Node2D → Transform, set Scale to (x: 0.565, y:0.565).
Self Modulate: Under CanvasItem → Visibility
-click the color box and set R to 3.314, G to 7.349, and B to 8.944 (Color: Color(3.314, 7.349, 8.944)).
6. Player Collision (CollisionShape2D)
-Right-click player (CharacterBody2D) → Add Child Node...
-Select CollisionShape2D.
-Shape: In the Inspector, click <empty> next to Shape and choose New RectangleShape2D.
-Size: Click the newly created RectangleShape2D resource box to expand it, then set Size to x: 82.84, y: 31.435.
-main scene should look like the image on your right