GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

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 Posts: 11,337Member, Sous Chef, PRO, Senior Sous-Chef
    edited June 5

    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 Posts: 6Member

    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 Posts: 11,337Member, Sous Chef, PRO, Senior Sous-Chef

    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 Posts: 6Member

    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 Posts: 11,337Member, Sous Chef, PRO, Senior Sous-Chef

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

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

  • MinoGamesMinoGames Posts: 6Member

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

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

    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 Posts: 6Member

    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 Posts: 11,337Member, Sous Chef, PRO, Senior Sous-Chef
    edited June 6

    @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 Posts: 6Member

    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 Posts: 11,337Member, Sous Chef, PRO, Senior Sous-Chef

    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 Posts: 226Member, PRO

    @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 Posts: 84Member

    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.