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

#1 2012-07-22 14:37:53

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

I need a kind guy to help me make my bomb bounce once...

Ok... this might be alittle complicated...

Im flying my ship in space... when i shoot i would like my bomb to bounce -only once- against any wall (there are many small walls in the same colour). If it bounces from a wall into a diff wall- i would prefer it to explode (or just dissapear if its easier)
Anyone have any scratch block suggestions?

Thankyou  smile

Offline

 

#2 2012-07-22 14:39:48

SciTecCf
Scratcher
Registered: 2011-11-23
Posts: 1000+

Re: I need a kind guy to help me make my bomb bounce once...

Erm, as in, bounce from a wall, bounce from walls of that same color, and explode when it hits something else?


http://bit.ly/LCZEJRhttp://bit.ly/LSONcOhttp://bit.ly/LF3vIc
http://trinary.site40.net/images/scratchrank.php?username=SciTecCf&display=small

Offline

 

#3 2012-07-22 14:43:18

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

Yeh as in bounce once from any wall (atm my walls are the same colour for convienience) but soon as it hits another wall bomb explodes... so its just a one bounce bomb.

Offline

 

#4 2012-07-22 14:48:41

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

My script up to now for the sprite 2 (bomb) is:

When [s] key is pressed
go to sprite 1 (ship)
point in direction [direction] of [sprite1]
{Repear until touching [edge]? or touching colour []?
{   Show
{__Move 3 steps
hide
go to [sprite1]

this script shoots the bomb- soon as it hits the wall- my bomb dissapears... reset

Offline

 

#5 2012-07-22 15:47:28

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: I need a kind guy to help me make my bomb bounce once...

when [s v] key pressed
set [touched v] to (0)
repeat until <(touched) = (2)>
move (speed) steps
if <touching color [#000000]?>
change [touched v] by (1)
point in direction ((direction) * (-1))
end
end
explosion script


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#6 2012-07-22 16:20:14

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

hmm for some reason it didnt seem to work- wouldnt let me highlight it  sad  thanx for helping tho!  smile

Offline

 

#7 2012-07-22 17:15:57

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: I need a kind guy to help me make my bomb bounce once...

Subsidel wrote:

hmm for some reason it didnt seem to work- wouldnt let me highlight it  sad  thanx for helping tho!  smile

What do you mean highlight it?


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#8 2012-07-22 22:53:00

videogame9
Scratcher
Registered: 2008-05-12
Posts: 1000+

Re: I need a kind guy to help me make my bomb bounce once...

Subsidel wrote:

hmm for some reason it didnt seem to work- wouldnt let me highlight it  sad  thanx for helping tho!  smile

As far as I know, the only highlighting in Scratch happens to be in text boxes, and you don't seem like you're talking about text boxes.

This may be your problem. :V


http://img641.imageshack.us/img641/4118/newvg9logo.png
QUOTE OF THE RIGHT NOW: why are we arguing about dead babies? -videogame9

Offline

 

#9 2012-07-22 23:02:27

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: I need a kind guy to help me make my bomb bounce once...

Check out my sig for a bouncing engine  wink


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#10 2012-07-22 23:03:18

berberberber
Scratcher
Registered: 2012-03-08
Posts: 1000+

Re: I need a kind guy to help me make my bomb bounce once...

He doesn't want that.  And no offense, it is not too realistic.


http://i47.tinypic.com/2iaa73k.png

Offline

 

#11 2012-07-23 07:28:07

daniel_j
Scratcher
Registered: 2012-05-22
Posts: 100+

Re: I need a kind guy to help me make my bomb bounce once...

Oh. I thought he was after a wall bouncing script..?
And it is not realistic is it xD


http://i50.tinypic.com/2dhgnsx.jpg

Offline

 

#12 2012-07-23 08:06:03

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

Sorry to reply late- when i entered the script u gave me zammer, for some reason it wouldnt work- yeh i was talkin about the script box not highlighting when i click it: thought normally it does that when it works (i am new however). Also mayb it doesnt work for me because i havent got an idea of how variables work: though i can add them in just like in your script.

I'm gonna look at daniels script of ball bouncing because my maths coding for the bounce means whatever direction its in before it bounces- it will - or + the direction number so... if i fire 130 degrees at an straight wall like this diagram: ___/___  it will bounce back at -130 derees meaning the bomb wants to go thro wall      \
but really it should go         o   /                                                         o
_______________________ ____\/___ etc

Sorry if i don't make any sense lol

Offline

 

#13 2012-07-23 08:10:32

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

Just to clarify now that ive noticed my first diagram got changed after i submitted it, when i fire at 130 degrees at a straight wall it bounces back -130 degrees like this diagram______________________________/______________________________________________                                                        \                                                                                                                 
                                                         o

Offline

 

#14 2012-07-23 11:00:33

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

Lol been tryin to figure out this all day... its gotta be some wierd mathmatical code. If anyone can figure it out- ur a genius lol.

Offline

 

#15 2012-07-23 11:13:38

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: I need a kind guy to help me make my bomb bounce once...

Subsidel wrote:

Lol been tryin to figure out this all day... its gotta be some wierd mathmatical code. If anyone can figure it out- ur a genius lol.

I'm not sure what you're trying to do. Make the ball bounce? Or make it bounce only once then explode when it hits a wall


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#16 2012-07-23 12:53:37

Subsidel
New Scratcher
Registered: 2012-07-22
Posts: 35

Re: I need a kind guy to help me make my bomb bounce once...

Trying to make it exactly like this http://www.scratch.mit.edu/ext/youtube/?v=UKvnLuNtlUc where the bomb bounces before exploding... but everytime i try and make the bomb bounce- some angles is fine but others doesnt work out.

Offline

 

Board footer