Help with a plants vs zombies game machanics
Hi all
I am waying my options so the question that I pose is. What is the best way to do the mechanics for a game like this?
For the movement would you simply constrain an actor to only be able to move on the x axiz?
And what about mobs or waves of enemies? As they do not come only at appointed time so times won't work. How would you be able to escalate or multiply the the amout of enemies spawned?
Thanks looking forward to hear what you come up with.
I am waying my options so the question that I pose is. What is the best way to do the mechanics for a game like this?
For the movement would you simply constrain an actor to only be able to move on the x axiz?
And what about mobs or waves of enemies? As they do not come only at appointed time so times won't work. How would you be able to escalate or multiply the the amout of enemies spawned?
Thanks looking forward to hear what you come up with.
Comments
You asked "For the movement would you simply constrain an actor to only be able to move on the x axiz?" Which actor do you mean? If you mean enemies, you don't need to constrain them at all because they have no independent control over their movement. Just decide how you want them to move and then create rules. Maybe you want them to move to the left 100 pixels each second. So you could use Move or Interpolate or a variety of behaviors to accomplish that.
"And what about mobs or waves of enemies? As they do not come only at appointed time so times won't work. How would you be able to escalate or multiply the the amout of enemies spawned?"
This is again what seems like a straightforward question but without a simple answer. You'll need to think about how you want the game to work. If you want the enemies to spawn at random times, then you'll use a random() function with a timer or timeStamp loop (see http://forums.gamesalad.com/discussion/56012/best-way-to-do-random-time-spawning-of-an-actor#latest). If you want numbers to increase, you'll need to think about what type of increase. Does the number of enemies increase by one every 10 seconds, by one every level, or some other way? Once you have that all figured out, you can explain it here and someone can help you with the math behind it.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
Then also on the enemies I have an idea of how I would do it but my question is now how do I set the amount of enemies spawned. So for instance if I would like to only spawn 10 enemies what would be the best way to do that make an attribute that starts at zero and add a rule to each enemy that says when spawned +1 to the attribute I created and when it reaches 10 it stops the spawning of enemies.
Would this work and is it a good way of doing it or which way would you recommend?
As for movement, it doesn't really matter. I would Interpolate from one grid position to the next. In my template, I used Move.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User