GameSalad

How to Tap/Touch a rectangular mask then make an Actor1 move and Hit another Actor2

artloverartlover Posts: 16Member, PRO

Hello :smile:

I have this simple questions:

  1. How to Tap/Touch a rectangular mask then make an Actor1 move and Hit another Actor2.
  2. When the Actor2 Hit by Actor1, Actor2 will be destroyed and another Pen (Actor1) will appear and another Object (Actor2) will appear...and so on.

Thank You Very Much guys! :wink:

(see image below)

Comments

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

    You can communicate between actors by changing the values of game attributes. It's not clear how you want Actor 1 to move but I'll take a stab at #1:

    Rectangle Mask actor:
    If touch is pressed
         Change attribute game.touching to 1
    Else
         Change attribute game.touching to 0

    Actor 1:
    If attribute game.touching = 1
         Move [angle 90] [speed 150]

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

  • artloverartlover Posts: 16Member, PRO

    Hi @tatiang thank you very much for your answer... I'll try this out now :smile:

  • artloverartlover Posts: 16Member, PRO

    Anyway @tatiang I've tried this out, but I wonder where to find the "game.touching" I'm using windows to create games. (see image below) thanks

  • SocksSocks London, UK.Posts: 12,754Member

    @artlover said:
    Anyway @tatiang I've tried this out, but I wonder where to find the "game.touching"

    You make the attribute yourself.

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

    @Socks said:

    @artlover said:
    Anyway @tatiang I've tried this out, but I wonder where to find the "game.touching"

    You make the attribute yourself.

    Yes, anything that's not built into GameSalad can be added. In this case, game.touching would be a custom attribute, an integer.

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

  • artloverartlover Posts: 16Member, PRO
    edited April 28

    Thanks guys @tatiang @Socks :) great info! :smile:

    Thank you

Sign In or Register to comment.