After my presentation on Monday of my game Pusher, I wanted to try and recreate the movement in Godot while using my existing rhythm system as a base.
Grid System
Firstly I had to get grid-based movement working in Godot. I used the following video as a basis to get it working:
This was extremely simple but it was more than good enough for a prototype. I then also added a tween to make the player’s movement more satisfying between grid spaces:

I also added a Camera node that follows the player automatically with some inertia, making the play space feel fully open.
Rhythmic Movement
Movement was now feeling very satisfying but it now needed to be synced with the rhythm. To do this I needed to know what the most recently pressed direction key is and move the player in that direction on every beat. To do that I added the following code which essentially pushes the most recently pressed key to the front of the “queue” or list of held inputs:

Then on every beat I run the move code and feed in that direction.

I also added a “buffered move” which can store a move to be played on the next beat if the player is already moving when the button is first pressed, reducing frustration when the player barely misses their window to move:

Now when holding the movement keys the player moves on every beat:
Attracting a Crowd
After this I then wanted to add the “crowds” which follow the player. These were quite simple to add as I could make Rigidbody2D (or physics object) nodes in the game scene with scripts to make them get the players position and move themselves towards that every frame if they’re close enough:

This worked as expected and they now surround the player and can be pushed by them:


Leave a Reply