putting objects on platform jump n run game

arkonllfarkonllf Member Posts: 118
edited November -1 in Working with GS (Mac)
i am working on a jump n run game and it is going great!
i got it almast all done but i want some of the platforms to have objects on them like stars monsters and more. any idea how to do that?(the platforms come in to the screen by spawn actor).

Comments

  • arkonllfarkonllf Member Posts: 118
    up
  • arkonllfarkonllf Member Posts: 118
    Up...please help me=]
  • POMPOM Member Posts: 2,599
    hey
    i have a quick solution for you,
    create 2 game.attributes - real - call them collectiblesX and collectiblesY
    now:
    in you platform actor create an attribute - integer - call it "spawn collectibles"
    and put change attribute in the actor :
    change self.spawn collectibles to random(1,10)

    Than make a rule in the actor:
    if self.spawn collectibles = 10
    spawn star .
    Constrain game.collectiblesX to self.Position.X
    Constrain game.collectiblesY to self.Position.Y+50 (or any other number cause you want the star to be on the platform)

    in your star actor
    make 2 constrains:
    Constrain self.Position.X to game.collectiblesX
    Constrain self.Position.Y to game.collectiblesY

    that way it will follow the platform.
    *************************************************

    This method will work for you but i suggest you just spawn start/monsters anyway on the screen and not constrain them to the platforms cause constrains take lots of resources and decrease FPS.

    Roy.
  • arkonllfarkonllf Member Posts: 118
    Thank you soo much man you helped me a lot.
    If i will post ths to the app store i will give you credit.
  • POMPOM Member Posts: 2,599
    arkonllf said:
    Thank you soo much man you helped me a lot.
    If i will post ths to the app store i will give you credit.

    You very much welcome mate , no need to credit.

    Roy.
Sign In or Register to comment.