The first four correspond to the buttons down below and the associated screens. The actual animation is carried out by having the run method call repaint after every completed cycle. If the drawFlag boolean variable is set to true , then a specified image is drawn at its given co-ordinates by the update method. The use of the two large image buffers Car Jam has a double set of image buffers the size of the applet area, offImage and farImage . When a car is to be moved or a bomb symbol deleted, the applet needs to be able to restore the underlying background, and that data can be fetched from farImage .
Data files The game needs two graphics files, cars.gif and title.gif .
The first one contains the cars, background patterns, trees, etc. The second one only contains the title logo and gets loaded directly into the image title . There are also two audio files, carsnd1.au and carsnd2.au , for the sound of the explosion and the one that plays after a game has been solved. Variables i, j, k, l, m, n are typically counters and similar things. Whenever it is different from 0, some kind of animation is taking place.