Discuss Scratch

Mruneducated
Scratcher
4 posts

How to make Clones Shoot Properly

Im trying to make one of the enemies in my game shoot projectiles if there are more than one of them at a time. However this is extremely buggy, I'm afraid. Does anyone know how to make enemies properly shoot bullets?

Link to my Game: https://scratch.mit.edu/projects/1081719846

Sprites involved are: Gunman, Shoota, Shoota Bullet
tacosaucer
Scratcher
49 posts

How to make Clones Shoot Properly

i gotta say, nice project, although the code is messy and really laggy
anyway, i suggest if you want to use pen extension you can stamp with a list
or the option i personally recommend, use matching ids for all the sprite clones and sync the actions implemented on them
your game uses a ton of clones, so the 2nd option is best
10goto10
Scratcher
1000+ posts

How to make Clones Shoot Properly

I made a remix that lets the ‘shoota bullets’ come from the correct “gunman” clone. https://scratch.mit.edu/projects/1368857703/

The “shoota” clone and the “shoota bullets” now have a variable to index to their specific “gunman” parent location in the gunman x, y lists.
Mruneducated
Scratcher
4 posts

How to make Clones Shoot Properly

Wow, I'm actually very impressed! It does seem to work for the most part, but I do have some feedback that could be fixed.
- Gun doesn't usually properly recoil when the bullet is fired
- Bullets seem to do more damage than intended (I assume this is probably because bullets are stacked on each other)
- I kind of want the gun to fully orbit the gunman instead of staying in the same spot (kind of like the original project)
- There are still some moments in which bullets don't fire from their respective gunman

If possible, could these issues be fixed? In the meantime, I'll make a private copy to test some of these things. Thanks!
10goto10
Scratcher
1000+ posts

How to make Clones Shoot Properly

Okay. I made a few updates.

Added code to make sure only one bullet did harm so that should correct the damage amount.
The gun looks like it orbits now.
I think the gun recall is the same so I didn't change/fix anything.
I think that the bullets are coming from their parent gunman. That's why I put in the say block so I could see what each bullet thought was it's parent.

I was hoping that when you saw the CloneID and clone information lists technique you'd be okay to go forward with your project.
Mruneducated
Scratcher
4 posts

How to make Clones Shoot Properly

Ok, I have sucessfully added all the major scripts from the remix into my project. Thank you very much! Also, when I was talking about how sometimes the bullets dont come from their parent gunman, it only happens if both of them shoot at the same time, which can be somewhat often. It's probably a Scratch issue though.

Powered by DjangoBB