Mouse control on actor's movement

drixz97462drixz97462 Member Posts: 10
edited November -1 in Working with GS (Mac)
Hi all,

I've been experimenting a few motion controls on an actor but stumbled on this issue.

Say there's an actor A on the screen. Now what I want to do is:

1. Click on Actor 'A'.
2. Click other areas on the screen that's not Actor 'A'.
3. Make it travel towards the area that I've just clicked.

What I'm doing so is using a combination of these to achieve the desired result:

1. "Mouse over actor, Mouse button pressed down" Rule.
2. "After 0 seconds, does the following until completion" Timer.
3. "X position: Mouse.Position.X, Y position: Mouse.Position.Y" Move-to Behavior.

And what I got is the actor would rapidly follows the mouse pointer until it reaches that pointer, rather than moving towards the clicked position.

Is there any other alternatives or ways to stop it from constantly picking the mouse pointer position and changing the direction of movement?

And btw is there a better to achieve some sort of while() loop in gamesalad? Based on my understanding the Timer behavior doesn't have an exit condition and would loop forever after a 'after', 'when' and 'every' seconds condition is true.

Finally, can the mouse control like mouse.pressed.down be used as a iPhone control mechanism? Or does it achieve the same function as touching on the iPhone's screen?

Comments

  • JGary321JGary321 Member Posts: 1,246
    http://gamesalad.com/wiki/how_tos

    wiki's are useful tools. :)

    You will find you answer there. Also the mouse is considered the finger once iPhone support comes.

    As for looping you can put one timer in another.

    Putting an Every timer Within a For timer solves the endless loop problem.
  • drixz97462drixz97462 Member Posts: 10
    Thanks for the prompt reply! Can't believe that I looked past on that "Accelerate towards" behavior! Will give this a go later tonight ^^

    And thanks for the timer tip too =)
  • JGary321JGary321 Member Posts: 1,246
    No prob.
Sign In or Register to comment.