Compare commits
4 Commits
1fbc555d31
...
c1de4dad10
| Author | SHA1 | Date | |
|---|---|---|---|
| c1de4dad10 | |||
| fe9208291f | |||
| 2e11569755 | |||
| 964725a81c |
@@ -1,8 +0,0 @@
|
||||
#BlueJ class context
|
||||
comment0.target=Healthbar
|
||||
comment0.text=\r\n\ Write\ a\ description\ of\ class\ Healthbar\ here.\r\n\ \r\n\ @author\ (your\ name)\ \r\n\ @version\ (a\ version\ number\ or\ a\ date)\r\n
|
||||
comment1.params=
|
||||
comment1.target=void\ act()
|
||||
comment2.params=
|
||||
comment2.target=void\ draw_health()
|
||||
numComments=3
|
||||
@@ -1,20 +0,0 @@
|
||||
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
|
||||
/**
|
||||
* Write a description of class Healthbar here.
|
||||
*
|
||||
* @author (your name)
|
||||
* @version (a version number or a date)
|
||||
*/
|
||||
public class Healthbar extends Actor
|
||||
{
|
||||
public void act()
|
||||
{
|
||||
draw_health();
|
||||
}
|
||||
|
||||
public void draw_health(){
|
||||
Player player = getWorld().getObjects(Player.class).get(0);
|
||||
setImage(new GreenfootImage("Health:" + player.health, 24, Color.WHITE, Color.BLACK));
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
public class MyWorld extends World
|
||||
{
|
||||
int PlattformCountdown;
|
||||
int timer = 300; //Zeit, bevor das erste Projektil auftaucht
|
||||
int timer = 600; //Zeit, bevor das erste Projektil auftaucht
|
||||
//kann später noch beliebig angepasst werden
|
||||
int targetTimer = 1000;
|
||||
int time = 0;
|
||||
@@ -58,8 +58,6 @@ public class MyWorld extends World
|
||||
plattform2.setLocation(320,367);
|
||||
plattform2.setLocation(312,371);
|
||||
plattform2.setLocation(308,382);
|
||||
//Healthbar healthbar = new Healthbar();
|
||||
//addObject(healthbar,50,50);
|
||||
Heart heart = new Heart();
|
||||
addObject(heart,371,27);
|
||||
Heart heart2 = new Heart();
|
||||
@@ -144,7 +142,7 @@ public class MyWorld extends World
|
||||
if(timer == 0){
|
||||
Projectile projectile = new Projectile();
|
||||
addObject(projectile,Greenfoot.getRandomNumber(300)+50,0);
|
||||
timer = 300; //zeitlicher Abstand
|
||||
timer = 600; //zeitlicher Abstand
|
||||
}
|
||||
else{
|
||||
timer = timer - 1;
|
||||
|
||||
@@ -41,7 +41,7 @@ public class TemporaryGround extends Plattform
|
||||
|
||||
public void warning()
|
||||
{
|
||||
this.setImage("TemporaryIsBreaking.png");
|
||||
this.setImage("BreakingGround.png");
|
||||
warningHasHappend=true;
|
||||
deWarningHasHappend=false;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 139 B |
|
After Width: | Height: | Size: 4.7 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 707 B |
|
After Width: | Height: | Size: 2.4 KiB |