Random Spawning Platform problem... Help

I am currently creating a endless runner. The platforms I have created come from the right of the screen in a continuous fashion and end on the left. I am using the Jamie Cross method of spawning, but I am unable to get it to do random platforms that I have created.
I tried Tshirt Booths method of a "spawner", which does work with random images, but the timer throws the spacing out of wack. I want no timer for my spawning. just one right after the other.
What should I do?
Thanks

Answers

  • http_gamesaladhttp_gamesalad Member Posts: 1,340
    edited October 2014

    Is it spawning right to left or is it spawning up to down?

  • ashtmjashtmj Member, PRO Posts: 405
    edited October 2014

    base the spawning on the location of your current ledge.

    lets say you have a ledge moving from right to left on a iPhone 5.
    and lets say the ledge is 100 pixels across and 50 pixels high

    in the ledge make this rule:

    when self.position X is equal or less then 284

    spawn actor ledge at X 618 Y 25 relative to scene

    you can randomize the ledge shape and size by adding another attribute into all your ledge actors.

    add a index called ledge type
    and change self.ledge type to random 1 to whatever the total amount of ledge actors.

    then wrap the previous rule into

    if self ledge type = 1
    when self.position X is equal or less the 284
    spawn actor ledge type 1 at X 618 Y 25 relative to scene

    if self ledge type = 2
    when self.position X is equal or less the 284
    spawn actor ledge type 2 at X 618 Y 25 relative to scene

    etc.

    you might need to change the spawn locations based on the different ledge sizes, but this will allow random ledges without using those dang timers :)

Sign In or Register to comment.