mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-10-12 09:56:33 +02:00
Hehomon Beispiel implementiert
Noch Bugs bei Verwendung des Vollbildmodus vorhanden
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import schule.ngb.zm.Drawable;
|
||||
import schule.ngb.zm.Options;
|
||||
import schule.ngb.zm.Updatable;
|
||||
import schule.ngb.zm.shapes.Picture;
|
||||
|
||||
public class Hehomon {
|
||||
public class Hehomon extends Picture implements Updatable {
|
||||
|
||||
private String name, typ, bild;
|
||||
|
||||
@@ -14,7 +15,11 @@ public class Hehomon {
|
||||
|
||||
private String angr1, angr2, vert1, vert2;
|
||||
|
||||
private double sinOffset;
|
||||
|
||||
public Hehomon( String pName, String pTyp, int pLp, int pAngr, int pVert, String pAngr1, String pAngr2, String pVert1, String pVert2, String pBild ) {
|
||||
super(0, 0, "images/" + pBild);
|
||||
|
||||
name = pName;
|
||||
lp = pLp;
|
||||
lpMax = pLp;
|
||||
@@ -25,6 +30,8 @@ public class Hehomon {
|
||||
vert1 = pVert1;
|
||||
vert2 = pVert2;
|
||||
bild = pBild;
|
||||
|
||||
sinOffset = random(-PI, PI);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
@@ -127,4 +134,14 @@ public class Hehomon {
|
||||
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update( double delta ) {
|
||||
double deltaY = sin(runtime / 800.0 * PI + sinOffset);
|
||||
this.move(0.0, deltaY);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user