How to make a wave spawner

How to make a wave spawner can someone please help me.

Comments

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Could you give a little more details on what you're trying to do?

    Mental Donkey Games
    Website - Facebook - Twitter

  • SEMASEMA Member Posts: 161

    For example every wave a number and type of enemies will come. Like in plants vs zombies

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    One way to do this is to read through the columns of a table using Loop Over Table and have each row stand for a particular level. So if your table looked like this:

    1 0 0 0 0
    1 1 0 0 0
    2 0 1 0 0

    It might mean to spawn 1 easy enemy on level 1, 1 easy and 1 medium on level 2, and 2 easy and 1 hard on level 3.

    When each level starts, you would increase game.level (an integer) by one and then use that as the row value in your table expressions.

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

  • BigDaveBigDave Member Posts: 2,239
    edited September 2015

    @SEMA
    i do it like this

    Start trigger: Game start with or without delay (timer)

    First wave
    spawn defined amount and type of enemies, lets say 10

    I have a game variable like Enemies Killed which i increased with each killed enemy
    and if a certain threshold is reached, lets say 10 for this example, i do a new event as a small break or spawning another/next wave.

  • SEMASEMA Member Posts: 161

    thank you guys

  • SEMASEMA Member Posts: 161

    @tatiang could you send me a screenshot of the code required.

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    @SEMA I don't have the rules set up but it would require using Loop Over Table to loop through the column values using game.level as the row value. So the current spawner data (integer) would be something like this:

    tableCellValue(tableName, game.level, self.loopIndex)

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

  • SEMASEMA Member Posts: 161

    It spawn the actor based on the amount of columns I have, but i can't get them to spawn correctly.

Sign In or Register to comment.