I'm teaching Scratch to kids this summer at a Boys and Girls Club. I have two kids who have a basketball game with two players. I want to use one basket for two different scores (i.e. if one makes a basket he gets a point, if the other makes a basket he gets a point. I have it set up so that if one of the players touches the ball it throws the ball at an angle (not a jump shot). If the ball hits a dot on the basket, it increases the score. How do I do two different scores with two different players for one basket and not have the opposite players basket affect the opposite players score?
Offline
Make a variable that is set by whichever player last touched the ball. Then use an if/else when changing score based on that variable.
Offline
How do I do that?
Offline
For the Variable go into variables and Make Variable
Call It Player or something.
Then put a script on the ball saying something like Forever If Touching Player 1 Set Player (Your Variable) to 1.
Else If Touching Player 2 Set Player (Variable) to 2.
It'll be hard to say what to put on the basket sprite because i don't know how your scripting it.
Personally I'd use a broadcast.
So
When I recieve 'Score'
If Player (Variable) = 1
Change Score 1 by -number-
Else
Change Score 2 by -number-
That should do it.
I would put it into blocks but I have to rush this as i'm also working on my project XD
Good Luck!
~Buggy
Offline