Hi there, I've been working on something for awhile now and am having issues with some of the change in movement. At the moment my code looks like this:
All that this does is go up to the left border and turn then stop. I've tried a few things but nothing is working atm
import greenfoot.*;
public class Enemy2 extends Actor
{
GifImage r = new GifImage ("Rock.gif");
boolean isDown = false;
private GifImage r2 = new GifImage ("Rock2.gif");
boolean move1=false;
public void act()
{
notMoving();
bounceLeft();
bounceRight();
}
public void notMoving()
{
if(move1==false)
{
move(-2);
}
}
public void bounceLeft()
{
if(getX() == 110)
{
move1=true;
move(2);
getImage().mirrorHorizontally();
}
}
public void bounceRight()
{
if(getX() == getWorld().getWidth()-25)
{
move(-2);
move1=true;
getImage().mirrorHorizontally();
}
}
VVV Still working on these last 2 VVV
public void bounceTop()
{
if(getY() == 0)
{
}
}
public void bounceBottom()
{
if(getY() == getWorld().getHeight()-1)
{
}
}
}
