


Click on level1, and make sure you click the link button, not the add new node button: Now we need to add our player to the scene. There are different shape types, and you can even click and select for complex shapes, but we won't go into that now. What this means is: Godot now knows what the shape of our player is, and can track if it is colliding with the enemy, platforms etc. The next thing to do is zoom into our player, and make sure the whole CollisionShape covers it: Let's add a rectangle shape– its the simplest and work for us, as our character is roughly a rectangle: There is still a warning-the Collision Shape doesn't have a "shape" :) Make sure you have the player selected (and not Sprite), click add and add the CollisionShape2d node: So we need to define a shape– the shape will make sure Godot can check if the player collides with other objects. Godot is complaining there is no shape for our player. Now, there is a warning triangle next to our player node: Add the sprite, which should be in the code, to the Texture button on the right: Later on, we'll add an animated sprite (that'll show our player walking when we press left/right), but for now, we'll use a simple sprite.Ĭlick on the Sprite node you created.

The next thing to do is to add a sprite to our player. Save the file as player.tscn Adding the Sprite Make sure you choose KinematicBody2D, the blue one, as we are making a 2d game, and rename it to player. In the window that comes up, start typing "kine", and you will see the below:
#Godot engine tutorial plus
Now, in the scene window, click plus to add a node:

The advantage of having them as a scene is that you can mix the characters with different levels, for example, without having to create a new character each time. In Godot, a scene is not just the levels but can be things like characters, hazards etc. On the left, choose 2d scene and rename the scene to level 1 (by double clicking on it):Ĭlick the + at the top to add a new scene: For music nodes, you can select which file you want to play, etc. For example, if you create a player scene, you can choose the sprite here. The grey box below that is where you can see details of whatever item you chose. The yellow box on the top right allows you to play the game. While clicking on the script will take you to the code. Clicking on 2D (or 3D) will take you to the graphical part. To move between the graphics and code, the purple box above the blue tells you how.
#Godot engine tutorial code
Here you will see the levels you design visually, or the code you write. The big blue part in the middle is where the main game screen is. The green part below that is the local filesystem, and any files you need for your game, like graphics or sound, can be seen here. Scenes in Godot include levels, players, enemies etc anything you can code or design and the player interacts with. The red part on the top left part is where you can see the scenes in the game.
#Godot engine tutorial how to
Let me explain how the Godot UI works, so you know how to move around: Go here to download: Starting a simple Godot ProjectĬlick create. It starts up immediately, even on older machines and takes very little memory. I'm using Godot version 3.x for this tutorial.įor those who come from Unity, installing Godot is a walk in the park. In this post, we will start with a very basic Godot script, that will move a player left and right, add some gravity.Īll the code is here.
