hello. I have made a character generator for games.
Its supposed to help generate different stats
and save them into a databasa.
First it worked and I could compile it.
Then I changed the Solution name and the SLN name.
So I could run debug but the release did not work.
I copied all the files into a new project and deleted the old.
I tried to run them as a new solution.
But now it doesnt work.
I get error
1>LINK : fatal error LNK1561: entry point must be defined
this is Main.cpp.
#include "DarkGDK.h"
#include "A.h"
RPX BA;
void DarkGDK ( void )
{
dbSyncOn ( );
BA.Generate(5,5,100,100);
dbSyncRate ( 60 );
while ( LoopGDK ( ) )
{
dbCLS();
BA.Screen();
dbSync ( );
}
// return back to windows
return;
}
this is A.h
char* options_char[4]=
{
"zero",
"add new ability",
"remove ability",
};
char* bg_options_char[4]=
{
"zero",
"add new background",
"remove background",
};
char* bg_backgrounds_char[6]=
{"zero",
"Allies",
"Rescourses",
"Contacts",
"Status",
"Fame",
};
char* abilities_char[12]=
{
"zero",
"acrobatics",
"athletics",
"dodge",
"brawl",
"meele",
"academics",
"driving",
"dancing",
"expression",
"empathy",
"jumping",
};
class B
{
public:
int left;
int top;
int right;
int bottom;
bool clicked;
int switch_x;
char* name;
int level;
int trait_id;
void B::Generate(int a,int b,int c,int e)
{
left=a;
top=b;
right=c;
bottom=e;
clicked=false;
trait_id=0;
}
void B::Screen(void)
{
dbBox(left,top,right,bottom);
}
void B::Set_Name(char* word)
{
name=word;
}
void B::Set_Name_Int(int get_char_int)
{
name=abilities_char[get_char_int];
trait_id=get_char_int;
}
void B::Set_Name_Int_2(int get_char_int)
{
name=bg_backgrounds_char[get_char_int];
trait_id=get_char_int;
}
void B::Set_Level(int lev_x)
{
level=lev_x;
}
void B::Name(void)
{
dbText(left,top,B::name);
}
void B::Level(void)
{
dbSetCursor(right+10,top);
dbPrint(double(level));
}
int B::Condition(void)
{
int a=1;
if(dbMouseX()< right && dbMouseX() >left && dbMouseY() <bottom && dbMouseY() >top && dbMouseClick()==1)
{clicked=true;
a=2;
}
return a;
}
void B::fill_dots(int &xx,int yy)
{
B* dots=new B[11];
for(int x=1; x != yy+1; x++)
{
dots[x].Generate(right+22+(x*10),top,right+30+(x*10),bottom);
dots[x].Screen();
if(dots[x].Condition()!=1)
{
xx=x;
};
};
}
B(void)
{
}
virtual ~B(void)
{
}
};
class RPX
{
public:
int left;
int top;
int right;
int bottom;
int switch_x;
char*new_ability_name;
int new_ability_int;
int remove_trait_id;
bool remove_yes;
int select_trait_id;
char*new_background_name;
int new_background_int;
int remove_background_int;
struct ability{
char* name;
int name_id;
int level;
};
int attribute[9];
int willpower;
ability* abilities;
ability* old_abilities;
ability* backgrounds;
ability* old_backgrounds;
int spent_points;
int ability_amount;
int next_ability_slot;
int first_ability_slot;
int background_amount;
int next_background_slot;
int first_background_slot;
int freebees;
B raise_b;
B step_3;
B* list;
B ab[20];
B bg_options[3];
B all_backgrounds_list[5];
B level[5];
void RPX::Generate(int a,int b,int c,int e)
{
left=a;
top=b;
right=c;
bottom=e;
switch_x=1;
Generate_Buttoms();
ability_amount=1;
abilities=new ability[1];
spent_points=0;
remove_trait_id=0;
remove_yes=false;
RPX::abilities[0].name="zero";
RPX::abilities[0].name="zero";
RPX::abilities[0].level=1;
RPX::abilities[0].level=1;
RPX::next_ability_slot=0;
background_amount=1;
backgrounds=new ability[1];
RPX::backgrounds[0].name="zero";
RPX::backgrounds[0].name="zero";
RPX::backgrounds[0].level=1;
RPX::backgrounds[0].level=1;
RPX::next_background_slot=0;
freebees=190;
willpower=2;
for(int x=1;x!=10;x++)
{attribute[x]=1;
};
}
void RPX::Condition_Buttons(void)
{
int click_x=0;
if(switch_x==2 && step_3.Condition()==2 )
{freebees=freebees-spent_points;
switch_x=6;
}
if(switch_x==2 && raise_b.Condition()==2 )
{
switch_x=5;
}
if(switch_x==2 && ab[1].Condition()==2 )
{
switch_x=3;
}
if(switch_x==2 && ab[2].Condition()==2 )
{
switch_x=4;
}
}
void RPX::Screen(void)
{
switch(switch_x)
{
case 1:Phase_One();
break;
case 2:
menu_abilties();
Show_List_Abilities();
break;
case 3:
select_ability();
Show_List_Abilities();
break;
case 4:
RPX::Remove_Ability();
Show_List_Abilities();
break;
case 5:raise_ability();
break;
case 6:
menu_backgrounds();
Show_List_Backgrounds();
break;
case 7:
select_background();
Show_List_Backgrounds();
break;
case 8:
Remove_Background();
Show_List_Backgrounds();
break;
case 9:
Phase_Six();
break;
break;
}
}
void RPX::Phase_One(void)
{
char* words[10]=
{"zero",
"Strenght",
"Dexterity",
"Stanima",
"Charisma",
"Manipulation",
"Appearance",
"Perception",
"Intelligence",
"Wits",
};
B* attributes;
attributes=new B[9];
dbSetCursor(400,50);
dbText(250,50,"Free Points Left");
dbPrint(double(freebees-spent_points));
B* button_x;
button_x=new B;
button_x->Generate(300,100,350,150);
button_x->name="next:phase two";
button_x->Name();
if(button_x->Condition()!=1)
{
switch_x=2;
freebees=freebees-spent_points;
}
spent_points=0;
for(int x=1;x!=10;x++)
{
attributes[x].Generate(50,45+(x*20),150,50+(x*20));
attributes[x].name=words[x];
attributes[x].level=attribute[x];
attributes[x].Name();
attributes[x].Level();
attributes[x].fill_dots(RPX::attribute[x],5);
spent_points=spent_points+((attribute[x]-1)*5);
}
delete attributes;
delete &button_x;
}
void RPX::menu_abilties(void)
{
dbBox(left,top,right,bottom);
dbSetCursor(400,50);
dbText(250,50,"Free Points Left");
dbPrint(double(freebees-spent_points));
spent_points=0;
for(int x=0;x<3;x++)
{
ab[x].Name();
};
step_3.Name();
raise_b.Name();
Condition_Buttons();
}
void RPX::select_ability(void)
{
for(int x=3;x<10;x++)
{
ab[x].Name();
};
if(switch_x==3)
{
for(int x=3;x<10;x++)
{
if(ab[x].Condition()!=1)
{
new_ability_int=ab[x].trait_id;
add_ability(new_ability_name);
switch_x=2;
}
};
}
}
void RPX::Generate_Buttoms(void)
{
for(int x=1;x<=3;x++)
{
bg_options[x].Generate(left,bottom+(20*x)+2,left+120,bottom +(20*x)+15);
bg_options[x].Set_Name(bg_options_char[x]);
};
for(int x=1;x<=5;x++)
{
all_backgrounds_list[x].Generate(left+(100*2),bottom+(20*x)+2,left+(100*2)+50,bottom +(20*x)+15);
// all_backgrounds_list[x].Set_Name(bg_backgrounds_char[x]);
all_backgrounds_list[x].Set_Name_Int_2(x);
};
step_3.Generate(left,bottom+(20*4)+2,left+120,bottom +(20*4)+15);
step_3.Set_Name("next");
raise_b.Generate(left,bottom+(20*5)+2,left+120,bottom +(20*5)+15);
raise_b.Set_Name("raise ability");
int box_id=1;
for(int x=1;x<=3;x++)
{
ab[box_id].Generate(left,bottom+(20*x)+2,left+120,bottom +(20*x)+15);
ab[box_id].Set_Name(options_char[box_id]);
box_id++;
};
int abilities_char_x;
abilities_char_x=1;
for(int x=1;x<4;x++)
{
for(int y=1;y<4;y++)
{
ab[box_id].Generate(left+(100*y),bottom+(20*x)+2,left+(100*y)+50,bottom +(20*x)+15);
ab[box_id].Set_Name_Int(abilities_char_x);
box_id++;
abilities_char_x++;
};
};
}
void RPX::add_ability(char* name_x)
{
RPX::old_abilities=new ability[ability_amount];
for(int x=0; x != ability_amount; x++)
{
old_abilities[x]=abilities[x];
};
ability_amount++;
RPX::next_ability_slot++;
delete RPX::abilities;
RPX::abilities=new ability[ability_amount];
for(int x=1;x != ability_amount;x++)
{
abilities[x]=old_abilities[x];
}
RPX::abilities[RPX::next_ability_slot].name_id=new_ability_int;
RPX::abilities[RPX::next_ability_slot].name=name_x;
RPX::abilities[RPX::next_ability_slot].level=1;
delete RPX::old_abilities;
}
void RPX::Remove_Ability(void)
{
if(RPX::ability_amount<3)
{
switch_x=2;
}
if( remove_yes==true && RPX::ability_amount!=1)
{
switch_x=2;
remove_yes=false;
int old_amount;
int copy_id=1;
RPX::old_abilities=new ability[ability_amount];
for(int x=0; x != ability_amount; x++)
{
old_abilities[x]=abilities[x];
};
delete RPX::abilities;
if( ability_amount!=2)
{
ability_amount--;
RPX::next_ability_slot=ability_amount-1;
}
abilities=new ability[ability_amount];
RPX::abilities[0].name="zero";
RPX::abilities[0].name_id=1;
RPX::abilities[0].level=0;
for(int x=1;x != ability_amount;x++)
{
//RPX::abilities[x].name="zero";
//RPX::abilities[x].name_id=1;
//RPX::abilities[x].level=x;
if(copy_id==RPX::remove_trait_id)
{copy_id++;}
if(copy_id >= ability_amount+1)
{copy_id=2;}
if(copy_id==1)
{copy_id=2;}
abilities[x].level=old_abilities[copy_id].level;
abilities[x].name_id=old_abilities[copy_id].name_id;
copy_id++;
}
delete RPX::old_abilities;
switch_x=2;
}
}
void RPX::Show_List_Abilities()
{
RPX::list=new B[ability_amount];
for(int x=1;x!=ability_amount;x++)
{
list[x].Generate(50,250+(x*10),150,258+(x*10));
list[x].Set_Name_Int(abilities[x].name_id);
list[x].Set_Level(abilities[x].level);
spent_points=+spent_points+(abilities[x].level*2);
}
for(int x=1;x!=ability_amount;x++)
{
if(freebees-spent_points>=2)
{list[x].fill_dots(abilities[x].level,5);
}
list[x].Name();
list[x].Level();
if(freebees-spent_points<=(-1))
{abilities[x].level=0;
}
if(list[x].Condition()==2 )
{
select_trait_id=x;
remove_trait_id=x;
remove_yes=true;
if(x==1)
{
remove_yes=false;
}
}
}
delete list;
}
void RPX::menu_backgrounds(void)
{
dbBox(left,top,right,bottom);
B* button_x;
button_x=new B;
button_x->Generate(300,100,350,150);
button_x->name="next:phase 5";
button_x->Name();
if(button_x->Condition()!=1)
{
switch_x=9;
}
for(int x=0;x<3;x++)
{
bg_options[x].Name();
};
if(switch_x==6 && bg_options[1].Condition()==2 )
{
switch_x=7;
}
if(switch_x==6 && bg_options[2].Condition()==2 )
{
switch_x=8;
}
delete &button_x;
}
void RPX::select_background(void)
{
for(int x=1;x<5;x++)
{
all_backgrounds_list[x].Name();
};
if(switch_x==7)
{
for(int x=1;x<5;x++)
{
if(all_backgrounds_list[x].Condition()!=1)
{
new_background_int=all_backgrounds_list[x].trait_id;
new_background_name=all_backgrounds_list[x].name;
add_background(new_background_name);
switch_x=6;
}
};
}
}
void RPX::add_background(char* name_x_1)
{
RPX::old_backgrounds=new ability[background_amount];
for(int x=0; x != background_amount; x++)
{
old_backgrounds[x]=backgrounds[x];
};
background_amount++;
RPX::next_background_slot++;
delete RPX::backgrounds;
RPX::backgrounds=new ability[background_amount];
for(int x=1;x != background_amount;x++)
{
backgrounds[x]=old_backgrounds[x];
}
RPX::backgrounds[RPX::next_background_slot].name_id=new_background_int;
RPX::backgrounds[RPX::next_background_slot].name=name_x_1;
RPX::backgrounds[RPX::next_background_slot].level=1;
delete RPX::old_backgrounds;
}
void RPX::raise_ability(void)
{
if(select_trait_id==0)
{
dbText(50,40,"Now please select the ability you want to raise with mouse left");
Show_List_Abilities();
}
if(select_trait_id!=0)
{
dbText(50,40,"Next The five boxes to the mid right represents a level from one to five");
dbText(50,60,"Click on one of the boxes 1-5");
level[0].Generate(0,0,0,0);
char* name_x1;
name_x1=abilities_char[abilities[select_trait_id].name_id];
dbText(200,100,name_x1);
for(int x=1; x != 5; x++)
{
level[x].Generate(295+(x*10),100,300+(x*10),105);
level[x].Screen();
if(level[x].Condition()!=1)
{RPX::abilities[select_trait_id].level=x;
switch_x=2;
select_trait_id=0;
};
};
};
}
void RPX::Remove_Background(void)
{
if(RPX::background_amount<3)
{
switch_x=2;
}
if( remove_yes==true && RPX::background_amount!=1)
{
switch_x=2;
remove_yes=false;
int old_amount;
int copy_id=1;
RPX::old_backgrounds=new ability[background_amount];
for(int x=0; x != background_amount; x++)
{
old_backgrounds[x]=backgrounds[x];
};
delete RPX::backgrounds;
if( background_amount!=2)
{
background_amount--;
RPX::next_background_slot=background_amount-1;
}
backgrounds=new ability[background_amount];
RPX::backgrounds[0].name="zero";
RPX::backgrounds[0].name_id=1;
RPX::backgrounds[0].level=0;
for(int x=1;x != background_amount;x++)
{
if(copy_id==RPX::remove_trait_id)
{copy_id++;}
if(copy_id >= background_amount+1)
{copy_id=2;}
if(copy_id==1)
{copy_id=2;}
backgrounds[x].level=old_backgrounds[copy_id].level;
backgrounds[x].name_id=old_backgrounds[copy_id].name_id;
copy_id++;
}
delete RPX::old_backgrounds;
switch_x=6;
}
}
void RPX::Show_List_Backgrounds()
{
RPX::list=new B[background_amount];
for(int x=1;x!=background_amount;x++)
{
list[x].Generate(50,250+(x*10),150,258+(x*10));
list[x].Set_Name_Int_2 (backgrounds[x].name_id);
list[x].Set_Level(backgrounds[x].level);
}
for(int x=1;x!=background_amount;x++)
{
list[x].Name();
list[x].Level();
//list[x].Screen();
list[x].fill_dots(backgrounds[x].level,5);
if(list[x].Condition()==2 )
{
remove_trait_id=x;
remove_yes=true;
if(x==1)
{
remove_yes=false;
}
}
}
delete list;
}
void RPX::Phase_Six()
{
B* willpower_A;
willpower_A= new B;
willpower_A->name="Willpower";
willpower_A->Generate(50,100,200,110);
willpower_A->Name();
willpower_A->level=willpower;
willpower_A->Level();
willpower_A->fill_dots(willpower,10);
delete &willpower_A;
}
RPX(void)
{
}
virtual ~RPX(void)
{
}
};