I came up with an error, really all the rest is adding about 700 more actors at least, probably gonna be nearing 1000
if (actCounter > 0) actCounter--;
if (actCounter == 0)
{
loseScore();
actCounter = 61;
}int stopMoving = 0;
public void endTheGame()
{
Actor EndPad = getOneObjectInFront(EndPad.class);
if(EndPad != null)
{
stopMoving = 1;
}
}
public void act()
{
movement();
getPoints();
endTheGame();
}
public Player()
{
GreenfootImage myImage = getImage();
int myNewHeight = (int)myImage.getHeight()/3;
int myNewWidth = (int)myImage.getWidth()/3;
myImage.scale(myNewWidth, myNewHeight);
}
public void movement()
{
if(Greenfoot.isKeyDown("right"))
{
setRotation(0);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
if(Greenfoot.isKeyDown("left"))
{
setRotation(180);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
if(Greenfoot.isKeyDown("up"))
{
setRotation(270);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
if(Greenfoot.isKeyDown("down"))
{
setRotation(90);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
}public boolean noMove = false;
public int stopMoving = 0;
public void endTheGame()
{
Actor EndPad = getOneObjectInFront(EndPad.class);
if(EndPad != null)
{
stopMoving = 1;
noMove = true;
}
}
public void act()
{
movement();
getPoints();
endTheGame();
}
public Player()
{
GreenfootImage myImage = getImage();
int myNewHeight = (int)myImage.getHeight()/3;
int myNewWidth = (int)myImage.getWidth()/3;
myImage.scale(myNewWidth, myNewHeight);
}
public void movement()
{
if(Greenfoot.isKeyDown("right"))
{
setRotation(0);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
if(Greenfoot.isKeyDown("left"))
{
setRotation(180);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
if(Greenfoot.isKeyDown("up"))
{
setRotation(270);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
if(Greenfoot.isKeyDown("down"))
{
setRotation(90);
if(getOneObjectInFront(Wall.class)==null)
if(getOneObjectInFront(Maze.class)==null)
if(getOneObjectInFront(LaserWall.class)==null)
if(stopMoving == 0)
move(3);
}
}public boolean noMove;
private int actCycles = -300;
public void countingCycles()
{
actCycles++;
if (actCycles == 30)
{
getScoreCounter().loseScore();
actCycles = 0;
}
if(noMove = true)
{
actCycles = 31;
}
}