How Do I Change Collide Parameters?

uhyanauhyana Member Posts: 36
edited April 2012 in Working with GS (Mac)
I have multiple wide actors spawning and the user much touch them and slide them into 1 of the 2 slots on the right. I have made it colidable with 3 non movable actors on the right so you must get it in-between them. The thing is that I have purposely cropped these wide actors so that there is a lot of empty space above and below it so it is easier for the user to touch it. Since I did that gamesalad uses that box around the object to collide with the other actors. But if the actor is not cropped like this the actor is too skinny for the user to touch. Basically, how can I make this actor only colidable with like -20 y points from the center of the object on the bottom and top? Or maybe vise-versa. How could I make the actor detect a touch from like 30 y points from the center up and down?

Best Answer

  • tatiangtatiang Posts: 11,949
    Accepted Answer
    There's a simple solution: actor masks. Create another actor and name it "Wide mask" (or whatever you like). Make it larger than your Wide actor (as large as you want the touchable area for the Wide actor to be). Add a behavior to change attribute self.color.alpha to 0 to hide the mask actor. On your Wide actor, constrain attribute game.WideX to self.position.X and game.WideY to self.position.Y (all real attributes). On your Wide Mask actor, constrain attribute self.position.X to game.WideX and self.position.Y to game.WideY. This will make your mask actor "stick" to your Wide actor. Then, take all of your When touch is pressed, etc. rules from your Wide actor and put them in your Wide Mask actor instead.

    Note that you may have to adjust some of the rules if they use the Wide actor's attributes and instead "pass" that information from the Wide Mask actor to the Wide actor via game attributes.

    The effect is that when the player touches the invisible Wide Mask actor, it appears that they have touched the Wide actor and the Wide actor's rules then run.

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

Sign In or Register to comment.