Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


America Freeman

Member Since 02 Mar 2012
Offline Last Active Jan 14 2014 02:11 PM

Posts I've Made

In Topic: Is hacky code allowed in industry?

08 November 2013 - 09:51 AM

I have seen something similar to what you are referring to as a "hack" many times in the software development industry. I am not sure if this is the official name for it, but at my job we refer to it as a "latch". It is usually used to stop normal functionality when the form "IsLoading" or something of the sort.

In Topic: How can I get my character to come back down even if the user still has the b...

11 December 2012 - 01:28 PM


Or just set up the thing so the player can't jump if the character isn't on the ground.

This is the correct solution. Really, all jumping is, is applying a downward force to the ground, which applies an upward force to us and lifts us up in the air against gravity. If we're not in contact with the ground, we can't jump and gravity pulls us back down with no force to push us back up.

If he was going for realistic physics, yes, but it sounds like he wanted jumping to work where the longer you held down the jump key, the higher you jump. It's the kind of jumping you see in many platformers.

And my mistake, Mister Fuzzy's correction of swapping when the key is released is the correct way to go.

In Topic: How can I get my character to come back down even if the user still has the b...

10 December 2012 - 03:09 PM

You could create a bool where jumping only works if it's false. Set it to true once they reach the 50 pixel limit, and then reset it back to false when they're touching the ground again. Does that make sense?

PARTNERS