Hi. Just wondering what is the best way to declare and assign variables for animating objects. Both work but I not sure which is better. What is the difference? Why should I choose one over the other?
------------------------------------------------------------ OR ----------------------------------------------------------
public class Plane extends Actor
{
private GreenfootImage image1;
private GreenfootImage image2;
public Plane()
{
image1 = new GreenfootImage("plane1.png");
image2 = new GreenfootImage("plane2.png");
}public class Plane extends Actor
{
private GreenfootImage image1 = new GreenfootImage("plane1.png");
private GreenfootImage image2 = new GreenfootImage("plane2.png");
public Plane()
{
}
