Ability to delete objects from the map as well.

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
master
sigonasr2 2 years ago
parent ba5039b59c
commit 2385741840
  1. BIN
      C++ProjectTemplate
  2. 10
      main.cpp

Binary file not shown.

@ -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:{

Loading…
Cancel
Save