Discuss Scratch

JonathanIsJony
Scratcher
1000+ posts

how do i kill a clone enemy with a clone projectile

please help
-CyberVoid-
Scratcher
23 posts

how do i kill a clone enemy with a clone projectile

when green flag clicked
forever
broadcast [tick v]
end
when I receive [tick v]
if <touching [projectile v] ?> then
delete this clone
end
Hope this helps!
FancyTigerDustBall
Scratcher
100+ posts

how do i kill a clone enemy with a clone projectile

You would do something like this:

when I start as a clone
forever
if <touching [Projectile v] ?> then
delete this clone
end
...
end
JonathanIsJony
Scratcher
1000+ posts

how do i kill a clone enemy with a clone projectile

-CyberVoid- wrote:

when green flag clicked
forever
broadcast [tick v]
end
when I receive [tick v]
if <touching [projectile v] ?> then
delete this clone
end
Hope this helps!
sorry, but i'm not making a sprite just for the projectile, but i do appreciate the help!
FancyTigerDustBall
Scratcher
100+ posts

how do i kill a clone enemy with a clone projectile

JonathanIsJony wrote:

-CyberVoid- wrote:

when green flag clicked
forever
broadcast [tick v]
end
when I receive [tick v]
if <touching [projectile v] ?> then
delete this clone
end
Hope this helps!
sorry, but i'm not making a sprite just for the projectile, but i do appreciate the help!
If the projectile doesn't have a sprite how is it represented? Is it a coordinate rendered by pen?
JonathanIsJony
Scratcher
1000+ posts

how do i kill a clone enemy with a clone projectile

FancyTigerDustBall wrote:

JonathanIsJony wrote:

-CyberVoid- wrote:

when green flag clicked
forever
broadcast [tick v]
end
when I receive [tick v]
if <touching [projectile v] ?> then
delete this clone
end
Hope this helps!
sorry, but i'm not making a sprite just for the projectile, but i do appreciate the help!
If the projectile doesn't have a sprite how is it represented? Is it a coordinate rendered by pen?
no? i don't even know how to use a pen

though i do suppose i need a new sprite
BrainGamer1234
Scratcher
35 posts

how do i kill a clone enemy with a clone projectile

needs a new sprite for projectiles or you can detect touching a colour, but it would require said colour to be unique to said projectile,
FancyTigerDustBall
Scratcher
100+ posts

how do i kill a clone enemy with a clone projectile

JonathanIsJony wrote:

FancyTigerDustBall wrote:

JonathanIsJony wrote:

-CyberVoid- wrote:

...
Hope this helps!
sorry, but i'm not making a sprite just for the projectile, but i do appreciate the help!
If the projectile doesn't have a sprite how is it represented? Is it a coordinate rendered by pen?
no? i don't even know how to use a pen

though i do suppose i need a new sprite
Yeah, if you're not using coordinates/pen you need to make a new sprite for the projectile. Do you need help making code for the projectiles?

Last edited by FancyTigerDustBall (Yesterday 16:15:19)

JonathanIsJony
Scratcher
1000+ posts

how do i kill a clone enemy with a clone projectile

FancyTigerDustBall wrote:

-swoon-
Yeah, if you're not using coordinates/pen you need to make a new sprite for the projectile. Do you need help making code for the projectiles?
nah i have it in the player sprite
linguinichef2015
Scratcher
19 posts

how do i kill a clone enemy with a clone projectile

JonathanIsJony wrote:

-CyberVoid- wrote:

when green flag clicked
forever
broadcast [tick v]
end
when I receive [tick v]
if <touching [projectile v] ?> then
delete this clone
end
Hope this helps!
sorry, but i'm not making a sprite just for the projectile, but i do appreciate the help!
If you use the
 <touching (projectile v) ?> 
block, it will also check if touching projectile clones too. They're right.

Last edited by linguinichef2015 (Yesterday 19:51:31)

Matthobro120
Scratcher
82 posts

how do i kill a clone enemy with a clone projectile

If all are clones, then you can use an id variable:
when I receive [check for projectile v]
if <<touching [myself v] ?> and <(id) = [projectile]>> then //You go to a different sprite then drag it into your sprite for it to detect itself
... // Make sure the variable is for this sprite only, it's important
end
JonathanIsJony
Scratcher
1000+ posts

how do i kill a clone enemy with a clone projectile

got the code working, if you want to see the project i was using it for, click here

thanks to everybody that posted here!

Last edited by JonathanIsJony (Yesterday 21:51:23)

Powered by DjangoBB