Ability to delete objects from the map as well.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
sigonasr2 2022-09-11 23:58:48 -05:00
parent ba5039b59c
commit 2385741840
2 changed files with 9 additions and 1 deletions

Binary file not shown.

View File

@ -378,7 +378,15 @@ public:
GAME_STATE=GameState::OBJ_SELECT;
}
if (EDITING_LAYER==layer::OBJECT&&GetMouse(0).bPressed) {
OBJECTS.push_back(CreateObject(SELECTED_OBJ_ID,GetMousePos()+cameraPos));
OBJECTS.push_back(CreateObject(SELECTED_OBJ_ID,HIGHLIGHTED_TILE*32));
} else
if (EDITING_LAYER==layer::OBJECT&&GetMouse(1).bReleased) {
for (int i=0;i<OBJECTS.size();i++) {
if (OBJECTS[i]->pos==HIGHLIGHTED_TILE*32) {
delete OBJECTS[i];
OBJECTS.erase(OBJECTS.begin()+i--);
}
}
}
}break;
case GameState::OBJ_SELECT:{