Hello, I am trying to make a Mortal Kombat type game, and I don't know how to make the animation change depending on certain conditions.
Here is my code:
import greenfoot.*;
/**
* Write a description of class FighterTwo here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class FighterOne extends Actor
{
private String fighterState;
private GifImage stand = new GifImage("fighterOneStand.gif");
private GifImage walkBack = new GifImage("fighterOneWalkBa.gif");
public void act()
{
setImage(stand.getCurrentImage());
while(Greenfoot.isKeyDown("a"))
{
setImage(walkBack.getCurrentImage());
}
}
