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

#1 2011-01-01 14:31:27

Robot_Maniac
Scratcher
Registered: 2010-11-22
Posts: 56

Help!!!

I'm trying to make a paddle game but whenever I try hitting the ball, it just goes right through the paddle! This is my script for the ball, if that will help you.

[blocks]<when green flag clicked>
<forever if>touching Computer?
<point in direction( 90-direction)
<move( 7 )steps>
<turn (pick random -20- 20  )degrees>
<end>
[/blocks]

The Player is the same.


Math Trick of the Week: Choose any three digit number that's one digit is at least 2 less that the tens digit and the tens digit at least 2 less than the hundreds. Then, reverse the digits and subtract. Then, reverse the digits in the answer and add. You should get 1089.

Offline

 

#2 2011-01-01 15:00:05

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

Re: Help!!!

Try instead of a <forever if> block, a <forever> and an <if> block.


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

Offline

 

#3 2011-01-02 16:15:21

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Help!!!

I think that 90-direction should be direction*-1 (assuming it is left to right and not top to bottom pong).  I don't think that'll fix it though... The script I use is:

<when green flag clicked>
<forever>
<if><< <touching[ paddle1 ]> <or> <touching[ paddle2 ]> >>
<point towards( (( <direction> <*> -1 ))>
<end>
<if><< <touching[ upperedge ]> <or> <touching[ loweredge ]> >>
<point in direction( (direction *(180-abs of (direction)))/abs of (direction) )>
<end>
<move( 2 )steps>


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

#4 2011-01-02 17:15:55

Robot_Maniac
Scratcher
Registered: 2010-11-22
Posts: 56

Re: Help!!!

MoreGamesNow wrote:

I think that 90-direction should be direction*-1 (assuming it is left to right and not top to bottom pong).  I don't think that'll fix it though... The script I use is:

<when green flag clicked>
<forever>
<if><< <touching[ paddle1 ]> <or> <touching[ paddle2 ]> >>
<point towards( (( <direction> <*> -1 ))>
<end>
<if><< <touching[ upperedge ]> <or> <touching[ loweredge ]> >>
<point in direction( (direction *(180-abs of (direction)))/abs of (direction) )>
<end>
<move( 2 )steps>

Wait there's a block called upperedge or loweredge


Math Trick of the Week: Choose any three digit number that's one digit is at least 2 less that the tens digit and the tens digit at least 2 less than the hundreds. Then, reverse the digits and subtract. Then, reverse the digits in the answer and add. You should get 1089.

Offline

 

#5 2011-01-02 18:04:31

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: Help!!!

Robot_Maniac wrote:

MoreGamesNow wrote:

I think that 90-direction should be direction*-1 (assuming it is left to right and not top to bottom pong).  I don't think that'll fix it though... The script I use is:

[blocks]
<when green flag clicked>
<forever>
<if><< <touching[ paddle1 ]> <or> <touching[ paddle2 ]> >>
<point towards( (( <direction> <*> -1 ))>
<end>
<if><< <touching[ upperedge ]> <or> <touching[ loweredge ]> >>
<point in direction( (direction *(180-abs of (direction)))/abs of (direction) )>
<end>
<move( 2 )steps>
[/blocks]

Wait there's a block called upperedge or loweredge

He's talking about the upper/lower edge sprites. Just use whatever you called them.


http://www.blocks.scratchr.org/API.php?action=random&amp;return=image&amp;link1=http://i.imgur.com/OZn2RD3.png&amp;link2=http://i.imgur.com/duzaGTB.png&amp;link3=http://i.imgur.com/CrDGvvZ.png&amp;link4=http://i.imgur.com/POEpQyZ.png&amp;link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

#6 2011-01-05 16:47:14

MoreGamesNow
Scratcher
Registered: 2009-10-12
Posts: 1000+

Re: Help!!!

Thanks for clarifying Harakou  big_smile


http://images2.layoutsparks.com/1/218929/rubiks-cube-animated-rotating.gif
"Cogito ergo sum" --  I think, therefore I am

Offline

 

Board footer