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

#1 2012-02-11 20:50:03

Sn33ze
New Scratcher
Registered: 2012-01-26
Posts: 9

Help with brickbreaker variant!

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

 

#2 2012-02-12 00:45:01

Sn33ze
New Scratcher
Registered: 2012-01-26
Posts: 9

Re: Help with brickbreaker variant!

can anyone help?  hmm

Offline

 

#3 2012-02-12 02:08:29

mattlai2
Scratcher
Registered: 2011-12-06
Posts: 100+

Re: Help with brickbreaker variant!

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
end
Then, 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)
end
After 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))
end
Then, put this script in Ball:
when i receive [Ball bounce v]
point in direction ((direction) - ((180) + (pick random (-20) to (20))))
move (4) steps
And 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))
end
Then, add this to all the bricks (Sprite1 to Sprite 37):
when i receive [show bricks v]
show
This should work if I didn't make any mistakes.  smile

Offline

 

#4 2012-02-12 14:57:37

Sn33ze
New Scratcher
Registered: 2012-01-26
Posts: 9

Re: Help with brickbreaker variant!

you are amazing!!! thank you so much  smile

appreciate it!

Offline

 

#5 2012-02-12 15:16:48

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Help with brickbreaker variant!

look at my breakout  smile
http://scratch.mit.edu/projects/roijac/1802574

Offline

 

#6 2012-02-12 15:53:35

Sn33ze
New Scratcher
Registered: 2012-01-26
Posts: 9

Re: Help with brickbreaker variant!

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

 

#7 2012-02-13 11:20:28

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: Help with brickbreaker variant!

when gf clicked
switch to background [whatever]
broadcast [show bricks]

Last edited by roijac (2012-02-13 11:20:55)

Offline

 

#8 2012-02-13 16:34:50

joefarebrother
Scratcher
Registered: 2011-04-08
Posts: 1000+

Re: Help with brickbreaker variant!

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)


My latest project is called http://tinyurl.com/d2m8hne! It has http://tinyurl.com/d395ygk views, http://tinyurl.com/cnasmt7 love-its, and http://tinyurl.com/bwjy8xs comments.
http://tinyurl.com/756anbk   http://tinyurl.com/iplaychess

Offline

 

Board footer