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

#1 2012-02-28 05:19:38

Nicola_Envy_Mc
New Scratcher
Registered: 2012-01-16
Posts: 1

Help with Pong

When the player one or player two's score reaches 5 in my pong game, it changes to a page Congradulating the player (the background is called C for player 1 winner and C2 for player 2 winner). When the screen changes to one of these backgrounds, I want to hide the ping pong paddles and the ball. I don't know how to do this.

Also I want the music that starts at the beginning og level one to stop.

Can someone help me please?

Offline

 

#2 2012-02-28 07:40:29

laptop97_test
Scratcher
Registered: 2011-10-23
Posts: 10

Re: Help with Pong

For the Stage script:

when gf clicked
wait until <<(p1score)=(5)> or <(p2score)=(5)>
stop all sounds
if <(p1score)=(5)>
  go to background [C v]
end
if <(p2score)=(5)>
  go to background [C2 v]
end
broadcast [score 5 v]
Paddle 1 Script:

when i recieve [score 5 v]
hide
Paddle 2 Script:

when i recieve [score 5 v]
hide
Ball Script:

when I recieve [score 5 v]
hide
Sorry about the red, but those are the block names  hmm

Last edited by laptop97_test (2012-02-28 07:42:37)

Offline

 

#3 2012-02-28 10:34:18

Smozzick
Scratcher
Registered: 2011-10-23
Posts: 100+

Re: Help with Pong

laptop's code is correct though the red blocks are actually this block:

when I receive [score 5 v]
@ laptop - i before e except after c; you spelt receive as recieve


http://i50.tinypic.com/ded8m.png

Offline

 

#4 2012-02-28 15:44:42

EternityFlare
New Scratcher
Registered: 2012-02-27
Posts: 23

Re: Help with Pong

Make the points a variable than say:

when gf clicked
forever
if <{points as a variable}><=>(5)
<broadcast[congrats]>
end
end
Then on all the things you want to hide you put:

<when i receive[congrats]>
<hide>
Sry if the scratch blocks dont work (probably dont  hmm

Offline

 

Board footer