Object editor implemented

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent e50fb90b29
commit ba5039b59c
  1. BIN
      C++ProjectTemplate
  2. 14
      assets/maps/map0
  3. 1
      assets/maps/map0_2
  4. 1
      assets/maps/map0_3
  5. 1
      assets/maps/map0_4
  6. 1
      assets/maps/map0_5
  7. 234
      main.cpp
  8. 152
      references.h
  9. 9
      states.h

Binary file not shown.

@ -53,5 +53,17 @@
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
OBJECT48.000000;93.000000;0
OBJECT125.000000;88.000000;59
OBJECT159.000000;155.000000;59
OBJECT68.000000;151.000000;59
OBJECT172.000000;58.000000;60
OBJECT200.000000;110.000000;60
OBJECT174.000000;104.000000;60
OBJECT125.000000;150.000000;60
OBJECT205.000000;169.000000;61
OBJECT213.000000;161.000000;61
OBJECT292.000000;103.000000;61
OBJECT277.000000;67.000000;61
OBJECT230.000000;39.000000;61
OBJECT58.000000;45.000000;61

@ -53,4 +53,3 @@
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

@ -53,4 +53,3 @@
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

@ -53,4 +53,3 @@
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

@ -53,4 +53,3 @@
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

@ -26,7 +26,8 @@ namespace layer{
HIGH,
DYNAMIC,
GROUND,
BACKGROUND
BACKGROUND,
OBJECT, //The object layer doesn't actually exist, it's used to tell the editor we are adding an object instead.
};
}
@ -106,10 +107,12 @@ public:
Map*CURRENT_MAP;
Map*MAP_ONETT;
vd2d cameraPos = {0,0};
GameState GAME_STATE = GameState::EDITOR;
int GAME_STATE = GameState::EDITOR;
vi2d SELECTED_TILE={0,0};
vi2d HIGHLIGHTED_TILE={0,0};
int EDITING_LAYER=layer::DYNAMIC;
int SELECTED_OBJ_ID = PLAYER;
int OBJ_DISPLAY_OFFSET = 0;
bool GAME_FLAGS[128]={};
bool MOUSE_PRESSED_DOWN=false,MOUSE_DOWN=false,MOUSE_RELEASED=false; //TODO Implement Mouse things.
@ -371,6 +374,23 @@ public:
EDITING_LAYER=layer::BACKGROUND;
EnableLayer(layer::COLLISION,false);
}
if (GetKey(ESCAPE).bPressed) {
GAME_STATE=GameState::OBJ_SELECT;
}
if (EDITING_LAYER==layer::OBJECT&&GetMouse(0).bPressed) {
OBJECTS.push_back(CreateObject(SELECTED_OBJ_ID,GetMousePos()+cameraPos));
}
}break;
case GameState::OBJ_SELECT:{
if (GetKey(ESCAPE).bPressed) {
GAME_STATE=GameState::EDITOR;
}
if ((GetMouseWheel()<0||GetKey(PGDN).bHeld)&&OBJ_DISPLAY_OFFSET+(WIDTH/16)<OBJ_INFO.size()) {
OBJ_DISPLAY_OFFSET+=WIDTH/16;
} else
if ((GetMouseWheel()>0||GetKey(PGUP).bHeld)&&OBJ_DISPLAY_OFFSET-(WIDTH/16)>=0) {
OBJ_DISPLAY_OFFSET-=WIDTH/16;
}
}break;
}
}
@ -418,13 +438,51 @@ public:
}
SetDrawTarget(nullptr);
DrawRectDecal((HIGHLIGHTED_TILE)*32-cameraPos,{32,32},YELLOW);
if (EDITING_LAYER==layer::OBJECT) {
DrawStringPropDecal({2,2},"Editing Layer "+std::to_string(EDITING_LAYER));
} else {
DrawStringPropDecal({2,2},"Editing Layer "+std::to_string(EDITING_LAYER));
}
}break;
case GameState::TILE_SELECT:{
//14x14 pixels per tile.
DrawDecal({0,0},SPRITES[TILESET1],{TILEMAP_EDITOR_DRAW_MULT,TILEMAP_EDITOR_DRAW_MULT});
DrawRectDecal(SELECTED_TILE*(TILEMAP_EDITOR_TILESIZE),{TILEMAP_EDITOR_TILESIZE,TILEMAP_EDITOR_TILESIZE},RED);
}break;
case GameState::OBJ_SELECT:{
vd2d drawpos={0,0};
int counter=0;
for (std::map<int,Object*>::const_iterator it = OBJ_INFO.cbegin();it!=OBJ_INFO.cend();++it){
if (counter<OBJ_DISPLAY_OFFSET) {
counter++;
continue;
}
if (drawpos.y>HEIGHT) {
break;
}
Object*obj = it->second;
if (GetMouse(0).bHeld&&
GetMousePos().x>=drawpos.x&&
GetMousePos().x<drawpos.x+16&&
GetMousePos().y>=drawpos.y&&
GetMousePos().y<drawpos.y+24) {
SELECTED_OBJ_ID=obj->id;
EDITING_LAYER=layer::OBJECT;
}
FillRectDecal(drawpos,{16,24},VERY_DARK_GREY);
DrawPartialDecal({drawpos.x,drawpos.y+8},{16,16},obj->spr->spr,{(obj->frameIndex%obj->spr->frames)*obj->spr->width,0},{obj->spr->width,obj->spr->spr->sprite->height},obj->color);
DrawStringDecal({drawpos.x+2,drawpos.y},obj->name,WHITE,{12.0/GetTextSize(obj->name).x,1.0});
if (SELECTED_OBJ_ID==obj->id) {
DrawRectDecal(drawpos,{16,24},YELLOW);
}
drawpos.x+=16;
if (drawpos.x>=WIDTH) {
drawpos.x=0;
drawpos.y+=24;
}
counter++;
}
}break;
}
};
@ -504,8 +562,7 @@ public:
}
}
if (enabled) {
Object*newObj = new Object(id,OBJ_INFO[id]->name,{x,y},OBJ_INFO[id]->spr,OBJ_INFO[id]->scale,OBJ_INFO[id]->color,OBJ_INFO[id]->animationSpd);
OBJECTS.push_back(newObj);
OBJECTS.push_back(CreateObject(id,{x,y}));
}
printf("Object %s Loaded.\n",OBJ_INFO[id]->name.c_str());
} else {
@ -617,11 +674,16 @@ public:
return new Decal(new Sprite("assets/"+spriteName));
}
Object*CreateObject(Reference ref,std::string name,vd2d pos,std::string spriteFileName,int sprWidth,vd2d scale={1,1},Pixel tint=WHITE,int enableFlag=Flag::NONE,int disableFlag=Flag::NONE,int animationDelay=0) {
Object*CreateObject(int id,vd2d pos) {
return new Object(id,OBJ_INFO[id]->name,pos,OBJ_INFO[id]->spr,OBJ_INFO[id]->scale,OBJ_INFO[id]->color,OBJ_INFO[id]->animationSpd);
}
Object*CreateObjectInfo(Reference ref,std::string name,vd2d pos,std::string spriteFileName,int sprWidth,vd2d scale={1,1},Pixel tint=WHITE,int enableFlag=Flag::NONE,int disableFlag=Flag::NONE,int animationDelay=1) {
ANIMATIONS[ref] = new Animation(SPRITES[ref]=CreateSprite("player.png"),32);
Object*newObj = new Object(ref,name,pos,ANIMATIONS[ref],scale,tint,animationDelay);
newObj->disableFlag=disableFlag;
newObj->enableFlag=enableFlag;
OBJ_INFO[ref]=newObj;
return newObj;
}
@ -631,7 +693,167 @@ public:
}
void SetupObjectInfo() {
OBJ_INFO[PLAYER]=CreateObject(PLAYER,"player",{0,0},"player.png",32,{2,2},BLUE);
CreateObjectInfo(PLAYER,"player",{0,0},"player.png",32,{1,1},WHITE);
CreateObjectInfo(NPC1,"npc1",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2,"npc2",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3,"npc3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4,"npc4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5,"npc5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6,"npc6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7,"npc7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8,"npc8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9,"npc9",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10,"npc10",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11,"npc11",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12,"npc12",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13,"npc13",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13,"npc14",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14,"npc15",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15,"npc16",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16,"npc17",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17,"npc18",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18,"npc19",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19,"npc20",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_2,"npc1_2",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_2,"npc2_2",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_2,"npc3_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_2,"npc4_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_2,"npc5_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_2,"npc6_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_2,"npc7_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_2,"npc8_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_2,"npc9_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_2,"npc10_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_2,"npc11_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_2,"npc12_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_2,"npc13_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_2,"npc14_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_2,"npc15_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_2,"npc16_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_2,"npc17_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_2,"npc18_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_2,"npc19_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_2,"npc20_2",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_3,"npc1_3",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_3,"npc2_3",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_3,"npc3_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_3,"npc4_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_3,"npc5_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_3,"npc6_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_3,"npc7_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_3,"npc8_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_3,"npc9_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_3,"npc10_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_3,"npc11_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_3,"npc12_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_3,"npc13_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_3,"npc14_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_3,"npc15_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_3,"npc16_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_3,"npc17_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_3,"npc18_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_3,"npc19_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_3,"npc20_3",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_4,"npc1_4",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_4,"npc2_4",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_4,"npc3_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_4,"npc4_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_4,"npc5_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_4,"npc6_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_4,"npc7_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_4,"npc8_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_4,"npc9_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_4,"npc10_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_4,"npc11_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_4,"npc12_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_4,"npc13_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_4,"npc14_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_4,"npc15_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_4,"npc16_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_4,"npc17_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_4,"npc18_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_4,"npc19_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_4,"npc20_4",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_5,"npc1_5",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_5,"npc2_5",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_5,"npc3_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_5,"npc4_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_5,"npc5_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_5,"npc6_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_5,"npc7_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_5,"npc8_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_5,"npc9_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_5,"npc10_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_5,"npc11_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_5,"npc12_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_5,"npc13_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_5,"npc14_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_5,"npc15_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_5,"npc16_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_5,"npc17_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_5,"npc18_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_5,"npc19_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_5,"npc20_5",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_6,"npc1_6",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_6,"npc2_6",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_6,"npc3_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_6,"npc4_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_6,"npc5_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_6,"npc6_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_6,"npc7_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_6,"npc8_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_6,"npc9_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_6,"npc10_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_6,"npc11_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_6,"npc12_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_6,"npc13_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_6,"npc14_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_6,"npc15_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_6,"npc16_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_6,"npc17_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_6,"npc18_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_6,"npc19_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_6,"npc20_6",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_7,"npc1_7",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_7,"npc2_7",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_7,"npc3_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_7,"npc4_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_7,"npc5_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_7,"npc6_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_7,"npc7_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_7,"npc8_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_7,"npc9_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_7,"npc10_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_7,"npc11_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_7,"npc12_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_7,"npc13_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_7,"npc14_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_7,"npc15_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_7,"npc16_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_7,"npc17_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_7,"npc18_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_7,"npc19_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_7,"npc20_7",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC1_8,"npc1_8",{0,0},"player.png",32,{1,1},RED,Flag::NONE,Flag::NONE,60);
CreateObjectInfo(NPC2_8,"npc2_8",{0,0},"player.png",32,{1,1},GREEN,Flag::NONE,Flag::NONE,2);
CreateObjectInfo(NPC3_8,"npc3_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC4_8,"npc4_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC5_8,"npc5_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC6_8,"npc6_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC7_8,"npc7_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC8_8,"npc8_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC9_8,"npc9_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC10_8,"npc10_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC11_8,"npc11_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC12_8,"npc12_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_8,"npc13_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC13_8,"npc14_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC14_8,"npc15_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC15_8,"npc16_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC16_8,"npc17_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC17_8,"npc18_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC18_8,"npc19_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
CreateObjectInfo(NPC19_8,"npc20_8",{0,0},"player.png",32,{2,2},BLUE,Flag::NONE,Flag::NONE,0);
}
bool Collision(vd2d pos) {

@ -1,4 +1,156 @@
enum Reference{
PLAYER,
TILESET1,
NPC1,
NPC2,
NPC3,
NPC4,
NPC5,
NPC6,
NPC7,
NPC8,
NPC9,
NPC10,
NPC11,
NPC12,
NPC13,
NPC14,
NPC15,
NPC16,
NPC17,
NPC18,
NPC19,
NPC1_2,
NPC2_2,
NPC3_2,
NPC4_2,
NPC5_2,
NPC6_2,
NPC7_2,
NPC8_2,
NPC9_2,
NPC10_2,
NPC11_2,
NPC12_2,
NPC13_2,
NPC14_2,
NPC15_2,
NPC16_2,
NPC17_2,
NPC18_2,
NPC19_2,
NPC1_3,
NPC2_3,
NPC3_3,
NPC4_3,
NPC5_3,
NPC6_3,
NPC7_3,
NPC8_3,
NPC9_3,
NPC10_3,
NPC11_3,
NPC12_3,
NPC13_3,
NPC14_3,
NPC15_3,
NPC16_3,
NPC17_3,
NPC18_3,
NPC19_3,
NPC1_4,
NPC2_4,
NPC3_4,
NPC4_4,
NPC5_4,
NPC6_4,
NPC7_4,
NPC8_4,
NPC9_4,
NPC10_4,
NPC11_4,
NPC12_4,
NPC13_4,
NPC14_4,
NPC15_4,
NPC16_4,
NPC17_4,
NPC18_4,
NPC19_4,
NPC1_5,
NPC2_5,
NPC3_5,
NPC4_5,
NPC5_5,
NPC6_5,
NPC7_5,
NPC8_5,
NPC9_5,
NPC10_5,
NPC11_5,
NPC12_5,
NPC13_5,
NPC14_5,
NPC15_5,
NPC16_5,
NPC17_5,
NPC18_5,
NPC19_5,
NPC1_6,
NPC2_6,
NPC3_6,
NPC4_6,
NPC5_6,
NPC6_6,
NPC7_6,
NPC8_6,
NPC9_6,
NPC10_6,
NPC11_6,
NPC12_6,
NPC13_6,
NPC14_6,
NPC15_6,
NPC16_6,
NPC17_6,
NPC18_6,
NPC19_6,
NPC1_7,
NPC2_7,
NPC3_7,
NPC4_7,
NPC5_7,
NPC6_7,
NPC7_7,
NPC8_7,
NPC9_7,
NPC10_7,
NPC11_7,
NPC12_7,
NPC13_7,
NPC14_7,
NPC15_7,
NPC16_7,
NPC17_7,
NPC18_7,
NPC19_7,
NPC1_8,
NPC2_8,
NPC3_8,
NPC4_8,
NPC5_8,
NPC6_8,
NPC7_8,
NPC8_8,
NPC9_8,
NPC10_8,
NPC11_8,
NPC12_8,
NPC13_8,
NPC14_8,
NPC15_8,
NPC16_8,
NPC17_8,
NPC18_8,
NPC19_8,
};

@ -1,4 +1,7 @@
enum class GameState{
namespace GameState{
enum{
EDITOR,
TILE_SELECT
};
TILE_SELECT,
OBJ_SELECT,
};
}
Loading…
Cancel
Save