Graphical Window Animation

version 3 by Erik Temple

  • Home page
  • Beginning
  • Previous

  • Example: ** Ghostly Rider - A simple animation sequence that fires when we enter a particular location.

    This example provides a sample of the kind of event-based animations that the Graphical Window Animation extension provides by default. Each room has its own illustration, displayed in the graphics window using a modified version of the code from Emily Short's Location Images extension. The animation shows a simple sequence of images built on one of the location illustrations; when the animation ends, the graphics window reverts automatically to the location illustration. While the images depict a figure moving over the room background, the animation is not sprite-based; the background is included in each frame of the animation. The images used in this example, which are modified from Cyril Pedrosa's excellent graphic novel Three Shadows, can be downloaded from More complex animation examples that use sprites and pseudo-sprites can be downloaded from

        "Ghostly Rider"

        Include Graphical Window Animation by Erik Temple.

        Rule for starting the virtual machine:
            now the current graphics drawing rule is the standard placement rule.

        The stop animation when looking rule is listed first in the carry out looking rulebook.

        A room has a figure-name called room-illustration.
        The image-setting rule is listed in the carry out looking rules.

        This is the image-setting rule:
            change currently shown picture to the room-illustration of the location;
            follow the current graphics drawing rule.

        Figure of Dark Street is the file "Street.png". Figure of Bright Street is the file "Bright Street.png". Figure of Rider 01 is the file "Rider 01.png". Figure of Rider 02 is the file "Rider 02.png". Figure of Rider 03 is the file "Rider 03.png". Figure of Rider 04 is the file "Rider 04.png". Figure of Rider 05 is the file "Rider 05.png". Figure of Rider 06 is the file "Rider 06.png". Figure of Rider 07 is the file "Rider 07.png". Figure of Rider 08 is the file "Rider 08.png". Figure of Rider 09 is the file "Rider 09.png". Figure of Rider 10 is the file "Rider 10.png". Figure of Rider 11 is the file "Rider 11.png". Figure of Rider 12 is the file "Rider 12.png". Figure of Rider 13 is the file "Rider 13.png". Figure of Rider 14 is the file "Rider 14.png". Figure of Rider 15 is the file "Rider 15.png". Figure of Rider 16 is the file "Rider 16.png". Figure of Rider 17 is the file "Rider 17.png". Figure of Rider 18 is the file "Rider 18.png". Figure of Rider 19 is the file "Rider 19.png". Figure of Rider 20 is the file "Rider 20.png". Figure of Rider 21 is the file "Rider 21.png".

        The Ghostly Rider reel is a list of figure-names that varies. The ghostly rider reel is {Figure of Rider 01, Figure of Rider 02, Figure of Rider 03, Figure of Rider 04, Figure of Rider 05, Figure of Rider 06, Figure of Rider 07, Figure of Rider 08, Figure of Rider 09, Figure of Rider 10, Figure of Rider 11, Figure of Rider 12, Figure of Rider 13, Figure of Rider 14, Figure of Rider 15, Figure of Rider 16, Figure of Rider 17, Figure of Rider 18, Figure of Rider 19, Figure of Rider 20, Figure of Rider 21}.

        Quiet Street is a room. "The street is silent. [if unvisited]Stucco glows in the moonlight. The street passes through a portico to the south.[otherwise if Silent Street is visited]There is no sign of the rider." The room-illustration is Figure of Bright Street.

        Silent Street is south of Quiet Street. "The only sound is your footfall on the gravel street. [if unvisited]A ghostly rider approaches from the south. It glides north, passing you noiselessly.[otherwise]There is a chill in the air. The rider is gone." The room-illustration is Figure of Dark Street.

        Carry out looking when the player is in Silent Street and Silent Street is unvisited:
            Now the current reel is the ghostly rider reel;
            Animate the current reel at 6 fps;
            Wait for animation to end.