I'm trying to have the "Tron" bikes face a different direction when i press the arrow keys (also WASD for the other bike) but I need help figuring out why they wont turn when i press the "up" and "left". The bike don't turn but they work when i press the down and right.
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
public class Bike extends Actor
{
private boolean isBikeBlue;
private String up;
private String down;
private String left;
private String right;
public Bike(boolean isBikeBlue)
{
this.isBikeBlue =isBikeBlue;
if (isBikeBlue == true)
{
setImage("bike1.png");
up = "w";
down = "s";
left = "a";
right = "d";
}
else
{
setImage("bike2.png");
up = "up";
down = "down";
left = "left";
right = "right";
}
}
public void act()
{
buildTrail();
movement();
}
public void buildTrail()
{
Trail trail = new Trail(isBikeBlue);
getWorld().addObject (trail,getX(),getY());
}
public void movement()
{
move(5);
if (Greenfoot.isKeyDown(up))
{
setRotation(360);
}
if (Greenfoot.isKeyDown(down))
{
setRotation(90);
}
if (Greenfoot.isKeyDown(left))
{
setRotation(180);
}
if (Greenfoot.isKeyDown(right))
{
setRotation(0);
}
}
}

