🤖 2D Grid-Based Movement

2D Grid-Based Movement

Introduction In this tutorial, we are going to implement a “grid-based movement” system for a 2D game in Godot. It’s not overly complex. Some of you might be wondering, what exactly is grid-based movement? Grid-based movement is when objects, such as characters, move one grid (one tile) at a time on a game screen that is divided into evenly spaced grid lines. To give some examples, think of older games like the Fire Emblem series, Tactics Ogre, or various simulation games. Even RPGs like Final Fantasy and Dragon Quest during their 2D eras employed grid-based movement when it came to character movement on maps. Puzzle games like Tetris often use grid-based movement for the blocks or pieces as well. As you can see, grid-based movement is widely used across many genres of games, making it a highly versatile feature. Environment This tutorial was created under the following environment: Godot version: 4.3 Computer OS: macOS 14.6.1 By the way, the project I made can be found in this GitHub repository . Setting Up the Window After creating a new project in Godot, the first step is to adjust the project settings....

2024-09-06 · 8 min

🤖 Making a Tilemap with TileMapLayer

Creating a Tilemap with TileMapLayer

Introduction With Godot 4.3, the previously used TileMap class has been deprecated (meaning it won’t be updated anymore), and a new TileMapLayer class has been added in its place. So, I’m going to actually create a tilemap using TileMapLayer! My environment at the time of writing Godot version: 4.3 Computer model: MacBook Air M1, 2020 OS: macOS 14.6.1 Setting the Screen Size I’ll be using 16x16 px tile images this time, so I’ll make the Viewport small enough to fit the tiles neatly. After creating a new project, I went to Project Settings > General tab > Window and set the following: Size: Viewport Width: 256 Viewport Height: 160 Window Width Override: 1024 (4 times) Window Height Override: 640 (4 times) *Window Width Override and Window Height Override can be set after enabling Advanced Settings in the top right of the settings panel. Then I scrolled down a bit in the settings panel and set the stretch mode to viewport so that the game graphics scale to fit the window size. I left the aspect ratio as is. Stretch: Mode: viewport Aspect: keep (default) Scale: 1 (default) Scale Mode: fractional (default) Importing Assets for Tiles I downloaded the 1-Bit Pack from KENNEY ....

2024-08-23 · 5 min