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

#1 2012-03-19 15:00:06

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Why isn't it working? :/

Okay... I'm making a 1s1s pong game. The way it works is that it switches to the ball costume, moves, stores the ball's coordinates and direction with variables, stamps, switches to the paddle costume, moves (if the arrow keys are held down), stores the paddle's coordinates with variables, stamps, and basically keeps going like that. I'm having trouble making the ball collide with the paddle though :l

Here's the script I have;
http://i44.tinypic.com/2mctvg4.png
(It just about fitted  tongue )
I just can't understand why it won't work. The ball just goes straight through the paddle  sad

Also, the "point towards x: [ ] y: [ ]" block is a custom block. I won't have that block in the final version, I'll use a workaround, but I'm too lazy to change it right now ^^ I know that that's not the problem, either, before you assume it's something to do with that.

A little help?

(BTW, I've also uploaded the project here, although unless you also have the custom block installed, it'll show as obsolete. [And yes I know custom blocks don't work online, I've only uploaded it so you can download it if you want])

Last edited by RedRocker227 (2012-03-19 15:03:40)


Why

Offline

 

#2 2012-03-19 15:05:52

rdococ
Scratcher
Registered: 2009-10-11
Posts: 1000+

Re: Why isn't it working? :/

It appears to look like you clear the stage before the ball has the chance to detect collision, causing it to not realize there is a paddle there and the ball must bounce.

Offline

 

#3 2012-03-19 15:07:38

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Why isn't it working? :/

rdococ wrote:

It appears to look like you clear the stage before the ball has the chance to detect collision, causing it to not realize there is a paddle there and the ball must bounce.

Oh my gosh YES  big_smile

Sorry, I'm just a little excited, because I've been trying to fix it for ages  tongue  Thanks so much ^^

(I'm kinda embarassed I didn't realise that though...)


Why

Offline

 

#4 2012-03-19 15:09:15

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: Why isn't it working? :/

Yay, I've just tested it and it works ^^

I'll make sure I give you credit  smile


Why

Offline

 

#5 2012-03-19 15:31:17

Paddle2See
Scratch Team
Registered: 2007-10-27
Posts: 1000+

Re: Why isn't it working? :/

Closed by request of the topic owner.


http://i39.tinypic.com/2nav6o7.gif

Offline

 

Board footer