I recently started using Greenfoot/Java for school and I wanted to know how i can vertically and horizontally turn my object after using turnAtEdge , by using Gimp2.
I already figured how to turn the image the way that it is correct after it has been turned vertically and horizontally. This is the current situation:
Baseclass
^
\____Wolf
^
\______BackForthWolf
import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)
/**
* the Wolf is trying to get LittleRedcap
*
* @author (***** ****)
* @version (*-*-****)
*/
public class BackForthWolf extends Wolf
{
private int marge=90;
public void act()
{
move(4);
turnAtEdge();
eatLitteRedCap();
}
/**
* turns the Wolf at the edge in another rotation.
* The rotation depends on wich side the wolf is located.
*/
public void turnAtEdge()
{
int min=0;
int max=135;
if(atWorldEdge())
{
//east
if (getX()>570)
{
max=(180);
}
//west
if (getX()<30)
{
max=(360);
}
setRotation(max);
}
}
