actor in front an another in movement

akichan22akichan22 Member Posts: 9
edited March 2012 in Working with GS (Mac)
Hi, i need one more time your help,
How can i put an actor n front an another?
i have a top view of the game, so my character can move 360degrees i need to put always in front of him
another actor, that must obviusly rotate with the first actor! like if he bring a bag or a sword.

Right now my only idea was to put the same rotation at the "item" and then move it for a few, like 0.3 second,
but i prefer to change its self.X,Y attribute

sorry for bad english, thanks for help

Best Answer

  • GreenHavenGamesGreenHavenGames Posts: 62
    Accepted Answer
    Sorry, I misunderstood the original question! I imagined that your actor was orbiting, not rotating. There are quite a few posts on this same question. Look for Ferris Wheel, except don't make the cart stay with the horizon.
    Deep Blue Apps has a template called Menu Level Select that will accomplish this concept (give you the math) with a bit of tweaking. Tshirtbooth has a template called (I think) Circle Level Select. Both of these gentlemen deserve your business and you will gain much more by analyzing existing templates.
    Good luck!

Answers

  • GreenHavenGamesGreenHavenGames Member Posts: 62
    I would create three real game.attributes. Name them ActorX, ActorY, and ActorAngle. In the actor, constrain self.positionx, selfpositiony, and, vectortoangle to the game.ActorX, ActorY, and ActorAngle (this will be three seperate constrain behaviors). Then in the item that you want to constrain to the actor make a rule that says, constrain game.ActorX, ActorY, and ActorAngle to self.positionx, self.position y, and self.vectortoangle.
    Wrap the rule in whatever conditions are needed (if sword1 is true, then). You could then place the actor in each scene on the outside edge of the scene on a layer above the primary actor. Or, you could put a rule in the primary actor to spawn sword1 in front of actor.
    By using the constrain method you can add a plus or minus to the ActorX and ActorY (in the items contrain behavior) to position right where you need it.
    Hope this helps. If you need examples or for me to be more clear anywhere let me know. I hope I am understanding your question!

    Braidrock
  • akichan22akichan22 Member Posts: 9
    but if the hero rotate on himself, the X,Y of the sword became wrong!
    or i don't understand.. u can make item big like the actor, but i cant do that, i need the item exactly in front of the actor, i need to find a string of code that put the item in a x.y of a circumference around the actor, and rotate whit him.
Sign In or Register to comment.