import greenfoot.*;
/**
* Write a description of class Bluetank here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class Bluetank extends Actor
{
/**
* Act - do whatever the Bluetank wants to do. This method is called whenever
* the 'Act' or 'Run' button gets pressed in the environment.
*/
public void act()
{
if(Greenfoot.isKeyDown("w"))
{ if(!(isTouching(Wall.class)) )
move(4);
else
{
move(-4);
}
}
if(Greenfoot.isKeyDown("a"))
{ if(!(isTouching(Wall.class)) )
turn(-5);
}
if(Greenfoot.isKeyDown("d"))
{ if(!(isTouching(Wall.class)) )
turn(5);
}
if(Greenfoot.isKeyDown("s"))
{ if(!(isTouching(Wall.class)) )
move(-4);
else
{
move(4);
}
}
}

