A Sprite Toolkit for Java Applets
By Boutell.Com, Inc.Welcome to Baklava 1.03, Boutell.Com's sprite graphics library for Java programmers. Baklava makes it easy to create animated objects in your Java programs.
This software is free. We invite you to register the software so we can learn more about how it is being used. Source code is now included.
"What's a sprite?"
A sprite is any animated object that appears in your java applet. Baklava lets you create sprites and tell them what direction to move in, how to react to the mouse, and so on. Baklava also lets you know when they collide with each other, among other events. To give sprites "intelligence" suited to your task, extend the Sprite class and add your own behavior. You can see this in action in our first two examples: Scones from Space (fast java environment recommended) and Slide Puzzle (any java environment will be just fine!). Source code to these applets is included with Baklava.
"What about speed?"
Baklava has been optimized carefully, but some Java platforms are just not terribly fast-- yet. Simple applets, like our Slide Puzzle example, run great on any system. More complex applets, like our Scones from Space example, don't run as well without a JIT (Just In Time compilation) Java environment, such as Netscape 3.0 under Windows 95. The more simultaneously moving objects you have, the slower your applet will be. Still, Scones from Space runs great on a fast AMD 486 system in Netscape 3.0 for Windows 95, and most current PCs are vastly faster than that.
"What else do I need?"
Baklava is a library of reusable Java classes, for use by Java programmers. If you are not yet a Java programmer, you need to download the free Java Development Kit from Sun Microsystems, or purchase a user-friendly Java development suite from any of several vendors. Companies offering commercial Java programming tools include Metrowerks (on the Mac) and Microsoft (on the Windows 95/NT platform). Sun's free JDK is available on the Macintosh, Windows 95/NT and Unix/X Window System platforms. We are not affiliated with any of these companies, nor do we endorse their products.
"How do I install baklava?"
Baklava is a java package, much
java.awt, for example. For
local use on your machine, install the
as a subdirectory of a directory that appears in your
or in the directory where your applet's class files reside. Do not simply
dump the individual baklava class files side by side with your applet's
class files; they will not be found there.
"Can I distribute baklava with my applets?"
You can distribute the Baklava .class files on a website for the specific purpose of executing your applet in the user's browser. You may not redistribute them for use by other programmers.
"Sounds great, how do I get started?"
There are two good starting points, depending on your tastes.
You can start by looking at
the source code to the SlidePuzzle applet in the file
slidePuzzle/SlidePuzzle.java, or by reading
the documentation of the Playfield class.
(All Baklava sprites reside in a "playfield," which is responsible
for animating the sprites.)