Walk, jump, climb and punch!
With buildings that can be destroyed we need someone to actually destroy them, right?
Character's prototype code was heavily refactored to allow the Ape -our only character yet- to walk, jump, climb and punch. But what does this involve?
- Walking on the ground and on top of buildings.
- Climbing up a building, if its side is not behind another one.
- Once we reach the top, stop climbing and stand on the roof.
- When standing on the roof of a building, being able to climb down or jump.
- Jumping when the character is grounded.
- Jumping when the character is climbing.
- Landing on buildings.
- Registering punches on pieces of buildings that are not behind another building.
Walking is easy, as long as there's a reliable way to know if the character is grounded. In Rampaging, grounded includes the ground (easy, it's flat, so that's just a y-coordinate check), but also buildings' roofs. That involves character's x position and building's x, width and height.
Jump is as basic as it gets: press a button and set a vertical velocity. Always the same velocity, because this is not a platformer, after all. And once we are in the air gravity kicks in and we fall until we are grounded again or we grab a building to climb.
Now climbing is the tricky action, because it involves both being grounded and climbing up if we are properly aligned with a building, but also being on a roof and climbing down. That red line in the image shows the pivot point I use to check if the character is aligned, which also depends on the direction we are facing. Once we climb up to the top of a building the character is forced to jump a bit, so it lands on the roof.
The character stores the building it's climbing or standing on, which makes some checks way easier (see, the grey building is highlighted). That way, climbing down only needs to check if we are close enough to the edge of a roof. There's room for improvement here in relation to distances, but so far it works nicely.
Finally, punching basically requires checking on which building the punch lands and if the tile is actually visible. That way we can punch any building no matter if we are climbing, jumping or walking. Makes destruction easier!
I also added some particles here and there, some screen shacking if we land after a long fall, cracking buildings to warn they are about to collapse and three basic poses for walking, climbing and jumping/falling.
It almost looks like a game now!
Time to start working on the army!
Get Rampaging
Rampaging
Those cities won't flatten themselves!
Status | In development |
Author | PlayMedusa |
Genre | Action |
Tags | Arcade, classic, kaiju, Local multiplayer, Monsters, PICO-8, rampage |
Languages | English |
More posts
- Stomping! Now with source code.Mar 13, 2022
- Out of beta and release!Feb 22, 2022
- Playable beta ready!Feb 19, 2022
- Collapsing buildingsJan 15, 2022
- Procedural citiesJan 15, 2022
- Prototyping punchingJan 14, 2022
- Can you guess the game?Jan 13, 2022
Leave a comment
Log in with itch.io to leave a comment.