Hey there :),
I'm currently working on a program where a character is represented as a gif. However, when I implement the gif, the different images overlap (so that when the character is running 2 then 4 then 6 and finally 8 legs appear). Here is my code:
I have implemented the default GifImage class.
Thanks for helping me :)
import greenfoot. This is the code of the character: [code]import greenfoot.*; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) /** * Write a description of class Dude here. * * @author (your name) * @version (a version number or a date) */ public class Dude extends Actor { GifImage myGif = new GifImage("Running character gif.gif"); /** * Act - do whatever the Dude wants to do. This method is called whenever * the 'Act' or 'Run' button gets pressed in the environment. */ public void act() { setImage( myGif.getCurrentImage() ); } }