AnswerBun.com

Coding Spelunky Edge Roll Mechanic

Game Development Asked by Austin Weaver on January 5, 2021

Inspired by the recently released Spelunky 2, I’ve been making Spelunky clone from scratch using Monogame for gamedev coding practice.

I’ve successfully coded the basic platforming mechanics: terrain collision solving, gravity, running and jumping, even having the camera pan up or down after pressing those buttons for a half-second.

The next thing I am trying to implement is edge-hanging. Getting the basic case of hanging after falling onto an edge in the right way was easy enough. I basically just checked for the right conditions and added a boolean in my player class for whether the player is hanging, which prevents left/right motion and keeps the player from falling when it’s true.

My question is: how can I implement the edge-rolling mechanism, where you can roll over edges into an edge-hang by pressing down as you walk off? I don’t understand what extra information I need to store or how to smoothly transition the player from being halfway on the edge to hanging off of the edge one block lower.

Right now the player just kind of falls away from the edge after walking off, as you would expect with the basic mechanics so far.

Any advice is appreciated! Thanks for your time.

Add your own answers!

Related Questions

Best way to save game data in Unity

1  Asked on February 28, 2021 by tair-galili

   

Unity – Sprite vertices in 3D world

1  Asked on February 24, 2021 by muckington

   

How to represent a modular FSM for AI using ECS?

2  Asked on February 22, 2021 by christian-ivicevic

       

get access to Transform of a Clone in Unity

1  Asked on February 21, 2021 by amin007

   

Box2d on authoritative server for Unity client

0  Asked on February 19, 2021 by antonio-agustin

         

How to Send Voice over Unity Networking – UNET

1  Asked on February 12, 2021 by muhammad-faizan-khan

         

Mathf.Clamp not Working Properly

1  Asked on February 3, 2021 by shubhendra-chaddha

   

SetTrigger Only Works In Start and Not OnTriggerEnter

1  Asked on February 3, 2021 by kit-k

       

How do I detect image clicks in Dark GDK?

1  Asked on February 2, 2021 by bobman

   

FIx color banding in unity

0  Asked on February 1, 2021

 

OnMouseOver not registering collisions

3  Asked on January 29, 2021 by hyperific

   

Call native code from Unity iOS build error

1  Asked on January 29, 2021 by atlantis

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir