Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Bouncing?
- RichardStarbright
- Scratcher
38 posts
Bouncing?
How do I make things bounce (like the ball in pong) without using “easy way out” blocks like
Any help?
turn cw (pick random (some number) to (some number)) degreesor
if on edge, bounce
Any help?
- Diamond_Projects
- Scratcher
100+ posts
Bouncing?
if <touching [thing v] ?> then(Credit to @DevanWolf)
turn cw (90) degrees
move (10) steps
if <touching [thing v] ?> then
turn cw (180) degrees
repeat until <not <touching [thing v] ?>>
move (10) steps
end
end
end
Last edited by Diamond_Projects (Sept. 21, 2014 01:25:56)
- RichardStarbright
- Scratcher
38 posts
Bouncing?
if <touching [thing v] ?> then(Credit to @DevanWolf)
turn cw (90) degrees
move (10) steps
if <touching [thing v] ?> then
turn cw (180) degrees
repeat until <not <touching [thing v] ?>>
move (10) steps
end
end
end
The thing is, I appreciate the work, but you guys are kinda killing the point.
My point is: Is there any easy way to calculate an angle, and then from there, “bounce” (AKA adjust the angle and where its supposed to go)?
- wkelly42
- Scratcher
100+ posts
Bouncing?
A simple way is to do it like I did in this script -> http://scratch.mit.edu/projects/25898438/
BUT there are problems with that. The angles are always the same - there needs to be a way to change the ball's direction slightly by moving the paddle. I'm currently working on that.
There was another thread on here talking about that that had a GREAT answer that I haven't had time to try to implement –> http://scratch.mit.edu/discuss/topic/50111/
BUT there are problems with that. The angles are always the same - there needs to be a way to change the ball's direction slightly by moving the paddle. I'm currently working on that.
There was another thread on here talking about that that had a GREAT answer that I haven't had time to try to implement –> http://scratch.mit.edu/discuss/topic/50111/
My Retro Arcade:
COMPLETED: Frogger, Missile Command, Computer Space.
IN DEVELOPMENT: Barnstorming, Time Pilot, Defender, River Raid, Karateka
- Discussion Forums
- » Help with Scripts
- » Bouncing?