Setting up the game area

In this first part, we’re going to set up the game area. Let’s get started by importing the start assets and setting up the game scene. Squash the Creeps assets. Import button. squash_the_creeps_start/. You can click the Browse button on the right to open a file browser and navigate to the project.godot file the folder contains. Import & Edit to open the project in the editor. art/ and fonts/. There, you will find the art assets and music we’ll use in the game. player.glb and mob.glb, some materials that belong to these models, and a music track.

Setting up the playable area

Node as its root. In the Scene dock, click the Add Node button represented by a “+” icon in the top-left and double-click on Node. Name the node “Main”. Alternatively, to add a node to the scene, you can press Ctrl + a (or Cmd + a on macOS). Main.tscn by pressing Ctrl + s (Cmd + s on macOS). StaticBody nodes. They require CollisionShape child nodes to define the collision area. With the Main node selected, add a StaticBody node, then a CollisionShape. Rename the StaticBody as Ground. CollisionShape appears because we haven’t defined its shape. If you click the icon, a popup appears to give you more information. CollisionShape selected, head to the Inspector and click the [empty] field next to the Shape property. Create a new Box Shape. The box shape is perfect for flat ground and walls. Its thickness makes it reliable to block even fast-moving objects. BoxShape to expand the resource. Set its Extents to 30 on the X axis, 1 for the Y axis, and 30 for the Z axis. Note 60 by 60 meters on the ground plane and 2 units tall. The ground plane is defined by the X and Z axes, while the Y axis represents the height. Ground node and add a MeshInstance as its child. Inspector, click on the field next to Mesh and create a CubeMesh resource to create a visible cube. Size to 60, 2, and 60. As the cube resource works with a size rather than extents, we need to use these values so it matches our collision shape. You should see a wide grey slab that covers the grid and blue and red axes in the viewport. Ground node, hold the Ctrl key down to turn on grid snapping (Cmd on macOS), and click and drag down on the Y axis. It’s the green arrow in the move gizmo. Note Select Mode is active in the toolbar above the view. 1 meter. A label in the bottom-left corner of the viewport tells you how much you’re translating the node. Note Ground node down moves both children along with it. Ensure you move the Ground node, not the MeshInstance or the CollisionShape. Main node and add a DirectionalLight as a child of it. We need to move it and rotate it. Move it up by clicking and dragging on the manipulator’s green arrow and click and drag on the red arc to rotate it around the X axis, until the ground is lit. Inspector, turn on Shadow -> Enabled by clicking the checkbox. At this point, your project should look like this. That’s our starting point. In the next part, we will work on the player scene and base movement.