Discuss Scratch

urbanprophet
New Scratcher
4 posts

how to make a sprite shoot the closest enemy

Hi, one of my student is making a project and i'm not sure what kind of script to use.

You can see his project here:

https://scratch.mit.edu/projects/776417695/

The gun is moving up/down with W/S and when you touch the $$$ sign on top, an automated turret appears. It orients with the zombies (green circles swarming) and shoots them.

How to make the turret orients and shoot always the closest zombie??

thanks for your help
crstalgem228
Scratcher
100+ posts

how to make a sprite shoot the closest enemy

urbanprophet wrote:

Hi, one of my student is making a project and i'm not sure what kind of script to use.

You can see his project here:

https://scratch.mit.edu/projects/776417695/

The gun is moving up/down with W/S and when you touch the $$$ sign on top, an automated turret appears. It orients with the zombies (green circles swarming) and shoots them.

How to make the turret orients and shoot always the closest zombie??

thanks for your help
I can try to help! I'm gonna remix your project and see if I can do it
crstalgem228
Scratcher
100+ posts

how to make a sprite shoot the closest enemy

urbanprophet wrote:

Hi, one of my student is making a project and i'm not sure what kind of script to use.

You can see his project here:

https://scratch.mit.edu/projects/776417695/

The gun is moving up/down with W/S and when you touch the $$$ sign on top, an automated turret appears. It orients with the zombies (green circles swarming) and shoots them.

How to make the turret orients and shoot always the closest zombie??

thanks for your help
uhh sorry, it's a bit hard for me too. sorry I can't help
happyfrog123456789
Scratcher
1 post

how to make a sprite shoot the closest enemy

pls figer out people
wavewavegame
Scratcher
26 posts

how to make a sprite shoot the closest enemy

Hello, I found a similar project that has something that you are looking for!
https://scratch.mit.edu/projects/848896617/
It creates a list of every sprite's distance to the player, and points to the nearest one.

Last edited by wavewavegame (Jan. 19, 2025 17:19:49)

Powered by DjangoBB