To start, I've only played around with C2 for a few days. I've read the manual. I can't seem to do a logic in C2 that I want to work.
I'm trying to test out a tower defense game. Let's say I have 20 waves/levels. In each level there will be 10 same enemies spawning. But each level will have different enemies.
The normal way I see from guides is that I need to create individual spawning/collision/targeted/dying/etc action for each enemies, so that would take a lot of same lines for each enemies and for every new type of enemy I add in the game.
Can't I just have a array for Sprite? There is for text & number, but I can't use those to manage my Sprites.
Example:
If I have an array for sprites, lets say spriteArray. So this has XYZ. I'm gonna use X only for this example.
OnLayoutStart:
spriteArray[0] = Ogre //=== Notice there's no quotation marks, so it's not a text value like "Ogre".
spriteArray[1] = Troll //=== I tried using text to try to spawn object matching the strings on my text, but there's no such thing in C2.
spriteArray[2] = Witch
spriteArray[3] = Shark
currentLevel = 2 //=== number variable
On Function Call >>> Repeat x10 >>> Spawn object spriteArray[currentLevel]
When I finish the level, I'm just going to add 1 to currentLevel and I can just use a function to call Spawn object spriteArray[curretLevel].
See also, if at some point, I decided to change a Troll to a Golem, if in the normal way, I would have to find each every line that has something to do with Troll and replace it with Golem, which I find inconvenient. If I have spriteArray, I can just change one line, the spriteArray[1] = troll on the start of layout.
Saving a lot of lines and time and a lot of managing when editing creep. I know about the Family feature, but it's not the thing, it doesn't do the job(Or maybe I'm not knowledgeable enough about it since I have no access to it to play with). Spawning a family creates random sprite, which is not what I want.
I can't seem to find a way to do this. Can help me find a way using this logic?
//===========================================
SECOND QUESTION:
When a bullet hits a Family of enemy sprites, how do I pick the individual sprite that got hit by the bullet? I want to save lines, time, and works instead of manually doing bullet1 colliding to enemy1 to enemy40+ and doing the same thing for bullet 2 to bullet 10+,( thats like 800+ similar lines alrdy). I don't mind the event sheet line limit for the free version, it's just this is inconvenient and impractical.
Thanks in advance.