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

artloverartlover Member, PRO Posts: 16

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 Member, Sous Chef, PRO, Senior Sous-Chef Posts: 11,949

    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 Member, PRO Posts: 16

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

  • artloverartlover Member, PRO Posts: 16

    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.Member Posts: 12,822

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

    You make the attribute yourself.

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

    @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 Member, PRO Posts: 16
    edited April 2017

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

    Thank you

Sign In or Register to comment.