engine: added method to close level from within

removed collision detection for now
bird no longer rotates indefinitely when falling
This commit is contained in:
pradyun
2023-09-16 15:11:27 +12:00
parent 1c39d3bba0
commit 9795b38e9e
6 changed files with 34 additions and 16 deletions

View File

@@ -33,6 +33,14 @@ void Level::run() {
C3D_FrameEnd(0);
}
void Level::exit() {
this->isActive = false;
}
bool Level::active() {
this->isActive;// && aptMainLoop();
}
void Level::cleanup() {
C2D_SpriteSheetFree(spritesheet);
}

View File

@@ -58,6 +58,7 @@ public:
C3D_RenderTarget* bottom;
Level* level;
bool hasBeenSetup = false;
bool isActive = true;
virtual void setup() = 0;
virtual void update() = 0;
@@ -70,6 +71,12 @@ public:
// sets up the level if it hasnt been, then updates the logic, and draws the frame
void run();
// stops the current level, mostly to be used to exit to hbmenu (see examples)
void exit();
// returns the status of the level, whether it's been exited or not
bool active();
virtual void cleanup() = 0;
};
#endif