Devlog - Ropes and Elevators


The latest game dev updates have taken quite a bit, but here we are.

Ropes

Rope Climbing is a feature previously exclusive to the GameBoy Castlevania titles that were an alternative to stairs. I featured it in the previous Beaumont Prototype, and now its back in the current version of the engine too.
The implementation is mostly the same, though slightly improved. There was a small issue in the old engine -- jumping from one rope to another will cause the player to land at a higher Y position than their jumping-off point on the previous rope. I've fixed it with a magic number, which I'm not particularly fond of. But it seems to work, maintaining the player's Y position.
If you're wondering what that giant diagonal line sticking out of Elayne's body is - its a line checking for collision with ropes, so the game knows if there's a rope to grab.
Player can move, jump, and quickly slide down...


Moving Platforms

I've added moving platforms - elevators that can move horizontally and vertically, carrying players across distances, providing another means to move across the game world.
Classic CV rarely use moving platforms, but when it does, they mostly move horizontally. Thus, I did not need to implement vertical moving platforms, but I really wanted that feature, which is why this mechanic took so long to code. The old engine actually has moving platforms, but they were constantly breaking, so I never used it in prior demos...
Glass shape is important. You can either go tall or wide, we call them vertis and horis (vertical or horizontal)
Programming this feature was a constant challenge, with the player often falling through the platform or getting stuck inside of it. Neither are things you want to happen while platforming.
When colliding with blocks via gravity, I am simply detecting the player's future position and stopping movement before collision so the player doesn't land inside of [o_solid]. But there is a wrinkle with this approach when colliding with the [o_solid_moving].
Moving Platforms ALSO move, so I must account for the platform's future location too. This is to prevent players from landing inside of a platform as it moves up while players move down. It's a relatively small difference, but this is the first time I've had to account for that.
I'm still not sure if I'm totally happy with it, but it works.


Room Editor Tools

Problem solving aside, this is a good opportunity to show off how my room editor tools work. 
A lot of my level kit is comprised of individual objects. Instead of handling everything through variable drop-down menus, objects are designed to detect one another on Creation and use that info to run specific blocks of code. 
For example:
  • Place Loot Object above Treasure Chest Object.
  • Save Loot Object ID to Treasure Chest during Create Event.
  • Destroy original Loot Object before players see anything.
  • Now the Chest will provide the Loot Object as a reward.

As a result, I can easily see how my level is supposed to work from a quick glance at the map. This was inspired by Mario Maker and online maps for retro games that show item locations.
In the case for moving platforms, there are only two objects:
  • Moving Platform, [o_solid_moving]
  • Moving Platform Point, [o_platform_point]

The Platform Points are two instances of a single object, and its identity as Point A or B is determined by the frame of its animation sequence when created. If image_index is 0, then it is A, otherwise it is B. I can simply change its current sprite / active frame in the room editor -- and everything will work as expected even if I drag the objects to different coordinates.
You can see this concept in action in this YT video by ItsHyomoto HERE.
Room Editor: Inspectors for Each Object


Duct Tape Solution

Despite the presumed success of my moving platform logic, players can still fall through the platform if their body is inside of [o_solid] due to a quick of my collision code turning the feet collision off under certain conditions.
To fix that, I've created collision lines below the player. If the player is falling, while inside of [o_solid], check for an instance of [o_solid_platform] below the player. If an legal instance is found, the player is then pushed out of the block. It is noticeable if you're paying attention, but I hope it won't be an issue.

The next goal on my agenda will probably be adding tiles that modify movement, like water & conveyor belts. I might let that wait until there are more "actor" objects, but we'll see.
Don't forget to eat & sleep.