GameSalad

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

locations question?

ownage11ownage11 Posts: 39Member
edited April 2012 in Working with GS (Mac)
Ok, so normally when you want to set your self.position to some attribute you have to do self.position x = (whatever attribute x)
and self.position y=(whatever attribute y) right? So you have to do 2 things, your x, and your y.
I was wondering though if you could do 1 thing, like say set self.positionx,self.positiony to (whatever att x,whatever att y)

However, I tried doing that and it didn't work for some reason.
There is a super long explanation for why I need this to happen, but you don't really need to know because its a lot of reading.

So, is there any way to find out if a location of something = a location of something else w out having to make 2 attributes x and y?




Best Answer

  • tatiangtatiang Posts: 11,838Member, Sous Chef, PRO, Senior Sous-Chef
    Accepted Answer
    You can use the magnitude math function which measures the distance between two points. If the magnitude equals zero, then the two actors' centers are in the same exact location.

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

This discussion has been closed.