Gravity

user_icon momgeek shared it 1 year ago
95 views, 1 tagger, 7 downloads, in 1 gallery
Add to my favorites?
Flag as inappropriate?

Comments

You need to be logged in to post comments

Add a Comment

journogeek journogeek 11 months ago

I ran into this problem. Thanks for the perspective on it/

(view all replies)
Comment Reply

BATzerk BATzerk 1 year ago

What this will do is set his y velocity to 0 when he hits the ceiling. You could also make him bounce back down by multiplying his y velocity by -1. You could even substitute the "y position > 179" term with "if [touching edge]"... however, I only recommend this if you don't plan on adding any x movement to Mr. Scratch cat. (Hope this was helpful!)

(view all replies)
Comment Reply

BATzerk BATzerk 1 year ago

Well, Professor Wolz, it seems as if the program isn't doing what you didn't ask it to do. The Scratch cat has no idea there's a ceiling! He leaves the screen until his y velocity eventually reaches 0, at which point he's free to fall back down. According to your program, the Scratch cat is SUPPOSED to stay up at the ceiling; the returning speed is in fact completely accurate! ...Now. If you'd like him to stop when he hits the ceiling, I recommend putting in something along the lines of... "[FOREVER [IF [y position > 179] SET y velocity to 0] [WAIT UNTIL [y position < 179]]]"

(view all replies)
Comment Reply