Jump to content
  • Advertisement
Sign in to follow this  
GroZZleR

Brawler - Depth & Jumping

This topic is 3991 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey all, I'm working on a Brawler (Final Fight, River City Ransom, et al.) and am a little curious about the best way to implement jumping. Here's the idea I've come up with: X,Y store the player's position relative to the ground. Height store's the player's position in the air relative to their spot in the ground. The higher the value, the higher you are in a jump. Rendering is simply draw at (X, Y - Height). Collision checks can be done with an X,Y box check then a Height check. Here's a picture describing what I mean: Does this seem like a good way to go about it? It's the first idea that popped into my head and am wondering if there are more efficient manners. Thanks all.

Share this post


Link to post
Share on other sites
Advertisement
Yes, this is a good way to go about this. Basically your characters will have their position described 3 dimensionally. The only complication is that you're rendering an isometric projection of the scene by drawing 2d sprites, so the height is drawn by altering the y value used to draw the sprite.

Really the way to combine the y value and the height might not be to just add them together, but rather to combine them depending on the camera angle. If the camera was parallel with the ground, the rendering point would only depend on the height. If the camera was pointing straight down, the rendering point would only depend on the y value. If 0 degrees is taken to be parallel to the ground, the actual formula would be sin(angle)*y + cos(angle)*height. But feel free to ignore this entire paragraph as I'm just getting carried away.

Oh, and the shadow will have to be separated from the character.

Share this post


Link to post
Share on other sites
Yeah, that should work.

I would draw the shadow as a separate sprite though. Like when you draw the character at x,y,z, just draw the shadow at x,y,0.

Out of curiosities sake, is that a sprite for your game, or is it a rip from like Samurai Showdown or something?

Share this post


Link to post
Share on other sites
Aye... I've got like an x,y,z parameters for my guys and if z-height does not equal "ground" then there is a shadow to draw. The various maps I got have a groundAt(x,y) inquiry method to detect something like this.

It will also possibly also help if you got slanted or multileveled grounds to work with. If you got one level of ground then you don't really need to do this.

Share this post


Link to post
Share on other sites
Scaling down the shadow (smaller as the character jumps higher) will help with depth perception, too.

Share this post


Link to post
Share on other sites
Quote:
Original post by Oluseyi
Scaling down the shadow (smaller as the character jumps higher) will help with depth perception, too.

Keeping it on the ground is important, too.

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnBolton
Quote:
Original post by Oluseyi
Scaling down the shadow (smaller as the character jumps higher) will help with depth perception, too.

Keeping it on the ground is important, too.

Yes. Unless you're jumping over an obstacle, in which case it should be on the obstacle (and the scaling reduced proportional to the height of the obstacle).

Share this post


Link to post
Share on other sites
Thanks all.

The sprite is from Kagetsura from Sengoku 3. The shadow is drawn as part of the sprite and I didn't feel like removing it for prototyping.

Good idea on scaling the shadow based on the height. That should definitely help.

Rate++ all around.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!