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

#1 2011-01-11 14:29:14

DigitTheDandelion
New Scratcher
Registered: 2011-01-09
Posts: 10

Could somebody help me with making a brick-blaster type game?

There are two things which I'm really struggling on at the moment. xD They are:

1. Making the ball bounce off the paddle according to what angle it hits it at.

2. Reducing the number of lives by one when it hits the ground. (There's another platform above it of the same colour as the ground, but I just want it to bounce off it when it hits it. I'd also rather not change the colour, but there's no problem with that if it's the only way.)

If you'd like to see the project so far, let me know! I'll also acknowledge any help in the credits if I put it on the website.

Thanks for your help, it's really appreciated!

~ Confused Newbie Programmer

Offline

 

#2 2011-01-11 15:14:09

NeoAtVic
Scratcher
Registered: 2010-10-04
Posts: 67

Re: Could somebody help me with making a brick-blaster type game?

When you say you want the Ball to bounce off the platform depending on the angle, are you wanting the position on the platform where the ball hits to be taken into account or is simply reversing the balls movement in the y direction what you are after?
If you post what you have done so far I'll be able to take a look at your programming style and give you some helpful advice on how you can do things  big_smile

If you have the platform of the same color already set up at the ground postion then you can have the condition that if the ball and this platform touch then...
~ Reduce the lives variable by one
~ Stop the ball moving
~ Place the ball back on the platform ready to start the next life

Hope thats a little more help than the last post  smile

Edit: Removed some BBcode that didn't work and tidied up the post a little  smile

Last edited by NeoAtVic (2011-01-11 15:15:16)


http://farm3.static.flickr.com/2796/4519763712_5fab3a6935_o.png

Offline

 

#3 2011-01-15 13:48:30

DigitTheDandelion
New Scratcher
Registered: 2011-01-09
Posts: 10

Re: Could somebody help me with making a brick-blaster type game?

Thanks!

In reply to your first question, reversing the ball's angle in the opposite direction would be what I'm after. So that it's taking the angle the ball hits the platform at into account, and then somehow flipping it to reverse it's path when it's leaving the platform.

The bottom platform is actually part of the background, so I tried to do it using colour instead, saying "if ball is touching colour green AND if position is less than -110 Y repeat change ghost effect by 5, 20 times." That might be ok though now, I'm not sure.

Here's the project so far:

http://scratch.mit.edu/projects/DigitTheDandelion/1537012

(I changed the "change colour" block in the bottom script of the ball's programming to "change ghost", and also added a "change life by 1". It wouldn't upload the updated version though. It said it's too big. D smile

Definitely more helpful than the other post lol, thank you very much!  big_smile

Offline

 

#4 2011-01-15 13:53:51

Robot_Maniac
Scratcher
Registered: 2010-11-22
Posts: 56

Re: Could somebody help me with making a brick-blaster type game?

If you want the ball to bounce off the paddle, use this script:

Code:

<when green flag clicked>
<forever if [touching paddle]
<point in direction 180-direction>
<move 5 steps>
turn pick random -20 - 20 degrees
<end forever if>

Math Trick of the Week: Choose any three digit number that's one digit is at least 2 less that the tens digit and the tens digit at least 2 less than the hundreds. Then, reverse the digits and subtract. Then, reverse the digits in the answer and add. You should get 1089.

Offline

 

#5 2011-01-15 13:55:54

DigitTheDandelion
New Scratcher
Registered: 2011-01-09
Posts: 10

Re: Could somebody help me with making a brick-blaster type game?

Oops, that was supposed to be a sad face...

Yikes, I hope I can get it up. D:

Offline

 

#6 2011-01-15 14:13:28

DigitTheDandelion
New Scratcher
Registered: 2011-01-09
Posts: 10

Re: Could somebody help me with making a brick-blaster type game?

Robo_Manic:

Thanks! I tried what you said, but the ball seemed to go through the paddle and then bounce on and off it on to the ground underneath it, but it worked fine when I changed the 180 degrees to 0 degrees. Though it didn't seem to leave the paddle in the opposite direction to when it hit it. Is there any way to get it to do this?

Offline

 

#7 2011-01-15 14:37:24

Robot_Maniac
Scratcher
Registered: 2010-11-22
Posts: 56

Re: Could somebody help me with making a brick-blaster type game?

hm... you should see the example project pong to see the scripts you might need...


Math Trick of the Week: Choose any three digit number that's one digit is at least 2 less that the tens digit and the tens digit at least 2 less than the hundreds. Then, reverse the digits and subtract. Then, reverse the digits in the answer and add. You should get 1089.

Offline

 

#8 2011-01-15 14:46:39

kingofdallamas
Scratcher
Registered: 2010-03-07
Posts: 500+

Re: Could somebody help me with making a brick-blaster type game?

Try using the Scratch sample projects, the one with the Ping Pong game. That will greatly help and clear up some of your questions, DigitTheDandelion. Also, upload your project, so we can see what's going wrong with the project. That way, we can help better.  big_smile  Good luck on your ping pong game!


http://i853.photobucket.com/albums/ab99/Gilgamesh1192/Ninja%20Saga/ElementalJutsus2.gifhttp://i27.photobucket.com/albums/c192/BoomKaTish/GIF/thgfhgfhfhgf.gif
ハロー友だち!

Offline

 

#9 2011-01-31 11:20:50

DigitTheDandelion
New Scratcher
Registered: 2011-01-09
Posts: 10

Re: Could somebody help me with making a brick-blaster type game?

Thank-you very much everyone. The sample pong game helped a lot.

Offline

 

#10 2011-02-01 19:56:15

Happypieman
Scratcher
Registered: 2010-09-28
Posts: 100+

Re: Could somebody help me with making a brick-blaster type game?

Could someone move this to collab?  smile


2012--The biggest troll ever.

Offline

 

#11 2011-02-01 20:20:31

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Could somebody help me with making a brick-blaster type game?

He doesn't want to work with anyone though...

So it's not a collab.

Offline

 

#12 2011-05-03 16:38:56

dudymate
Scratcher
Registered: 2011-01-07
Posts: 95

Re: Could somebody help me with making a brick-blaster type game?

this isn't for the collab challenge by the way

Offline

 

Board footer