2016-02-16 03:42:12 -05:00
|
|
|
package diveengine2d;
|
|
|
|
|
|
|
|
|
|
public class RigidBody extends DiveScript{
|
|
|
|
|
|
2016-02-16 04:04:05 -05:00
|
|
|
public float dx, dy, drot;
|
|
|
|
|
public float friction = 0.99f;
|
|
|
|
|
|
2016-02-16 03:42:12 -05:00
|
|
|
public void update() {
|
2016-02-16 04:04:05 -05:00
|
|
|
entity.x += dx;
|
|
|
|
|
entity.y += dy;
|
|
|
|
|
entity.rotation += drot;
|
|
|
|
|
dx *= .3;
|
|
|
|
|
dy *= .3;
|
|
|
|
|
drot *= .3;
|
2016-02-16 03:42:12 -05:00
|
|
|
}
|
|
|
|
|
}
|