Spawning Polygon Platforms?

BackUpAndDownBackUpAndDown Member Posts: 685
edited November -1 in Working with GS (Mac)
Hey, I have a game that has a never ending scrolling world and as the is scrolls I need it to spawn platforms. The only problem is that I want to platforms to be "oddly" shaped.

I know i'll have to spawn some invisible platforms and some how constrain them... but how? Any tips would be appreciated. If you need a visual the only thing I can think of is the platforms in Robot unicorn attack.

Thanks

Comments

  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Well you would put a middle piece. Then have global attributes call it center x have it real and center y real. In the middle piece actor constrain attribute self position x to center x, and self position y to center y. Then set up the sides of the polygon so there angled how they need to be. And in each side piece you constrain self position x and self position y to center x + or - a number and then y to center y + or - a number. You gonna have to play around with the numbers to find the exact numbers to add or subtract to center x and y. If its to the left of the middle it will be- a number, and if its right it will be plus a number. Once you get those numbers so they stay in the right spot it will stay put together as a polygon, because the sides stick to the rotation and position on the center with there constrains.

    And for the second part, dont spawn the polygon. Have it set up outside the screen and change its position to wherever you want it to spawn. It doesnt matter wherethe center changes position to , because the polygon will stay together.

    Also on all the sides of the polygon have fixed rotation checked.

    If you need more help or more explanation let me know,

    John :)
Sign In or Register to comment.