i am trying to make a draggable map with inertia,friction, i'm kindda lost right now example: http://www.emanueleferonato.com/2016/01/18/how-to-create-a-html-draggable-and-scrollable-map-with-inertia-using-phaser-framework/
This is what i have so far:
override public void update()
{
base.update();
if (getState() == STATE_DRAGGING)
{
if (Input.Mouse.pressed())
{
setVelocityX(drag_x - Input.Mouse.getX());
}
}
if (getState() == STATE_STALE)
{
if (CMouse.pressed())
{
drag_x = Input.Mouse.getX();
drag_y = Input.Mouse.getY();
setState(STATE_DRAGGING);
}
}}