Hi,
so here is my game : http://scratch.mit.edu/projects/Sn33ze/2327247
I need help on the bricks. How do i make it that when the ball hits a brick it dissappears and goes back towards to the player? and also after someone scores, how do i set it all back to normal so that the bricks reappear again? May i get some help?
oh, and also how do i make it when the ball hits a "blue brick" it makes the speed of the ball slower, orange = faster, and pink 3x faster?
Thank you and appreciate it much!
Offline
I think the easiest way to do this is to use broadcasts.
Sn33ze wrote:
I need help on the bricks. How do i make it that when the ball hits a brick it dissappears and goes back towards to the player?
Sn33ze wrote:
oh, and also how do i make it when the ball hits a "blue brick" it makes the speed of the ball slower, orange = faster, and pink 3x faster?
First, put this script in all the blue bricks:
when gf clicked forever if <touching [Ball v]?> hide broadcast [Ball bounce v] if <(Ball Speed) > (1)> //We don't want the ball to stop. :) change [Ball Speed v] by (-1) end end if <touching [Ball 2 v]?> hide broadcast [Ball 2 bounce v] if <(Ball Speed) > (1)> change [Ball Speed v] by (-1) end endThen, put this in the orange bricks:
when gf clicked forever if <touching [Ball v]?> hide broadcast [Ball bounce v] change [Ball Speed v] by (1) end if <touching [Ball 2 v]?> hide broadcast [Ball 2 bounce v] change [Ball Speed v] by (1) endAfter that, put this script in the pink bricks:
when gf clicked forever if <touching [Ball v]?> hide broadcast [Ball bounce v] set [Ball Speed v] to ((Ball Speed) * (2)) end if <touching [Ball 2 v]?> hide broadcast [Ball 2 bounce v] set [Ball Speed v] to ((Ball Speed) * (2)) endThen, put this script in Ball:
when i receive [Ball bounce v] point in direction ((direction) - ((180) + (pick random (-20) to (20)))) move (4) stepsAnd in Ball 2:
when i receive [Ball 2 bounce v] point in direction ((direction) - ((180) + (pick random (-20) to (20)))) move (4) steps
Sn33ze wrote:
and also after someone scores, how do i set it all back to normal so that the bricks reappear again? May i get some help?
First, change the scripts in Ball and Ball 2 so that it looks like this:
...
if <touching [Goal v]?> change [Green's score v] by (1) go to x: (-146) y: (5) change [Ball Speed v] by (1) broadcast [show bricks v] //Add this. wait (3) secs point in direction (pick random (0) to (359)) end if <touching [Goal2 v]?> change [Red's score v] by (1) go to x: (-146) y: (5) change [Ball Speed v] by (1) broadcast [show bricks v] //Add this. wait (3) secs point in direction (pick random (0) to (359)) endThen, add this to all the bricks (Sprite1 to Sprite 37):
when i receive [show bricks v] showThis should work if I didn't make any mistakes.
Offline
Everything seems to be working but just 3 things, whenever the game is done and i click on play(green flag) the bricks are still missing and it is playing on the "whoever won background" how do i reset this? and when someone scores how do i make it that both the balls reset in their place and wait 3 seconds? lastly, after someone scores the balls still have the attributes of hitting the bricks from the previous run, how do i reset it?
Thank you
here is my currently updated one : http://scratch.mit.edu/projects/Sn33ze/2327247
Offline
Sn33ze wrote:
Everything seems to be working but just 3 things, whenever the game is done and i click on play(green flag) the bricks are still missing and it is playing on the "whoever won background" how do i reset this? and when someone scores how do i make it that both the balls reset in their place and wait 3 seconds? lastly, after someone scores the balls still have the attributes of hitting the bricks from the previous run, how do i reset it?
Thank you
here is my currently updated one : http://scratch.mit.edu/projects/Sn33ze/2327247
when green flag clicked set [red score v] to (0) set [blue score v] to (0) switch to background [normal v] broadcast [show blocks v] broadcast [reset balls v] //in each of the ball's script: when i receive [reset balls v] go to x:(whatever) y:(whatever) wait (3) secs put the rest of the script here
Last edited by joefarebrother (2012-02-13 16:41:57)
Offline