/*-----------------------------------------------------------------*\
|                                                                   |
|                         A_Engine_Alpha_test                       |
|                                                                   |
|                   A_Engine By the one and only A_nub              |
|                            Copy Right 2007                       |
|           Under a Creative Commons GNU GPL 2.0 License            |
|                 http://www.gnu.org/licenses/gpl.txt               |
|                                                                   |
\*_________________________________________________________________*/

This is a simple test of A_Engines 2D functionality and its lua scripting
support.

IMPORTANT! This is not an addon to the luaplayer in anyway. All the code was
done from the ground up.

In this demo there are 2 main points of intrest that you will become aware
of when viewing the menu.
1) Play Pong
    As you guessed you get to play pong against an AI computer. Controls are
    Up = paddle up
    Down = paddle down
    select = pause / Swap AI vs AI mode and swap back
    start = return to menu
2) Watch Bouncy Ball
    This is a simple physics demo where a ball bounces around. Controls are
    UP|DOWN|LEFT|RIGHT = spawn point control
    cross = put ball at spawn point an reset speeds
    start = return to menu
    
Everything else is self explanatory.

BUGS:
 *  There are a few known bugs. Sometimes it will freeze up if you dont 
    run fonts to the GU once before the main loop. 
    
 *  Making objs colors, loading fonts, images in a loop proves to cause
    a crash over time, due to bad memory handling
    
 *  Due to the bug above restarting A_Engine enough times may cause a crash 
 
 Please report any bugs to a_noob@programmer.net on MSN or email and AIM
 zachrythayer
    
FUNCTION LIST:
    This is for all of you out there who'd like to use A_Engine_lua
    These are all the functions that A_Engine_lua offers at the moment
    along with there arguments and notes on some of them. Look at script.lua
    for a simple example. (NOTE: script.lua is the first and only file run
    unless dofile() is called)

NOTE: (ALL COLORS MUST BE FROM A_makeColor())

A_checkPad() (returns a pad)
isCtrlSelect(pad)
isCtrlStart(pad)
isCtrlUp(pad)
isCtrlRight(pad)
isCtrlDown(pad)
isCtrlLeft(pad)
isCtrlUp(pad)
isCtrlLTrigger(pad)
isCtrlRTrigger(pad)
isCtrlTriangle(pad)
isCtrlCircle(pad)
isCtrlCross(pad)
isCtrlSquare(pad)
isCtrlHome(pad)
isCtrlHold(pad)
debugPrint (prints to the console if running psplink)
waitVblankStart (dont use unless u wanna cap it at 60 FPS

A_makeColor(R,G,B, | A) (alpha is optional if not given it is 100% or 255)
	
A_EngineInit(pseudoAA, dimension) (2 for 2D 3 for 3D)A_EngineLoop
A_EngineFinishDraw()
A_EngineTerminate() (has sceKernelExitGame() inbuilt along with cleanup)

//A_GFX_2D
A_drawIMG(tex,x,y,w,h) (not tested but should work full image scaled to w,h)
A_drawOBJ_S(x,y,obj) (feed it an obj from makeobj series below)
A_drawOBJ_SLine(x,y,obj) (feed it an obj from makeobj series below)(draws outline)
A_makeBox(w,h,color) (COLOR MUST BE FROM A_makeColor())
A_makeCircle(r,steps,color) (steps is the number of triangles or detail in the circle)
A_makeFadeCircle(r,steps,color)
A_makeOval(r1,r2,steps,color)
A_makeFadeOval(r1,r2,steps,color)
A_makepara(w,h,acuteangle,color)
A_makeTriangle(tritype, w,h,color)(trtype is either 1 for right triangle or 2 for isoceles)
A_makeStar(routter,rinner,points,color)

//A_collison
A_BBcol(obj1,obj2) (returns true on collision OBJS are from the makeobj series)

//A_pgeFont
A_pgeFontInit()
A_pgeFontShutDown()
A_pgeFontLoad(path,size,texturesize) (returns a loaded font instance)(Tex size must be big enough for the font size!)
A_pgeFontPrintf(font,x,y,color,string)


//A_tex
A_texLoad(path) (returns loaded tex)
A_texCreate(w,h,pixelformat) (returns a blank tex)
A_texSwizzle(tex) (swizzles texture for speed)
A_texBind(tex) (binds a tex to a 2D or 3D obj)


	
	