MovingPlattformsUpdate
This commit is contained in:
@@ -9,7 +9,7 @@ import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
|
||||
public class MovingPlattform extends Plattform
|
||||
{
|
||||
int speed;
|
||||
|
||||
int temp=0;
|
||||
public MovingPlattform(int pSpeed)
|
||||
{
|
||||
speed= pSpeed;
|
||||
@@ -42,10 +42,11 @@ public class MovingPlattform extends Plattform
|
||||
{
|
||||
if(this.PlayerOnPlattform())
|
||||
{
|
||||
Actor DerSpieler = this.getOneObjectAtOffset(0, -40, Player.class);
|
||||
World theWorld= this.getWorld();
|
||||
Player DerSpieler = theWorld.getObjects(Player.class).get(0);
|
||||
if(DerSpieler!=null)
|
||||
{
|
||||
DerSpieler.setLocation(DerSpieler.getX()+speed, DerSpieler.getY());
|
||||
DerSpieler.setLocation(DerSpieler.getX()+speed*3, DerSpieler.getY());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user