spawning

zombotszombots Member Posts: 186
edited November -1 in Working with GS (Mac)
i have a really long level and im trying to figure out the best way to spawn actors on it, randomly if possible.
also id only want them to be spawned on the right of the player and of screen if that makes sense?

id love any suggestions on the best way to do this :)

Comments

  • AjBlueAjBlue Member Posts: 215
    dont ever use spawn or destroy, place you actors offscreen, and then you can have them move into the scene by changing their x y coordinates by a random, and put the range you want to randomly spawn
  • AjBlueAjBlue Member Posts: 215
    i don't know if you know but spawning and destroying is bad on memory until it gets fixed by gamesalad
  • TobyToby Member Posts: 478
    I do a lot of this in my games and they seem to be ok? Did not really know about any issues?
  • THRSTNTHRSTN Member Posts: 178
    Toby said:
    I do a lot of this in my games and they seem to be ok? Did not really know about any issues?

    me too i have yet to notice any significant problem in my game.

    Sideways pinball
    http://itunes.apple.com/us/app/sideways-pinball/id409050094?mt=8
  • zombotszombots Member Posts: 186
    i dunno if this helps explain what im trying to do http://d.pr/TaFw
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    AjBlue said:
    i don't know if you know but spawning and destroying is bad on memory until it gets fixed by gamesalad

    This is a little misleading. I just made a template that constantly Spawns and drops enemies and a gun that spawns every bullet and on viewer I have had no issues with performance.

    The performance issue depend on a lot more than just spawning. Now spawning large actors will hurt more than small but it is very misleading to say never do it it cause all sorts of problem.
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    yes you can control how and where it spawns. You will just have to have a game attribute constrained to your player position. so you can tell it to spawn 50 px ahead of that position.
  • AjBlueAjBlue Member Posts: 215
    make a boolean that says when platform spawns, spawn actor. and then you can get fancy and add a random, so its not on the same place on the platform every time
  • zombotszombots Member Posts: 186
    atm it doesnt spawn platforms, its just a giant level. would it be better to make them spawn?
  • AjBlueAjBlue Member Posts: 215
    if you spawn them in randomly it gives an endless game... if thats what you want, which i figure you do.
Sign In or Register to comment.