@groegeel
That would creat a image for every actor, if you get a lot of actors in your world(500 for e.g.)
It will cost a lot of memory of your Android device.
But use setImage() in every constructor is also a good idea to unity the code
private void prepare() { Wheel wheel = new Wheel(); addObject(wheel, 100, 100); Ball ball = new Ball(); addObject(ball, 100, 100); ClassImageManager.setClassImage(ball, ball.png); }
public void act() { if (altitude <= 0) { touchdown(); } else { if (health>0) { fly(4); Airport world = (Airport)getWorld(); if (Greenfoot.mouseClicked(world)) { turnTowards(Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY()); } lowerAltitude(); } } }
public void act() { if (altitude <= 0) { touchdown(); } else { if (health>0) { fly(4); Airport world = (Airport)getWorld(); if (Greenfoot.mouseClicked(world)) { turnTowards(Greenfoot.getMouseInfo().getX(), Greenfoot.getMouseInfo().getY()); } lowerAltitude(); } } }