SpikedPlattforms2
This commit is contained in:
@@ -23,6 +23,7 @@ public class MovingPlattform extends Plattform
|
||||
{
|
||||
// Add your action code here.
|
||||
this.bewege();
|
||||
this.bewegeSpielerMit();
|
||||
super.act();
|
||||
}
|
||||
|
||||
@@ -34,5 +35,18 @@ public class MovingPlattform extends Plattform
|
||||
{
|
||||
speed=speed*(-1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void bewegeSpielerMit()
|
||||
{
|
||||
if(this.PlayerOnPlattform())
|
||||
{
|
||||
Actor DerSpieler = this.getOneObjectAtOffset(0, -40, Player.class);
|
||||
if(DerSpieler!=null)
|
||||
{
|
||||
DerSpieler.setLocation(DerSpieler.getX()+speed, DerSpieler.getY());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user