if (container == null && Greenfoot.isKeyDown("p"))
{
move(getImage().getWidth()/2);
container = (Container7) getOneObjectAtOffset(0, 0, Container7.class);
move(-getImage().getWidth()/2);
}
if (container == null && Greenfoot.isKeyDown("p"))
{
move(getImage().getWidth()/2);
container = (Container7) getOneObjectAtOffset(0, 0, Container7.class);
move(-getImage().getWidth()/2);
} import greenfoot.*;
public class Container7 extends Container1
{
Ship1 ship;
public Container7()
{
}
public Container7 (Ship1 s)
{
ship = s;
}
public void act()
{
int x = ship.getX()-18;
int y = ship.getY()-38;
setLocation(x, y);
}
} public void act()
{
if(ship != null)
{
int x = ship.getX()-18;
int y = ship.getY()-38;
setLocation(x, y);
}
if (container != null && Greenfoot.isKeyDown("d")) {
container = null;
}
public void act()
{
if(ship != null)
{
int x = ship.getX()-18;
int y = ship.getY()-38;
setLocation(x, y);
}
if (container != null && Greenfoot.isKeyDown("d")) {
container = null;
}
public void act()
{
if(schip != null)
{
int x = schip.getX()-18;
int y = schip.getY()-38;
setLocation(x, y);
}