What should I have in the animation file?
You have two choices: coordinates, regular or a mixture between the two.
A regular animation consists of a series of frames in succession.
A coordinate animation consists of a series of coordinates and ascii characters.
The animation file should start of with a line like:
followed by a return. No spaces should be before or after the commas or after the bit that says "coord".
The "2,2" means that we want an animation two characters across by two down.
"100" is a speed setting, and 100 is pretty fast. 1000 works out at one frame per second. Feel free to do the maths.
"regular" means do a frame-by-frame animation, "coord" means to do a coordinate animation.
Now, read on to find out the rest...
What do I put in for a regular animation, then ?
OK, we have started with the line:
We now populate the animation file with the individual frames.
In the example below, I have replaced blank spaces (" ") with hyphens ("-").
This would produce a simple animation that traces a 2x2 box with full stops (".").
Note that there are no spaces between the frames, and that everything, including spaces, is typed out.
That seems like hard work. What's the coordinate system like?
The coordinate system seems hard at first, but is perfect for tacky animations like the one above.
All you need to put down is what pixel changes at what location each frame.
The format for this is:
This seems rather abstract, and you're right - it is... but at the same time it works rather well.
The above piece of code simply says "On this frame, set the character at "0,0" to ".", and set the character at "3,3" to "."".
This is why it's called the coordinate system. In a 4 by 4 grid, you start at 0 and work up to 4 across, as you do to four down.
The format for each frame is thus:
XLocation ! YLocation ! Character ¦ XLocation ! YLocation ! Character ¦ ... and so on
Of course, spaces must be removed.
Incidentally, the "¦" character is not the "|" or "pipe" character.
It is the character that comes from pressing alt-gr, top-left-hand-buttun-under-escape...
... or in other words, also produces "¬", and is responsible for the backtick (`) character.
For an example, let's try and do the same animation that we did above...
Note that we have no need for the ¦ character in this case, because we're only changing on pixel per frame.
What do I need to put on my webpage to get the animation working ?
First things first, somewhere in the
<head> area of your HTML, you need to
This code must NOT be altered in ANY way!
<applet name="ReadFile" code="ReadFile.class" width="0" height="0"
Next, we need to include the textarea box that will house the animation. Design your page as you desire, and where you want the animation, place this HTML:
<TEXTAREA name=formAnimArea wrap=soft cols=1 rows=1>
Lo and behold! The animation in the source file (animSrc.txt) will now be played... provided that the animation is valid (a whole different issue)
Very nice. Are there any other features to worry about?
You can enter specific keywords in to your animation file, between frames, that
will alter how your animation is played.
These keywords are case sensitive.
Replace the word 'delay' with an integer, the size of which is the pause you require in miliseconds.
Surprisingly, this will cause the animation to loop back to the start of the animation... forever.
Replace the word 'newspeed' with the speed you now wise the animation to play at.
Another difficult one, this. Clears the screen.
Replace the word 'animtype' with the type of animation you wish to change to.
animtype may be either
regular, as explained above.
This keyword specifies that you wish to replace the entire animation screen up to this point with one frame that follows on the next line down from this keyword. The frame will be of the same format as those frames used in the regular animation type. If you don't understand this, it's unlikely that you'll need to.