I am in the process of making a maze game. I am new to Greenfoot. One problem I encountered while trying to make my maze game is that the player can go through walls. How would I stop this? Thanks. Please reply fast!
public void act()
{
if (Greenfoot.isKeyDown("left"))
{
setRotation(180);
move(4);
}
if (Greenfoot.isKeyDown("right"))
{
setRotation(0);
move(4);
}
if (Greenfoot.isKeyDown("up"))
{
setRotation(270);
move(4);
}
if (Greenfoot.isKeyDown("down"))
{
setRotation(90);
move(4);
}
}