Plattform Verssion 1

This commit is contained in:
2026-09-15 11:53:27 +02:00
parent 903d791b6b
commit d9f0219cf1
18 changed files with 125 additions and 44 deletions
+22 -7
View File
@@ -8,25 +8,40 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
*/
public class BreakingPlattform extends Plattform
{
boolean IsBreaking= false;
boolean IsBreaking= false;
int BreakingCountdown;
public BreakingPlattform(int pBreakingCountdown)
{
BreakingCountdown=pBreakingCountdown;
}
/**
* Act - do whatever the BreakingPlattform wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
super.act();
if(this.PlayerOnPlattform() && IsBreaking==false)
{
IsBreaking= true;
IsBreaking= true;
//Greenfoot.playSound("...")
this.setImage("BreakingPlattform2.png"); //untested
}
if(IsBreaking)
{
BreakingCountdown--;
if(BreakingCountdown==0)
{
this.breakPlattform();
}
}
super.act();
}
public void breakPlattform()
{
if(this.PlayerOnPlattform())
{
}
//Animation
geloescht=true;
}
}