May 8th, 2023
This is a project that I've been slacking on for ages now, I decided to get back on it from scratch and actually write a devlog on it every once in a while and see if that motivates me enough to release it to the public when finished ๐ค๐ค
The Idea
I'm taking the core concept of flipping the room from "Shift", an old webgame developed by Antony Lavelle, and expanding on it in terms of game mechanics and level design.
I've started up with an empty Godot project and immediately started working on player movement and controls.
Player Movement
Using the very helpful template script that CharacterBody2D provides initially, I've expanded on it to add some variables that allow me to fine tune the movement to something that works for the game.
The movement logic looks like this, _handle_movement
function is called inside the _physics_process
callback, for the movement to actually happen, move_and_slide
is called at the end of _physics_process
.
And this is how it looks in game
Shifting Between Black & White
To achieve this, I made use of the physics layers that can be attached to each tile individually in Godot's tilesets.
I first added two physics layers with each one having a different collision layer, and each representing a different realm.
I can then switch the player to another realm (physically) by changing the collision_mask
between 1
and 2
.
As for the transition between black and white for the player, I used an AnimationPlayer
to animate the properties of two sprites carrying different colors and produce the following result.
After setting up the animation and the physics layer, all that's left is scripting the shifting logic by combining those two components together along with the offsetting actual position of the player (up or down).
What's Next?
Having the movement and realm shifting logic done is great, but that has always been the easy part for me (keep in mind that I've done this 3 times in the past already ๐ ๐ ).
The hard part for me is level design and keeping the game juice up while progressing in levels, although the core mechanic is still the same, I've got a few ideas that I'm going to share for feedback in future devlogs once I advance further in the development.
Thanks for taking the time, until the next log ๐ซก
Top comments (0)