Touch Screen but highlight different area!

I was wondering if it is possible and how to add a feature where you touch one part of a grid but the space two above it gets highlighted.

Each box is a separate instance of one actor and they are exactly space with 1 unit between them. The Grid is a 12x14 pattern.

I would like this feature so that your figure wouldn't get into the way of the highlighted box.

If there is any other information needed please let me know.

Thank you for your help!

Comments

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2012
    When ALL
    mouse button is down
    game.mouse.position.X greater than or equal to self.position.X - self.size.width/2
    game.mouse.position.X less than or equal to self.position.X + self.size.width/2
    game.mouse.position.Y less than or equal to self.position.Y - self.size.height*1.5 - 2
    game.mouse.position.Y greater than or equal to self.position.Y - self.size.height*2.5 - 2
    Then
    [highlight me]

    That's just off the top of my head...

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    edited December 2012
    Another way to do this is to give each instance of the actor self.row and self.column attributes (index) and type them in manually once so that each actor has its own record of where in the grid it is.

    Then for the rule, use When Touch is Pressed ... Change Attribute game.touchedColumn and game.touchedRow to self.column and self.row; When self.column=game.touchedColumn AND self.row=game.touchedRow+2 ... [highlight me]

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949
    Here's a demo of the first method:

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

  • tatiangtatiang Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

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

Sign In or Register to comment.