Skip to content

Commit 5501cf8

Browse files
committed
Add reset()
1 parent f7a365c commit 5501cf8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

joy/Joystick.hx

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ class Joystick extends Point
3131
this.id = id;
3232
}
3333

34+
public function reset()
35+
{
36+
center.x += x * radius;
37+
center.y += y * radius;
38+
39+
x = 0;
40+
y = 0;
41+
42+
draw();
43+
}
44+
3445
override public function toString():String
3546
{
3647
return "[ Joystick " + id + " (" + x + ", " + y + ") ]";

0 commit comments

Comments
 (0)