- Home /
TD fixed spawn
Hi I'm now making a 2d TD game. The gameplay style is a bit like com2us' Brave Heroes, but very different inside. The game is halfway complete, and I got stuck in spawning the enemy. I wanted to spawn what enemy and when as I like (for strategic purpose) The spawner that unity gave in 2D tutorial is great, but it just randomize the spawn with given array.
Say I want the enemy spawn like this at lv1
- 00:05 type-A
- 00:07 type-C
- 00:11 type-B
- 01:05 BOSS
It's one time clear. So after you beat lv1, you can't grind in that level anymore.
then at lv2 I'll have different spawn time and enemies.
What's the best approach or solution to this matter?
I have thought about making a database for each level. There are 50 levels in this game, but I won't make it easy to do a one-time clear pass lv20.
I just know SQL for database. MAYBE simpleSQL can do that? and how to implement the spawn time and object from SQL? Still not buying this stuff cos lack of reference, and I don't want any money go to waste.
PlayerPrefs seems impossible. and I just know a tiny of XML and JSON.
But if XML or JSON is the only way then I'll learn them.
If you know the logic/flows I have PlayMaker so you don't need to trouble yourself giving a code example.
Or if there's any Assets that can make this easier let me know. Money's not a big problem. Have 5 ppl here :)
oh ya. and im developing for mobile game. not PC.
If you are Instantiating then its easy enough to have a fixed spawn as you tell them all to spawn in one place inside the Instantiate line. Also you could use a simple coroutine to tell the different types to spawn at different times. This is the simple way to do it with out having to set up databases but it could be a bit long winded doing it for every level
nice idea. so for lv1 I can place the enemies in one line far far away from the camera? but then if I have 100 enemies won't that be a performance hit?
You can use a coroutine to Instantiate them into the same one at a time when you want them to start moving, also the new Instantiate2D feature is allot less of a frame rate killer. when once you have spawned them in they will instantly start walking through your path ( i guess your using a way point system or a spline?)
the enemy logic is just simple. they have straight path after spawning. But my TD is more like Brave Heroes, or Wizard&Dragon Defense (you can check both at googleplay. not sure if there's one at appstore.
So everytime you choose stage 1, the enemy spawn will always be like that. So u can always grind at a stage u know the most.