How can I specify the area of target for collision?

2»

Answers

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

    @Socks said:
    10 percent from the top is 40 percent from the centre.

    Voodoo! Or math. Not sure which.

    ok, i get it, i'll state that if it's > 40 percent then.... whatever.

    You would need ≥ 40% of the height from the center. The center Y value is self.Position.Y so you'd want to check to see if the position of the bullet/target is ≥ 0.4*self.Size.Height+self.Position.Y AND ≤ self.Size.Height/2+self.position.Y.

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

  • Dell7730Dell7730 Member, PRO Posts: 388

    @tatiang said:
    You would need ≥ 40% of the height from the center. The center Y value is self.Position.Y so you'd want to check to see if the position of the bullet/target is ≥ 0.4*self.Size.Height+self.Position.Y AND ≤ self.Size.Height/2+self.position.Y.

    holy s*** you just rattled what little brain I have haha, thanks though

  • SocksSocks London, UK.Member Posts: 12,822
    edited April 2015

    @tatiang said:
    Voodoo! Or math. Not sure which.

    :D :)

Sign In or Register to comment.