Grid based Movement in Godot for both Platformer and Top-Down Games! I used these scripts to make my 8x8 platformer game, but it also has an option for Top-Down movement.
Here's some examples of what you can make with it:
Also a game I made with it: https://sventomasek.itch.io/64-pixels- Place the scripts in your Godot project
- Make sure your TileMap node is called "TileMap"
- Right click on your TileMap node and select "Access as Unique Name"
- On your TileSet in the Inspector add a Custom Data Layer "walkable" type bool
- Now every tile you place should act as a wall by default, if you want some to not you will need to go to your TileSet and set Custom Data "walkable" to true on each one
- Add the Player.gd script to your Player Node
- Configure the settings to your liking (especially the Keybinds section!)
- Play
- Add the Enemy.gd script to your Enemy Node
- Right click on your Player node and select "Access as Unique Name" (needs to be named "Player")
- Configure the settings to your liking
- Play
- Add your Player Node to a group called "Player" and enemies to a group called "Enemy"
- Add an Area2D with a CollisionShape2D
- Add the GravityInverser.gd script to it
- Connect the on_body_entered signal of Area2D to itself
- Configure the settings to your liking
- Now when the player or an enemy touch it they will fall in the opposite direction!

