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.

Comments

  • CobraBladeCobraBlade Member Posts: 97
    You can pick up a template over at gshelper.com for $40 if you want. If that's a little too pricey maybe you could contact them for a few pointers.
  • oo7franoo7fran Member Posts: 25
    @CobraBlade thank you for the comment but I am not looking for a template I would like do it myself I simply wanted to know if my way would work or if there would be a better way to do it. Thanx
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    @oo7fran You're asking simple questions about a very complex game. It's certainly doable with GameSalad, as the GSHelper template suggests (I've also built a PVZ template with GameSalad).

    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

  • oo7franoo7fran Member Posts: 25
    @tatiang thank you for your answers. On the movement you say I can use interpolate or move. What would be the best way to do it and also the least resource intensive?

    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?
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Sure, you could keep count of the number of spawned enemies and have a condition to only spawn when below that number. It is a good way to do it. ;)

    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

  • oo7franoo7fran Member Posts: 25
    @tatiang thank you for the help will throw someting together.
  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Actually I take that back. Interpolate doesn't work well with collisions and since you'll have pea shooters (or whatever), you should use Move.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

  • oo7franoo7fran Member Posts: 25
    @tatiang thank you will use move instead.
Sign In or Register to comment.