Working out distance

chrisalchrisal Member Posts: 74
edited November -1 in Working with GS (Mac)
Hi,

I think my question can be answered in one word "no", but just incase I shall ask it!

Can gamesalad work out the distance between to actors???

Many thanks
chris

Comments

  • EastboundEastbound Member, BASIC Posts: 1,074
    Yes it can, but at least one of the actors needs it's position constrained in global variables.

    For instance, you could find the magnitude (distance) of self.position (x and y) and any object with global variables telling its position.
  • mrfunkleberrymrfunkleberry Member Posts: 424
    use the magnitude(x, y) expression...

    magnitude(actor1.X - actor2.x, actor1.y - actor2.y)

    ooops. sorry i was beaten to it
  • chrisalchrisal Member Posts: 74
    is there anything that gamesalad cannot do!!!

    Is there any tutorials??? Might just try it for myself

    cheers
  • EastboundEastbound Member, BASIC Posts: 1,074
    Firemaplegames has made a magnitude demo. Just search for it in the templates.
  • quantumsheepquantumsheep Member Posts: 8,188
    chrisal said:
    is there anything that gamesalad cannot do!!!

    Plenty. A simple pause is just one example ;)

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • zombieninjaszombieninjas Member Posts: 10
    I was just about to ask the same thing. I was trying to figure out how to delay an actor from spawning instances until the player is within a specified distance.

    It looks like this will solve that... I'm glad that this community isn't full of wanna-be elitist programmers that scoff at anyone with a simple question, like some game engine communities...

    *cough* Garage Games *cough*

    Personal experience... I'm sure it's not that way for everyone.
  • quantumsheepquantumsheep Member Posts: 8,188
    Empathy is a wonderful thing :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • chrisalchrisal Member Posts: 74
    Think I am over my head a little but i am keeping going!!!!
Sign In or Register to comment.