Spawning an actor consistently in a row

Hi,

Im trying to make a vertical endless scrolling game and I want one side to have random actors consistently spawn on top of each other on a consitent distance from one another. I'm not sure how to do this and would love some help.

Comments

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

    Without knowing more details such as how you're scrolling the game, it's hard to know exactly what to suggest but generally you'd want to spawn using a timer (e.g. every 2 seconds).

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

  • MinoGamesMinoGames Member Posts: 6

    Hi thanks! Unfortunately it is not really how I was scrolling the game. I was messing with this Doodle Jump template, so I dont think using the Move behavior would work here.

    mediafire.com/file/3vh6hbi39hfrp31/endlessJump.zip/file

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

    I don't know if this would work for you but I took that template and added a spawner with an every __ seconds timer and gave the enemy actor the same gravity as the doodle actor.

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

  • MinoGamesMinoGames Member Posts: 6

    No I kind of need it to behave like the white actor (Actor 2) on the left where it goes down as the doodle goes up accordingly. And i want a fixed distance between each of that actor so don't know if gravity should be used. Maybe I need to use tables or something ?

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

    Hmm... I'm not sure, sorry!

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

  • MinoGamesMinoGames Member Posts: 6

    Is there a way to spawn an actor every ( insert distance here ) instead of every (x) seconds ?

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

    There is but you'd have to figure out the math for it and use a timer still.

    Not sure if this is helpful since it's essentially the same thing I mentioned but you might check it out:

    http://gshelper.com/product/spawn-time-changer/

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

  • MinoGamesMinoGames Member Posts: 6

    Ok thanks! Not excactly what I wanted but it's not really crucial I guess. I tried if game.isHalfway do Move. And also used game.isHalfway in the spawner, but need to figure out how not to make them overlap. And other issues.

    One last question: Can I spawn the actors like you showed but also have other random actors in a row?

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

    @MinoGames said:
    One last question: Can I spawn the actors like you showed but also have other random actors in a row?

    Yes? I'm not really sure what you mean. In general, you can do just about anything with GameSalad but without knowing more...

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

  • MinoGamesMinoGames Member Posts: 6

    I mean like in the gshelper template you showed lets say in that row of Bullet Bills there are also golden Bullet Bills once in a while instead of normal ones.

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

    Oh okay. You can choose a random number and spawn different actors based on the value. For more info, Google spawn random gamesalad. There are videos and forum threads about how to do it.

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

  • Simple Gamer ArtsSimple Gamer Arts Member, PRO Posts: 305

    @MinoGames

    I would suggest hunting for smaller fish before going for the big one.

    Make a project with the objective of emulating a flappy bird up and down (Y) movement... not even the X movement... just Y movement flappy bird style...

    Do that with more games... focus on one action at a time in separate project files. Later it will be second nature to you.

  • TapcodiaTapcodia Member Posts: 84

    i used a timer, and had it spawn an actor X amount of times, incrementing the X or Y (depending on chosen direction and actor size). So, i would put a single coin on the screen and unlock the coin, and had an attribute "SpawnAmount" and i would change that to 5 or whatever, and it would auto spawn the coins for me in perfect formation. A lot easier then hand placing 5 coins and checking X Y. I made alot of actors with unique patterns. It would spawn coins similar to jetpack joyride.

Sign In or Register to comment.