This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-09-03 04:03:09

RepInt
New Scratcher
Registered: 2012-09-03
Posts: 2

PONG Assistance

The problem here is not collision or movement of paddles...its the angle of the ball when it collides with either of the paddle sprites. I've worked out some temporary math using various x and y vals, but I need a permanent solution to work with both paddles. I also need a sort of "inverted" solution to use with the top and bottom border sprites for collision.
I suck at math, soooo...Doing this at 4:00 probably doesn't help, though...


Anyone good at math? I don't think its really that hard to do from a mathematical standpoint, but I just can't seem to stay focused long enough or wrap my head around whats going on in order to fix the issues.

PLEASE, somebody help!

Offline

 

#2 2012-09-03 09:28:46

AtomicBawm3
Scratcher
Registered: 2009-06-27
Posts: 1000+

Re: PONG Assistance

It depends...is the ball moving with direction and speed or with x and y values?


http://i50.tinypic.com/j0yw0p.jpg

Offline

 

#3 2012-09-03 09:52:50

BirdByte
Scratcher
Registered: 2012-07-07
Posts: 1000+

Re: PONG Assistance

Yeah, I wanna know what AB3 wants to know.

Last edited by BirdByte (2012-09-03 09:54:31)


http://i50.tinypic.com/312u714.jpg

Offline

 

#4 2012-09-03 16:50:10

RepInt
New Scratcher
Registered: 2012-09-03
Posts: 2

Re: PONG Assistance

X and Y's. It's painful.

Offline

 

#5 2012-09-03 23:36:40

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: PONG Assistance

If you're using x- and y-velocity, just flip (multiply by -1) the x-velocity if it hits a vertical surface (a wall; left or right of screen) or the y-velocity if it hits a horizontal surface (ceiling or floor; top or bottom of screen).  That'll simulate bouncing.

Offline

 

#6 2012-09-07 16:22:22

Neomonic
New Scratcher
Registered: 2012-08-26
Posts: 1

Re: PONG Assistance

Pong Huh?

Very good game ever tried making it in JS?
easy obn scratch thought

Offline

 

Board footer