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:
@@ -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);
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user