icon

The (second) monster

A remake of The First Monster.

Devlog #1

Notice: this is my first devlog, and it's not great. But I hope you enjoy it nonetheless.

I restarted the project from scratch to start on solid grounds (compared to the spaghetti that is the original).

This was also an opportunity to remake the project in C#. I originally made the game in GDScript because, as of now, Godot C# cannot be built for the web. And I thought that people where more likely to try the game out if it was playable in the browser.

I've also started implementing a feature I originally wanted. For the character to also loop around the screen, just like the projectiles do.

But due to how I originally implemented the "looping around" logic (just a simple teleportation when out of the viewport bounds), it was difficult to apply it for the player.

Since the bullet move (somewhat) fast, I simply moved the teleport trigger slightly out of bounds, which makes the teleportation seamless at first glance.

However, that does not work as well for the player for the following reasons: The player sprite is much bigger, and slower, than a bullet. The trick of teleporting a little bit off camera does not work, as that means there is a region where the player is completely hidden offscreen.

What I wanted was a seamless transition, much closer to stepping through a portal. Right now the player would just go slightly offscreen and visibly teleport.

A solution to that was to add a "Ghost" of the player on the other side of the screen. It would copy the rotation and movement of the real player, giving the illusion that the movement is seamless.

Once the player would fully go through, it would be teleported to the ghost position, and the ghost would be deleted.

Which is perfect in practice, as in reality another issue arise.


In the game, the player always rotates to look directly at the cursor position. But what happens when the player is halfway going through the screen?

The player will look at the cursor, while the ghost just copies the movement, that's fine so far. But once the player fully goes through, it suddenly goes from looking left, to looking right. (If we imagine it goes from the right edge to the left edge).

There's no way to fix this, the player will always suddenly snap its rotation.

Which is why I dropped the idea in the first place.


For the remake, the camera is directly following the player's position, so the "snap to look at the cursor issue" is gone. But now we have to visually trick the player into thinking the room is infinitely repeating.

It is done by a few things:

  1. Create ghost rooms in all direction
  2. Teleport any entity that attempts to leave the room to the opposide side of the room
  3. Create ghosts of entities in all the different rooms

That creates the illusion of seamless, infinite rooms.

You can see it in action right below.

The player and the bullets seamlessly get teleported, and the ghosts give the illusion of a repeating room