I thought it's time to share with you classes I wrote for myself to make Slick usage easier. I'm posting them in here, so Slick developers can look at them and decide if they should add some of these functionalities into base Slick.
BTW. Some of this stuff (like proper additive blending) is available in current Slick. These classes were used with Slick Build #228.
Let me know what do you think about them.
Class listing:Quote:
pl.shockah:
BiHashMap - a HashMap with easily accessible both keys and values
BinBuffer - buffer class with a possibility of storing unsigned values and values using odd number of bytes (like 3, 5, 6...)
BinFile - makes it easy to write/read BinBuffer's data to/from a file
Config - easy config structure, using lines like "myOption = 1234" in files; also supporting subconfigs ("myCategory->myOption = asdf")
DoubleHashMap - a HashMap with pairs of values of the same type (add a pair 1,5; now looking for 1 will return 5 and looking for 5 will return 1)
FileLine - easy line-by-line reader/writer
Helper - useful functions
HTTPQuery - easy HTTP connection with reading and writing of data
NonNullHashMap - a HashMap that doesn't store null values (putting a null value will just ignore it, or remove a current non-null key-value pair)
Pair - a structure for holding a Pair of objects
PairNonOrdered - like above, but doesn't really care about the object order (which one is first and which one is second)
Reflection - reflection helping class
Security - functions for hashes, etc. (for now only BinBuffer -> MD5 string)
StringTools - URL string escaping, stripping disallowed Windows filename chars, imploding an array of strings, checking if a string can be parsed as a number
WeightedRandom - a random with set number of chances per each value (think of it like of a lottery, the more "chances" you buy, the bigger the chance you'll get choosen)
pl.shockah.audio:
Audio - abstract class for sounds and music
AudioWave - wave sounds (wave data, instead of sequences of sounds like MIDI files)
MIDI - MIDI sound
Sample - wave sound loaded fully into memory (for sounds)
SampleMulti - same as above, but can play multiple sounds at once of the same audio file
Stream - streamed wave sound (for music)
pl.shockah.nbt:
Tag - abstract class for NBT tags
TagCompound - a tag storing other tags (like a directory of files on HDD)
TagList - a list of tags of the same type
TagByte, TagShort, TagUShort, TagInt, TagUInt, TagFloat, TagDouble, TagString - simple tags storing a value
pl.shockah.tasks:
ITaskCallback - a callback-like interface for telling the app/game that a task has been completed
Task - abstract class for tasks
TaskFileCopy - threaded file copy task
TaskFileCopyMulti - like above, but for multiple files at once
pl.shockah.easyslick:
App - main app's/game's class, that controls everything
AppGameContainer - a subclass of Slick's AppGameContainer with some changes
Colors - useful functions for colors
ConstBlendModes - implement this interface to get blend modes' constants
EHandler - a wrapper handling exceptions when executing code, useful for final fields in classes
Entity - general entity class, with various built-in hooks for game events; also, some useful static methods
ETransition - an enum for storing current transition state
Fonts - font/text helper
GameLoop - base game loop
GraphicsHelper - stores a Graphics instance, has some useful functions
IAppHooks - implement this interface to get general game events' hooks in your main class
IGameLoop - interface for custom game loops
Image - a subclass of Slick's Image with changes
ImageBuffer - a subclass of Slick's ImageBuffer that uses EasySlick's Image class and adds a method "public Color getRGBA(int x, int y)"
Key - abstract class for key (input) handlers
KeyboardStringListener - useful for editboxes
KeyMouse - mouse button checking
KeySingle - single keyboard key checking
Math2 - more useful math functions
Render - a superclass for all things that should be rendered with depth sorting
Room - game's rooms (called states in Slick)
SpriteSheet - a subclass of Slick's SpriteSheet with some changes
Window - general window stuff
pl.shockah.easyslick.anim:
Anim - animation class; add states, update it on each tick, then get current calculated state when rendering it
AnimState - states for Anim
pl.shockah.easyslick.effects:
Effect - base class for non-collidable entities
EffectScreen - an effect that is rendered on whole screen
EffectScreenBlurBox - box blur effect
EffectScreenBlurGaussian - gaussian blur effect
EffectScreenInvert - inverse effect
pl.shockah.easyslick.gui:
Gui - abstract class for GUIs
Gui3Radio, GuiColorPickerRGB, GuiEditbox, GuiMessage, GuiSliderInt, GuiYesNo - pre-made GUIs
GuiEl, GuiElRenderable, GuiElSelectable, GuiElTickable - abstract classes for GUI elements
GuiElButton, GuiElCaption, GuiElCheckbox, GuiElEditbox, GuiElEscape, GuiElPanel, GuiElRadio, GuiElRadioSet, GuiElSliderInt - pre-made GUI elements
pl.shockah.easyslick.particles:
Particle - base particle class
ParticleSystem - a system of particles for easy managing of multiple groups of particles
ParticleType - particle type, which is used for actual particles
pl.shockah.easyslick.transitions:
Transition - abstract transition class
TransitionBlack - transition: fade to black
EasySlick (< 200 KB)Some test classes (12 MB in size, mostly because of an AIFF sound)