Report as inappropriate.
This scenario demonstrates some of the differences between the GifImage class (supplied by greenfoot) and the Animation class (by danpost). I made use of the GifImage class to decode the 'gif' image file to get the images for the Animation class just to show how that can be done.
* GifImage object "continues" (without updating) to run while the scenario is stopped while Animation object starts and stops with the scenario;
-test by clicking 'Pause/Run' button -- GifImage object may "jump" to a frame while Animation object does not;
* GifImage objects may jump frames when the scenario speed is dramatically reduced and the frame rate remains constant when the scenario speed is otherwise altered; Animation objects alter their speed dependent on the scenario speed;
-test by changing the speed of the scenario with the speed slider;
* the GifImage class can display frames for different amounts of time (which, by the way, is determined by the 'gif' file and cannot be changed) while all frames will be displayed about the same amount of time by the Animation class;
* a GifImage object must be created for each animation image set while an Animation object has a changeable image set;
* a GifImage object just holds the image set and frame times and informs the object using it what image to use when asked; an Animation object is assigned an object and updates the image of the object when necessary (under the control of that object);
3184 views / 272 in the last 7 days
3 votes | 0 in the last 7 days
This scenario is a member of: Demos by danpost
Want to leave a comment? You must first log in.