Discuss Scratch

Navy_Pixel
Scratcher
3 posts

Different bullet type things

so i'm making a game where you can switch between weapon types (in same sprite) and bullets are shot out as clones, the enemies are also clones… how do i make different bullet damages work when hitting enemies? if anyone knows a fix i will be greatfull!
:)
Bitebite12
Scratcher
1000+ posts

Different bullet type things

I most simple way I can think of is color sensing, make sure to do it on both clones, so the bullet is destroyed too, otherwise it will spam damage. It is also important to put a slight dely in bullet destruction, so the ememy has time to register a hit. Also implement a code where the enemy will only take damage when it is first hit, and then wait until not touching that color. This method will mean that super rapid fire shots wont always work, but the other way of doing things is not so simple

Make sure not to use real life guns, as it goes against scratches ToS. See here what weopons are allowed and which are banned.

Hope this helps!

Last edited by Bitebite12 (April 15, 2025 14:22:53)

Navy_Pixel
Scratcher
3 posts

Different bullet type things

yeah, i dont think i want to use colour sensing as the bullets already have designs, and i have most the code already, and dont worry.. the gun is a cartoony pixel art turret so its not breaking scratch ToS i think.
Bitebite12
Scratcher
1000+ posts

Different bullet type things

Navy_Pixel wrote:

yeah, i dont think i want to use colour sensing as the bullets already have designs, and i have most the code already, and dont worry.. the gun is a cartoony pixel art turret so its not breaking scratch ToS i think.
The other way I can think of, that may work, in theory, is using local variables and lists. I am not an expert on these, however, so it may be better to ask someone who has made a TD game, such as @ggenije and @SamadiBeligaswatte1 , to name a few.

Navy_Pixel
Scratcher
3 posts

Different bullet type things

yh, i have tested a list based thing and it works so far. so i guess i will stick with that
Aetherpixel
Scratcher
61 posts

Different bullet type things

Navy_Pixel wrote:

so i'm making a game where you can switch between weapon types (in same sprite) and bullets are shot out as clones, the enemies are also clones… how do i make different bullet damages work when hitting enemies? if anyone knows a fix i will be greatfull!
You can set the weapon type to a variable, and damage the enemies based on the weapon type. The only downside is that existing bullets shot from a different gun would deal the damage of the new one.

Last edited by Aetherpixel (April 15, 2025 15:55:19)

Powered by DjangoBB