swipe angle (question)

gamedivisiongamedivision Member Posts: 807
edited August 2012 in Working with GS (Mac)
i know we can detect swipe left right up and down is it possible to detect the angle of swipe,then have an actor respond depending on the angle.

thanks

Comments

  • RThurmanRThurman Member, Sous Chef, PRO Posts: 2,881
    Make three attributes: swipeAngle, beginX and beginY

    Rule: When mouseDown
    -- Change Attribute: beginX To: game.Mouse.Position.X
    -- Change Attribute: beginY To: game.Mouse.Position.Y

    Rule: When mouseUp
    -- Change Attribute: swipeAngle To: vectorToAngle( game.Mouse.Position.X - self.beginX , game.Mouse.Position.Y - self.beginY )

    Its not perfect, but it demonstrates the principle.
Sign In or Register to comment.