r/howdidtheycodeit • u/Masterofdos • Nov 29 '23
Answered How do they code collision/hit detection and elevation in 2D beat em ups
Apologies if lumping two questions together is an issue but I didn't want to make two posts for one and a half questions.
- First Question: Hit/Hurtboxes -
Since you can move in 6 directions in most beat-em-ups, you're basically moving in pseudo 3d space. So then, are hitboxes and hurtboxes designed the same as other games or are they made thinner due to the perspective


My assumption would be that walking up and down is done on the y axis and jumping uses something else like a "height" variable. So making boxes thinner would prevent wonky hit registration like getting clipped by someone on a different plane than you
- Second Question: elevation -
This is the main question. Some Beat em ups, like the river city games, have elevation, walls and platforms you can jump on and you can jump on some throw-able objects (boxes, trashcans). How does this work with the unique perspective and 6 direction movement. It feels like it should be more obvious but I'm stumped on how this works
View all comments
Show parent comment
2
u/RetroGamer2153 Dec 01 '23 edited Dec 01 '23
Since you are looking into making a brawler, here is a solid dev blog by Andrew Russel. (YouTube Channel)
He started Conatus Creative, and made River City Ransom: Underground. (If I remember correctly, after release, he was onboarded by WayForward.) He created an awesome Height Map system (including dynamic elements for Crates, etc.).
Edit: I did some digging. Here is another dev blog by Birp Studios (YouTube Channel). He made a clone of the NES RCR within Game Maker. He has a very thorough explanation of what and why for every variable, as well as a solid explanation of the Position.z + Position.y = Screen.y. (excuse the poor mic quality)