Discuss Scratch

Ducky0112
Scratcher
6 posts

how to make a bomb?

when green flag clicked
say [bomb does nothing]
I want to make a bomb that kills anything close to it.

Last edited by Ducky0112 (Sept. 21, 2022 00:12:17)

legendary34678
Scratcher
1000+ posts

how to make a bomb?

What do you mean by a bomb? You can make sprites hide when they're touching the bomb sprite I suppose, but you weren't too clear with your question.

Can you beat my latest game?

Have you heard of the X Y Problem?
Please check out me projects please I'm desperate –> Idle Balls, Candy Grab!, Don't Move Your Mouse!, Rude Robot, Tic Tac Toe, Memory Game, Corn Maze, and Idle Balls PEN EDITION!

Oh, hey! I have 100+ posts now!
Oh, hey! I have 500+ posts now! (8/26/22)
Oh, hey! I have 1000+ posts now! (9/23/22)
(Thanks to @AntonL1kesPotato for helping me figure out how to add a signature!)
RT_Borg
Scratcher
1000+ posts

how to make a bomb?

Hi Ducky0112,

Something like this?

Demo: Explosion
https://scratch.mit.edu/projects/734784484

If you use the explosion costumes or sound, don't forget to copy the Notes and Credits into your project.

– RT_Borg
Ducky0112
Scratcher
6 posts

how to make a bomb?

RT_Borg wrote:

Hi Ducky0112,

Something like this?

Demo: Explosion
https://scratch.mit.edu/projects/734784484

If you use the explosion costumes or sound, don't forget to copy the Notes and Credits into your project.

– RT_Borg
Ok Thank you
Ducky0112
Scratcher
6 posts

how to make a bomb?

legendary34678 wrote:

What do you mean by a bomb? You can make sprites hide when they're touching the bomb sprite I suppose, but you weren't too clear with your question.
I mean that any clone would be destroyed if near the bomb when exploding.
when green flag clicked
if <near bomb> then
explode and be gone
end

Last edited by Ducky0112 (Sept. 21, 2022 15:39:11)

pearldealer
Scratcher
28 posts

how to make a bomb?

Ducky0112 wrote:

legendary34678 wrote:

What do you mean by a bomb? You can make sprites hide when they're touching the bomb sprite I suppose, but you weren't too clear with your question.
I mean that any clone would be destroyed if near the bomb when exploding.
when green flag clicked
if <near bomb> then
explode and be gone
end
So make a variable an have it be the area and have it hide specific sprites within the area
RT_Borg
Scratcher
1000+ posts

how to make a bomb?

pearldealer wrote:

So make a variable an have it be the area and have it hide specific sprites within the area

Hi pearldealer, you almost never want to hide clones. Unless a clone is being hidden briefly to be shown again later, you generally want to “delete this clone”. The danger is using up your 300 clone limit. I've seen so many projects here on Help with Scripts with strange bugs caused when clones were hidden instead of deleted.

– RT_Borg
Jereb-co7
Scratcher
100+ posts

how to make a bomb?

Are you trying to anger the scratch lords?

Hi, I'm Jeremiah; A kid who likes coding. I want to help people and become successful. I pretty please want you to join a team called “Shappire games” to make projects I also want 200 followers at the end of 2022.

you wrote:

when green flag clicked
set [ I help you ] to [you help me]
if <( I help you ) = [you help me]> then
say [get scratchin'] for (2) secs
end
My account: Jereb-co7




Sincerely,


Jeremiah. B
SMGHecTa
Scratcher
3 posts

how to make a bomb?

Everything that the bomb touch
G O N E

Last edited by SMGHecTa (March 5, 2023 04:30:13)

WsDanzel
Scratcher
40 posts

how to make a bomb?

SMGHecTa wrote:

Everything that the bomb touch
G O N E
Everything that the bomb touch:
explode

If you see this on my signature, you’ve been infected by the NotK3ndricAlt virus! Put this on the top of your signature and add your name to the list of people who got this virus to help NotK3ndricAlt get more followers.
List of people who got this virus: NotK3ndricAlt, WsDanzel
(note: I changed the signature i rewrited to)
———— Welcome to Windows Danzel ————
No F4F - No Asking For Private Info - Dont Remix Projects Badly
when green flag clicked
go to x: (0) y: (0)
set [steps v] to [0]
forever
move (3) steps
change [steps v] by (1)
if <(steps) = (5)> then
stop [all v]
end
end
MrKingofScratch
Scratcher
100+ posts

how to make a bomb?

You can put this code in the sprite that will have the destroy-able objects.

when I receive [bomb exploded v]
if ((distance to [bomb v]) < (30)) then
//"bomb" refers to the bomb sprite. If it's named something else, change this code.
delete this clone
//this is where you put the code that destroys the object. if it's not a clone, you can use "hide" block
end

This will detect if the object is within 30 units (I think it's measured In pixels but i'm not sure) of the bomb when it explodes. If it is, it destroys the object. You can make the number “30” bigger or smaller if you want the explosion radius to be bigger or smaller.

Then put this code in the explosion script in the bomb sprite:
broadcast [bomb exploded v]
This just triggered the script that's responsible for destroying the objects in range of the bomb.

Last edited by kaj (Tomorrow 00:00:00)
100th post!
Potahtoe_
Scratcher
12 posts

how to make a bomb?

Ducky0112 wrote:

when green flag clicked
say [bomb does nothing]
I want to make a bomb that kills anything close to it.

ig you could make a “bomb sprite” and after a set amount of time (or if a condition is met), if the player is in the range (you could do this with hitboxes maybe? or you can compare the different x and y values) it'll detonate and do you what you want it to do

not the most helpful post but it should hopefully give you a simple understanding of how you can implement it.

Potahtoe_

Silly web dev, I make random things when I feel like it!
SMGHecTa
Scratcher
3 posts

how to make a bomb?

WsDanzel wrote:

SMGHecTa wrote:

Everything that the bomb touch
G O N E
Everything that the bomb touch:
explode
Nobody cares, asked, and smelled
SMGHecTa
Scratcher
3 posts

how to make a bomb?

darn it i was sayin about the virsu
froggyhatto
Scratcher
1 post

how to make a bomb?

when green flag clicked
glide () secs to x: (0) y: (-190)
switch costume to [explosion]
if <touching [anything] ?> then
broadcast [ dead]
end
JIM-13
Scratcher
9 posts

how to make a bomb?

is there anything to make a falling bomb?
Norse7
Scratcher
67 posts

how to make a bomb?

you could add gravity like so:

set [ gravityIncrement] to [2]
set [ gravity] to [0]
forever
change [ gravity] by ((0) - (gravityIncrement))
change y by (gravity)
end

“It’s not a bug; it’s an undocumented feature.” ― Anonymous

when green flag clicked
forever
change [ awesomeness] by (1)
end
Malicondi
Scratcher
1000+ posts

how to make a bomb?

Please stop necroposting, this topic is several years old.

post #1000 post #100 i help in the forums post #1 post #500 0 second ninja
I recommend reading jvvg's essay about the scratch team before complaining, as it may change your opinion and provide insight on the topic.

coming soon :)


Powered by DjangoBB