putting objects on platform jump n run game
![arkonllf](http://forums.gamesalad.com/applications/dashboard/design/images/defaulticon.png)
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).
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
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.
If i will post ths to the app store i will give you credit.
Roy.