Test classes

This commit is contained in:
ngb
2021-12-30 18:07:00 +01:00
parent 1a3be1b485
commit 8505c2baf4
11 changed files with 843 additions and 82 deletions

View File

@@ -0,0 +1,38 @@
import schule.ngb.zm.*;
import schule.ngb.zm.formen.*;
public class Mover extends Circle implements Updatable {
private Vector velocity;
private Vector acceleration = new Vector();
public Mover( int x, int pY ) {
this(x, pY, new Vector());
}
public Mover( int x, int pY, Vector pVelocity ) {
super(x, pY, 10);
this.velocity = pVelocity.copy();
}
public void applyForce( Vector force ) {
acceleration.add(force);
}
public boolean isActive() {
return true;
}
public void update( double delta ) {
acceleration.scale(delta);
velocity.add(acceleration);
acceleration.scale(0.0);
this.x += velocity.x;
this.y += velocity.y;
}
}