How do I fix the actor? And about pairing the actors.

gawakamygawakamy Member Posts: 109
edited April 2012 in Working with GS (Mac)
Hi, GS dudes.
Whenever I manage actors, I run into the problem to organize the actors. Some actors are big, but need to be fixed. Like lock function in Adobe illustrator and Photoshop. Anyone knows how to fix the actors?
Second, how to make pairing two (or multiple) actors together? eg. When moster moves, life guage also move together. When moster is disappeard, life guage is also disappeared.

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    Are you wanting to lock the actors in the scene so that they can't be moved, resized, or rotated? If so, there isn't a built-in way to do this. What you can do, though, is to move the actor to a corner of the scene (or make the scene size larger than the playable area and move the actor to the extra space) and then in the actor's rules, have Change Attribute self.position.x, self.position.y, self.size.height, and self.size.width to whatever they should be. Put those behaviors at the top and the actor will show up at the right position and the right size when the scene begins.

    You can constrain an actor's position to another actor's position. One way to do this is to have game-level attributes such as game.MosterX and game.MosterY (both real). On the moster actor have Constrain Attribute game.MosterX to self.position.X and Constrain Attribute game.MosterY to self.position.Y. On the life gauge actor, do the opposite: Constrain self.position.X to game.MosterX and self.position.Y to game.MosterY. The actor's will move together with their centers aligned. If you need to have the life gauge below (or above or to the side of) the moster actor, just do something like Constrain Attribute self.position.Y to game.MosterY-30 and adjust as needed.

    To have the life gauge disappear when the moster disappeared, you also would use a game attribute. You can make an attribute called game.MosterHealth and constrain it to the moster's self.health attribute and then check that from the life gauge actor, or you can have a rule in the moster actor that says When self.health=0 Change Attribute game.MosterDead (a boolean) to true. Then, on the life gauge actor, eitehr destroy the actor or change its self.color.alpha to 0 when game.MosterDead is true.

    (Moster=Monster?)

    There are many good tutorial videos available for GameSalad. Do a Google search for "constrain gamesalad" or "health bars gamesalad" to see examples of this.

    New to GameSalad? (FAQs)   |   Tutorials   |   Templates   |   Greenleaf Games   |   Educator & Certified GameSalad User

Answers

Sign In or Register to comment.