Discuss Scratch

RizDidThiz
Scratcher
10 posts

Deleting one clone at once

So I am currently working on a shooter game, for the bullets and enemies I am using clones (I suspect this is the problem) but whenever you shoot an enemy instead of one disappearing they all do. here is my code.

when I start as a clone
go to [random position v]
show
forever
if <> then
<touching [bullet v] ?>
delete this clone
end
end

Last edited by RizDidThiz (April 6, 2024 07:30:15)


RizDidThiz
chriscreators14
Scratcher
500+ posts

Deleting one clone at once

I have no idea. Can you share the thingo where the project is in?

See that line over there? Everything below it is my signature. You can advertise here.
Ctrl+Alt+Down or thingo do NOT ask to scroll

(/) // This is Kumqa, who sends evil kumquats back to their camp.
<[<>]::sound> // This is Orba, who dizzies enemies by rotating.
[hi] \/\/ This is Glitchya, who glitches thingos. // Oh, I fixed the comment bug now.

block haven {block gun (ammo::grey) (ammo::grey)::sensing} <true :: operators> // This is Signa, which makes letter guns.

define block haven (block thingo) <auto fire?>
forever
if <enemies? :: sensing> then
if <not <auto fire?>> then
if <key [space v] pressed> then
set [fire? v] to <true :: operators>
else
set [fire? v] to <true :: operators>
end
else
set [fire? v] to <true :: operators>
end
else
set [fire? v] to <false :: operators>
end
if <fire? :: variables> then
repeat (10)
create clone of [signa blocks]
end
broadcast (fire signa blocks v)
end

RizDidThiz
Scratcher
10 posts

Deleting one clone at once

I cant see all of your message. I am new to this whole forums thing so I was wondering if you could tell me how to scroll down on your text. I know you told me not to ask, but I spent like 10 minutes researching and cant find it

RizDidThiz
arora_borealis
Scratcher
72 posts

Deleting one clone at once

RizDidThiz wrote:

So I am currently working on a shooter game, for the bullets and enemies I am using clones (I suspect this is the problem) but whenever you shoot an enemy instead of one disappearing they all do. here is my code.

when I start as a clone
go to [random position v]
show
forever
if <> then
<touching [bullet v] ?>
delete this clone
end
end


Did you use the “stop all” Block?

- arora_borealis

›Scratcher.
›He/him.
›Loves Science and Mathematics .
›Obsessed with the Periodic Table of Elements.

Have a great week ahead, and
Scratch on!
arora_borealis
Scratcher
72 posts

Deleting one clone at once

RizDidThiz wrote:

So I am currently working on a shooter game, for the bullets and enemies I am using clones (I suspect this is the problem) but whenever you shoot an enemy instead of one disappearing they all do. here is my code.

when I start as a clone
go to [random position v]
show
forever
if <> then
<touching [bullet v] ?>
delete this clone
end
end
when I start as a clone
show
forever
if <touching [ bullet v] ?> then
delete this clone
end
end

- arora_borealis

›Scratcher.
›He/him.
›Loves Science and Mathematics .
›Obsessed with the Periodic Table of Elements.

Have a great week ahead, and
Scratch on!
arora_borealis
Scratcher
72 posts

Deleting one clone at once

or just create a totally new script.
when I start as a clone
wait until <touching [bullets v] ?>
delete this clone

- arora_borealis

›Scratcher.
›He/him.
›Loves Science and Mathematics .
›Obsessed with the Periodic Table of Elements.

Have a great week ahead, and
Scratch on!
RizDidThiz
Scratcher
10 posts

Deleting one clone at once

ok thanks, I will try the stop all and make a new script




RizDidThiz
RizDidThiz
Scratcher
10 posts

Deleting one clone at once

btw, my game link is https://scratch.mit.edu/projects/995572771/editor/

RizDidThiz
MrKingofScratch
Scratcher
100+ posts

Deleting one clone at once

Get rid of the broadcast slimedie in the bullet sprite- all clones recieve a broadcast meaning that whenever the bullet touches a clone and broadcasts slimedie, ALL of the clones will recieve it and delete themselves.

otherwise, your code is great!

Last edited by MrKingofScratch (April 6, 2024 23:08:24)


Last edited by kaj (Tomorrow 00:00:00)
100th post!
RizDidThiz
Scratcher
10 posts

Deleting one clone at once

ohhhh thanks so much! I decided to delete the slimes but after this I think I might give it another shot.

RizDidThiz
RizDidThiz
Scratcher
10 posts

Deleting one clone at once

ok so I fixed up and polished my code for the slime, and it is so satisfying and works perfectly. thanks so much king!

RizDidThiz
MrKingofScratch
Scratcher
100+ posts

Deleting one clone at once

nice!

Last edited by kaj (Tomorrow 00:00:00)
100th post!

Powered by DjangoBB