0

i am making a 2d side scroller and have got the enemy's and the player and the controls all working but i am trying to make a array of my ammo class for the enemy class to use, i have made 10 separate enemy's and i made 10 separate ammo for the player class to use but i am sure there is a easier way to do this then make 50 sprites of the ammo class and test each one when i am checking for one that has not been fired yet and keeping track of each individual ammo sprite.

any advice or pointers to form similar to this would be very much appreciated!

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by SgtMe
0

never mind i figured it out, apparently you can add as many sprites as you want to a group with the same name, so i just use the group.add(classname) function and i don't even need to initialize it before i add it into the group. wish i figured this out before i did it the hard way oh well.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.