mirror of
https://github.com/jneug/zeichenmaschine.git
synced 2026-10-12 09:56:33 +02:00
Hehomon Beispiel
This commit is contained in:
47
examples/zm_hehomon/HehomonGame.java
Normal file
47
examples/zm_hehomon/HehomonGame.java
Normal file
@@ -0,0 +1,47 @@
|
||||
import schule.ngb.zm.Zeichenmaschine;
|
||||
import schule.ngb.zm.shapes.Picture;
|
||||
|
||||
public class HehomonGame extends Zeichenmaschine {
|
||||
|
||||
public static void main( String[] args ) {
|
||||
new HehomonGame();
|
||||
}
|
||||
|
||||
|
||||
private Hehomon attacker, defender;
|
||||
|
||||
private Hitpoints hpAttacker, hpDefender;
|
||||
|
||||
public HehomonGame() {
|
||||
super(1024, 768, "ZM: Hehomon");
|
||||
//setFullscreen(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setup() {
|
||||
attacker = new Alligung();
|
||||
defender = new Salamanyte();
|
||||
|
||||
hpAttacker = new Hitpoints(200, 400, attacker);
|
||||
hpDefender = new Hitpoints(width-100, 400, defender);
|
||||
|
||||
shapes.add(new Picture(200, 100, "images/"+attacker.getBild()));
|
||||
shapes.add(new Picture(width-200, 100, "images/"+defender.getBild()));
|
||||
shapes.add(hpAttacker, hpDefender);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void update( double delta ) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void keyPressed() {
|
||||
attacker.nimmSchaden(random(0, 10));
|
||||
defender.nimmSchaden(random(0, 10));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user