New Version Uploaded (2/25/2008)
About
Qixl is a low-fi pixel-art game engine. Qixl games are written in lua. http://lua.org/
Qixl currently runs on Windows. It does not run under Wine. Ports to other OS'es are planned.

Download
To run the demo game. Run the include collide.bat file
Qixl with a demo game. Arrow keys to move.
You can use ALT+ENTER to run in fullscreen.
Beta Browser Plugin
Qixl Firefox Plugin. Put these DLL files into your "C:\Program Files\Mozilla Firefox\plugins" or equivalent directory.
Qixl Demo Game
Classes
qixl : This is a global class, you do not need to create it
- include( 'filename' ) : To make your qixl game browser compatible use this function include additional lua sources into your game. If you use dofile(...) it will fail when played with the browser plugin.
- state( 'function name' ) : This tells qixl what function to call in order to update your game. By default the function calls is 'update'. ie: you have function update( delta ) ... in your lua file.
- window( window_width, window_height ) : sets the pixel dimensions of the qixl window. The default resolution of the window is 320x240
- rez( pixel_width, pixel_height ) : sets the pixel scale for the screen. ie: rez( 5,6 ) this would make the scaled pixels 5x6 pixels. The real resolution of the screen is 320x240
- players( player_count ) : changes the input scheme for qixl. If you have 2 players, each player uses different keys. the valid range for player count is 1 - 4. Players 3 & 4 are possible when you have 4 xbox360 controllers.
- sound( volume ) : Set the volume of the sound effects in your game. Valid range is from 0.0 to 1.0
- music( volume ) : Set the volume of the music in your game. Valid range is from 0.0 to 1.0
- w() : returns current width of the screen
- h() : returns current height of the screen
- print( 'message' ) : prints a text message to the console window
- close() : closes the qixl app
- One Player Input Mode
key( 'key_name' ) : returns true when given key_name is pressed
- quit : Escape key
- up : Up arrow OR W
- down : Down arrow OR S
- left : Left arrow OR A
- right : Right arrow OR D
- a : X Key OR Left Mouse
- b : C Key OR Right Mouse
- x : SpaceBar Key
- y : Shift Key
- Two Player Input Mode
- key( 'key_name', 1 ) : returns true when given key_name is pressed
- quit : Escape key
- up : W
- down : S
- left : A
- right : D
- a : G
- b : H
- x : T
- y : Y
- key( 'key_name', 2 ) : returns true when given key_name is pressed
- quit : Escape key
- up : Up arrow
- down : Down arrow
- left : Left arrow
- right : Right arrow
- a : NumPad 5
- b : NumPad 6
- x : NumPad 8
- y : NumPad 9
- xmouse() : returns the x coord of the mouse
- ymouse() : returns the y coord of the mouse
- clear( pixel ) : clears the screen to the given pixel
- get( x, y, pixel ) : gets the color value at x & y into pixel
- put( x, y, pixel ) : puts the color value of pixel at x & y
pixel : This class holds RGBA values
- pixel:new() : Creates a black pixel value
- pixel:new( r, g, b ) : Creates a pixel value with the given r,g,b
- pixel:new( r, g, b, a ) : Creates a pixel value with the given r,g,b,a
- set( r, g, b ) : Alters the pixel value with the given r,g,b
- set( r, g, b, a ) : Alters the pixel value with the given r,g,b,a
- set_r( value ) : Sets the red color component with the given value
- set_g( value ) : Sets the green color component with the given value
- set_b( value ) : Sets the blue color component with the given value
- set_a( value ) : Sets the alpha color component with the given value
- get_r() : Returns the red color component
- get_g() : Returns the green color component
- get_b() : Returns the blue color component
- get_a() : Returns the alpha color component
- is( r, g, b ) : Returns true if pixel value matches given r,g,b
- is( r, g, b, a ) : Returns true if pixel value matches given r,g,b,a
- synth:new( 'filename' ) : Loads .ptf into memory
- play() : Plays the song without looping
- play( measure ) : Plays the song and will loop at given measure. if measure number is less than 1, song will not loop
- stop() : Stops song playback
- chip:new( 'filename' ) : Loads .sfs into memory
- chip:new() : Creates a default sfs in memory
- play() : Plays the sound
- stop() : Stops sound playback
- random() : Sets the params to random values
- mutate() : Alters the params of the sound
- pmutate( count ) : Keeps a copy of the original and plays a mutated version of it by calling mutate() count number of times
pixelmap : This class is a buffer of pixel data, It also can load in png files
- pixelmap:new( width, height ) : Creates an empty pixelmap of the given width and height
- pixelmap:new( 'filename' ) : Creates & loads the given png file into pixelmap
- fail() : This returns true if the loading of a png file has failed
- draw( x, y ) : Draws pixelmap at given coords
- w() : returns current width of the pixelmap
- h() : returns current height of the pixelmap
- view( width, height ) : With pixel maps you can choose to only show a portion of it. ie: if the pixelmap is 100x10 and you call :view( 10, 10 ). On the next :draw(...) the pixelmap will be drawn as 10x10
- pan( x, y ) : When the pixelmap view is smaller than the physical size of the pixelmap, pan allows you to change the x & y offset of that view
- xpan() : Returns the current value of the x pan coord
- ypan() : Returns the current value of the y pan coord
- xview() : Returns the current width of the view
- yview() : Returns the current height of the view
- get( x, y, pixel ) : gets the color value at x & y into pixel
- put( x, y, pixel ) : puts the color value of pixel at x & y
- save( filename ) : Saves the current content of the pixelmap into a png file
- Built-In Pixelmap mod functions.
- clear( pixel ) : clears the pixelmap to the given pixel
- copy( x, y, pixelmap ) : Copies given pixelmap at given coords
- copy( x, y, pixelmap, true ) : Uses given pixelmap's alpha to cut out a shape
- copy( x, y, pixelmap, false ) : Same as copy, but preserves the alpha channel
- alpha( pixelmap ) : Uses a greyscale pixelmap to set the alpha values. white = 255, black = 0
- colorkey( pixel ) : Does a search & replace on the given pixel, setting it to transparent.
- transform( pixelmap, angle, scale ) : Performs rotation & scaling on given pixelmap, storing the result.
- transform( pixelmap, angle, scale, origin_x, origin_y ) : Performs rotation & scaling on given pixelmap, storing the result. Origin x & y are use to change the rotation axis.
save : This class provides persistent storage for your game
- save:new( 'filename' ) : This sets which save file you are working with.
- put( 'var_name', value ) : Saves the given value to the save file under the name 'var_name'; value can only be a number.
- get( 'var_name' ) : Returns the value previously saved under 'var_name'. If no entry under 'var_name' is saved, defaults to 0.
collide : This class provides a collision detection framework for your game
This is the most complicated class in Qixl. collide allows you to use your own tables as params. BUT the tables must have certain key entries.
player = {
-- object location
x = 0,
y = 0,
-- object velocity
vx = 0,
vy = 0,
-- when this object hits something, does it bounce back?
-- 0.0 being no bounce, 1.0 being bounces with no reduction in velocity
rubber = 0.0,
-- when an object is sitting on a surface this value is non-zero
ground = 0.0,
-- what graphic are we using for collision tests
gfx = pixelmap:new(),
-- defines the origin on the graphic, ie: 0,0 means top-left corner of the graphic
-- ie: if you have an 11x11 graphic and you want to draw it centered on x,y.
-- cx,cy would be 5,5
cx = 0,
cy = 0
}
- collide:new() : Creates a new collision detection dataset, the default gridsize is 16
- collide:new( gridsize ) : Creates a new collision detection dataset with the given gridsize
- collide:clear() : Calling this will clear the dataset
- collide:clear( table ) : This removes an entry from the dataset
- collide:level( table ) : This adds a new level entry into the dataset
- collide:level( table, delta ) : This updates a level entry in the current dataset
- collide:object( table ) : This adds a new object entry into the dataset
- collide:object( table, delta ) : This updates an object entry in the current dataset
- collide:query( x, y ) : This queries the object dataset, returning a table of the objects closest to x & y