Ok, I have created a 2 player simple pong game with a score for each team. When the ball hits opponents dead area your score increases by 1. Now my problem is the game goes on forever.
So as i learned in the simple pong game i can create a sprite which displays game over using a broadcast.
What i want to do is when one teams score reaches 10 or 20 a sprite appears saying that team has won. e.g. green team gets 10 and a sprite appears saying green team wins.
i've been looking at if statements and variables but cant seem to do it. please help.
thanks
Offline
use the same "game over" technique you've used before but have two costumes on the "game over" sprite - one saying "red team wins" the other says "green team wins" - switch to the correct costume before showing the sprite - simple
Offline
dibbotson wrote:
Ok, I have created a 2 player simple pong game with a score for each team. When the ball hits opponents dead area your score increases by 1. Now my problem is the game goes on forever.
So as i learned in the simple pong game i can create a sprite which displays game over using a broadcast.
What i want to do is when one teams score reaches 10 or 20 a sprite appears saying that team has won. e.g. green team gets 10 and a sprite appears saying green team wins.
i've been looking at if statements and variables but cant seem to do it. please help.
thanks
<when green flag clicked>
<forever>
<if><( <{ Player 1 score }> <>> 10 )>
<broadcast[ Player 1 win
<when I receive[ Player 1 win
<switch to costume[ P1 Wins
And the same for player 2.
Last edited by shadow_7283 (2011-02-17 17:14:10)
Offline
rantg wrote:
[blocks]or you could use a variable for pointshttp://scratch.mit.edu/forums/viewtopic.php?id=56743#req_message[/blocks
That's what he or she is doing...
Offline