Plattform Verssion 1
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user