Pages: 1
Topic closed
Currently, I've gotten this far. http://scratch.mit.edu/projects/mrwalker81/2190463
The ball bounces fairly accurately, taking into consideration gravity, momentum, and efficiency. My problem thus far is that when it bounces off of an object, it passes partially through it. This causes all sorts of problems.
My initial thought is that the broadcast and wait which is needed for passing the downward velocity variable, but I can't seem to get it working properly.
Offline
I think it's the 'Wait 0.06 secs' in the else bit of the 'If touching colour blue'. Basically, this means that if it's not touching blue, it will only check if it is again after 0.06 seconds, meaning there'll be some delay. This can easily be worked around by simply putting the 'Change y by dnvelo' in the same forever.
Also, instead of broadcasting bounce, and then making another scripts for when the broadcast is received, why not just replace the broadcast with the set variable, because that broadcast is taking up time as well.
I'll just take a screenshot to show you what the new script should be...
EDIT: I've got the picture:
Of course, this makes it a bit messy-looking as if it's not touching blue it only moves every 0.06 seconds, but I couldn't figure out how to change that, mainly because I didn't understand your other scripts.
Last edited by RedRocker227 (2011-12-02 10:51:12)
Offline
ahh.. you were correct, there was some delay coming from the broadcast event, switching it up to match with yours gave it less delay, and a quicker reaction to hitting blue.
Just about got it. Changed what you were talking about, and moved the incrementing timer to a separate script, didn't keep the if part waiting on the else part. Thanks a ton!
Offline
Glad I could help!
Offline
i Have a few ideas, when it hits the floor, u could have a continouse bounce, and press up to make it bounce up?
Offline
Thanks tb, I like the idea. That would work. I hadn't thought to thoroughly yet about where to take the idea, although my initial thought was to make the floor an obstacle that took away a life. Perhaps make it a bit of a strategy game of bouncing off of various obstacles to get to a particular target.
Offline
Topic closed
Pages: 1