Very absent minded of me, posted completely wrong project. Here is the actualy project the questions are referring to. Thank you
// include the Dark GDK header file (http://forum.thegamecreators.com/?m=forum_read&i=22)
#include "DarkGDK.h"
// main entry point for the application
void DarkGDK ( void )
{
// Array to hold x position of dots
int readDotsX[500];
// Array to hold y position of dots
int readDotsY[500];
// Counter to track array size
int COUNTER = 0;
// Turn on manual screen sync
dbSyncOn();
// Set refresh rate to 30
dbSyncRate(30);
// Check if Dots.dat exist
if ( dbFileExist("Dots.dat"))
{
// If Dots.dat exist delete the file
dbDeleteFile("Dots.dat");
}
// Create and open Dots.dat
dbOpenToWrite(1, "Dots.dat");
// Start loop for getting dots
do
{
// Check if the mouse button has been clicked
if ( dbMouseClick() == 1 )
{
// Draw a dot at the mouse position
dbDot(dbMouseX(),dbMouseY());
// Write the x coordinates of the dot to Dots.dat
dbWriteFile(1, dbMouseX());
// Write the y coordinates of the dot to Dots.dat
dbWriteFile(1, dbMouseY());
// Set Counter to next position
COUNTER = COUNTER + 1;
}
// Refresh Screen
dbSync();
// Wait for Backspace key to be pressed
} while ( dbSpaceKey()==0 );
// Close the file being written to
dbCloseFile(1);
// Check to make sure that Dots.dat exists
if ( dbFileExist("Dots.dat"))
{
// Open the file if it does exist
dbOpenToRead(2, "Dots.dat");
}
else
{
// If file does not exist print error
dbPrint("Error! Dots.dat does not exist.");
}
// Begin loop for reading dots from file
for (int i = 0; i < COUNTER; i ++)
{
// Read dot X position from file
readDotsX[i] = dbReadFile(2);
// Read dot Y position from file
readDotsY[i] = dbReadFile(2);
}
// Begin loop for drawing lines
for (int i = 0; i < COUNTER; i ++)
{
// Check if the next position is undefined
if (readDotsX[i+1] <= -1)
{
// If position next is undefined set position as position 0
readDotsX[i+1] = readDotsX[0];
readDotsY[i+1] = readDotsY[0];
}
// Draw a line from current position to next position
dbLine(readDotsX[i],readDotsY[i],readDotsX[i + 1],readDotsY[i + 1]);
// Refresh screen
dbSync();
}
// Wait for user to press a key
dbWaitKey();
}