Limit speed of drag

alexander144alexander144 Member Posts: 93
edited November -1 in Working with GS (Mac)
I have an actor that is able to be dragged left and right however I can keep rushing it really fast left and right and I want it to be limited to a speed I assign. Is it possible to do this and if so, how?

Comments

  • DrGlickertDrGlickert Member Posts: 1,135
    Do you have the box, 'Max Speed' checked? In each actor on the left side (inspector panel), under the "motion" arrow, click the Max Speed box and put a value in for the max speed.
  • alexander144alexander144 Member Posts: 93
    Tried that but I can still drag it around as fast as I want :(
  • PhoticsPhotics Member Posts: 4,172
    Maybe a Move To behavior would work instead. The actor could move to the touch point, when the touch originates from within the actor.
  • alexander144alexander144 Member Posts: 93
    Thanks but how do I do that? Is there a tutorial or something?
  • MotherHooseMotherHoose Member Posts: 2,456
    I would use Interpolate:

    Rule when
    Actor receives event touch is pressed (touch)
    (in the behavior for that rule)
    --Rule when
    --- Actor receives event touch is outside (drag)
    ----self.Position.X To: touch1.Position.X
    and set the speed in Duration:

    and you need another Interpolate for the self.Position.Y...replace the Xs above with Ys.

    MH
  • alexander144alexander144 Member Posts: 93
    Hmm it isn't really working to well. Have a look at how I set it up please and let me know if I did anything wrong. http://img854.imageshack.us/i/testdx.png/
  • ozboybrianozboybrian PRO Posts: 2,102
    I think you would need a couple attributes, one for speed.
    Game.Speed relative to position or something.

    I would suggest asking Tshirt Booth about this one.

    -----------------------------------------------------
    Join the GameSalad Community and have your game noticed for free.
    http://www.facebook.com/pages/List-your-TOP-iPhone-game/170419832993723
    List your Top iPhone Game on FaceBook!
  • JohnPapiomitisJohnPapiomitis Member Posts: 6,256
    Have a rule in whatever you want to drag when actor recieves event touch is pressed

    drag a timer in that rule and set it to every 0 seconds

    Then put a move behavior in that timer, put the x postiion mouse position x, and the y postion mouse position y relative to scene

    Then in speed put whatever you want the max speed to be

    Cheers
Sign In or Register to comment.