I'm designing a library of functions that can be used to quickly produce projects without having to either continually glue together random functions from other projects or create them each time from scratch.
Once the library has been created, it will then be implemented into the AGE engine, replacing all of the current commands.
Current areas and commands:
//3D //creation/deletion objectNumber = loadObject(fileName$) deleteObject(objectNumber) //movement/rotation positionObject(objectNumber, x#, y#, z#) rotateObject(objectNumber, x#, y#, z#) xRotateObject(objectNumber, x#) yRtateObject(objectNumber, y#) zRotateObject(objectNumber, z#) //animation commands //visual modes motionBlur(intensityPercent) //collision/physics modes //2D imageNumber = loadImage(fileName$) //GUI GUIHandle = makeWindow(xPosition, yPosition, xSize, ySize, text$, parentHandle) GUIHandle = makePanel(xPosition, yPosition, xSize, ySize, text$, parentHandle) GUIHandle = makeButton(xPosition, yPosition, xSize, ySize, text$, parentHandle) GUIHandle = makeButton(xPosition, yPosition, xSize, ySize, text$, parentHandle) GUIText$ = getGUIText(GUIHandle) setGUIText(GUIHandle) deleteGUI(GUIHandle) //Multiplayer connected = netConnect(ip$) netDisconnect() //System //AGE only runInitialScript : runs all code within <runInitialScript></runInitialScript> tags. runLoopScript : runs all code within <runLoopScript></runLoopScript> tags. runEndScript : runs all code within <runEndScript></runEndScript> tags. //timer systemUptime() timerHandle = createTimer() getTimer(timerHandle) stopTimer(timerHandle) resetTimer(timerHandle) deleteTimer(timerHandle) //Math //String //File //AI
Needs timer handeling:
create timer returns a timer ID/object
then a pause, stop and reset commands that are part of the object or take the ID
Interesting!
Can you give me some example function names so I can better understand it?
I am assuming this is for Dark Basic rather than an OOP language (although if you are going to write it in C++ or GDK then it isnt too difficult, Ill give a short example of that too)
int CreateNewTimer:
This is something that counts miliseconds, (I'm not sure what the DB command to do this is but im sure you can find a way). All this function will do is tell the program that there is going to be a new timer and returns the ID.
StartTimer(int Timer ID)
This will take the ID of the timer that you would like to start counting miliseconds and starts it going
StopTimer(int Timer ID)
This will tell it to stop counting miliseconds (probably not going to be needed but worth adding for a sence of completion)
ResetTimer(int Timer ID)
Resets the timer, ie sets its value to 0;
In GDK or C++ simply place these functions within a class
class Timer
{
private:
unsigned int m_Time;
bool m_Stopped;
public:
Timer() { m_Time = 0; m_Stopped = false } // Constructor basically your CreateNewTimer function
~Timer() // Destructor, required to destroy the object
void SetTime(int Time) { m_Timer = Time; }
bool GetStopped() { return m_Stopped; }
void StopTimer() { m_Stopped = true; }
void StartTimer() { m_Stopped = false; }
void ResetTimer() { m_Time = 0; }
};
int main()
{
Timer MyTimer;
while (true)
{
//unsigned int Time = GetTheTime;
if (!MyTimer.GetStopped)
MyTimer.SetTime(Time);
}
return 0;
}
I hope this clears things up a bit for you
Added.
I find a simple way of switching between windowed and full screen is a useful asset to a libary as well, although it is possible to do it in SDL i havnt really tested it as i think you have to delete the graphics engine then recreate it to go full screen which sounds like a scarey experience!
P.S. I just read my last comment back, man what was i thinking? Patronising or what? sorry mate...didn't mean it.
S'alright.
Added an AI section now. I want the engine to have path-finding capabilities.
Sweet