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
+4 -4
View File
@@ -22,17 +22,17 @@ public class MovingPlattform extends Plattform
public void act()
{
// Add your action code here.
super.act();
this.bewege();
super.act();
}
public void bewege()
{
MyWorld theWorld= (MyWorld) this.getWorld();
move(speed);
if(this.getX()<5 || this.getX()<=theWorld.getWidth())
this.setLocation(this.getX()+speed, this.getY());
if(this.getX()<5 || this.getX()>=theWorld.getWidth()-5)
{
this.loescheMich();
speed=speed*(-1);
}
}
}