toggle menu
Categories
Discussions
Dashboard
Sign In
·
Register
Sign In
·
Register
Categories
Discussions
Dashboard
Sign In
·
Register
×
Home
›
GameSalad 101
›
Working with GS (Mac)
swipe angle (question)
gamedivision
Member
Posts:
807
August 2012
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
RThurman
Member, Sous Chef, PRO
Posts:
2,881
August 2012
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.
Comments
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.