main
#include "DarkGDK.h"
#include "kfunctions.h"
//Declaration
int load_image(int current, int max);
//Class
kFunc kFunc;
//Global
bool show = false;
int ScrH = 640;
int ScrW = 480;
int load_max = 2;
int cur_load = 0;
char* title = "My 2D Game 1.00.000";
//Constant Global
void DarkGDK(void)
{
dbSyncOn();
dbSyncRate(60);
dbDisableEscapeKey();
dbSetDisplayMode(1366, 768, 16);
dbSetImageColorKey(1, 25, 95);
dbSetWindowTitle(title);
dbSetWindowOff();
dbMaximizeWindow();
dbColorBackdrop(0);
kFunc.LoadImage("load_bar.png", 100, 200, 200);
kFunc.LoadImage("load.bmp", 101, 200, 200);
dbStretchSprite(101, 0, 100);
int x=0;
int a;
int b;
while(x<101)
{
dbSync();
dbPasteSprite(101, 200, 200);
dbPasteSprite(100, 200, 200);
dbText(200, 200, "Loading");
dbStretchSprite(101, x, 100);
if(dbEscapeKey()==1)
{
dbDeleteSprite(100);
dbDeleteSprite(101);
break;
}
x++;
dbCLS();
}
for(int i = 1; i<32676; i++)
{
if(dbSpriteExist(i)==1 || dbImageExist(i)==1)
{
dbDeleteSprite(i);
dbDeleteImage(i);
}
}
return;
}
kFunc.LoadImage
void kFunc::LoadImage(char* file, int id, int x, int y)
{
dbLoadImage(file, id);
dbSprite(id, x, y, id);
dbHideSprite(id);
}
-Excellence deals with weak people-