SpikedPlattforms2

This commit is contained in:
2026-09-16 11:48:19 +02:00
parent 6127510ec8
commit 56b755b3d6
17 changed files with 244 additions and 79 deletions
+14
View File
@@ -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());
}
}
}
}