help with this rule

as I can make this rule when the actor one is 20 pixels from the position x and 20 pixels from the pocision of y with respect to the actor two destroyed

Comments

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

    [rule condition for actor #2 being destroyed]
         Change Attribute game.destroyX to self.X
         Change Attribute game.destroyY to self.Y
         Destroy Actor

    [in actor #1...]
         If numeric expression magnitude(self.X-game.destroyX,self.Y-game.destroyY) ≤ 20
              [behaviors]

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

  • SocksSocks London, UK.Member Posts: 12,822
    edited September 2016

    @tatiang said:

         If numeric expression magnitude(self.X,game.destroyX-self.Y, game.destroyY) ≤ 20

    Shouldn't that be x1-x2, y1-y2 ?

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

    @Socks Oops! I knew I was doing that too fast. I'll edit it above.

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

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

    @tatiang said:
    @Socks Oops! I knew I was doing that too fast. I'll edit it above.

    It's too late for that, you've been crossed of the magnitude Christmas party list, looks like it's me and Mateen again this year.

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

    @Socks said:
    looks like it's me and Mateen again this year.

    Lol! So that's what he's been up to.

    I have to be honest, I kind of wanted to be taken off the magnitude Christmas party list. No offense.

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

Sign In or Register to comment.