Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 25LCxxx_SPI CommonTypes Gameduino mbed
Diff: Level.h
- Revision:
- 0:5fa232ee5fdf
- Child:
- 1:dfd5eaaf96a3
diff -r 000000000000 -r 5fa232ee5fdf Level.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Level.h Tue Jun 04 20:16:33 2013 +0000
@@ -0,0 +1,102 @@
+/*
+ * SOURCE FILE : Level.h
+ *
+ * Definition of class Level.
+ * Base class for all levels.
+ *
+ */
+
+#ifndef LevelDefined
+
+ #define LevelDefined
+
+ #include "Types.h"
+ #include "Gameduino.h" // Gameduino library
+ #include "HighScoreTable.h"
+#if 0
+ #include "GDConst.h" // a few more Gameduino constants
+ #include "GDExtra.h" // a few more Gameduino related functions
+ #include "ArenaConst.h"
+ #include "SpriteImageId.h"
+ #include "CharCodes.h" // character codes
+ #include "GameObject.h"
+ #include "GruntObject.h"
+ #include "BlueMeanyObject.h"
+ #include "CrusherObject.h"
+ #include "BrainObject.h"
+ #include "StringData.h"
+ #include "CharFrame.h"
+ #include "SoundManager.h"
+ #include "Sounds.h"
+#endif
+
+ class Level {
+
+ public :
+
+ // Number of this level.
+ UInt8 LevelNumber;
+
+ /***************/
+ /* CONSTRUCTOR */
+ /***************/
+ Level();
+
+ /**************/
+ /* DESTRUCTOR */
+ /**************/
+ virtual ~Level();
+
+ /************************/
+ /* SET HIGH SCORE TABLE */
+ /************************/
+ // Pass pointer to EEPROM in e.
+ void SetHighScores( HighScoreTable *hst ) {
+ highScores = hst;
+ }
+
+ /***************************************/
+ /* SET PLAYER WHO IS PLAYING THE LEVEL */
+ /***************************************/
+ // Pass pointer to player in p.
+#if 0
+ void SetPlayer( PlayerObject *p ) {
+ player = p;
+ }
+#endif
+
+ // Enumeration of reasons why level ended.
+ enum LevelExitCode {
+ Completed, // level was completed
+ GameOver, // player has no more lives
+ };
+
+ /**************/
+ /* PLAY LEVEL */
+ /**************/
+ // Returns code indicating how level ended.
+ virtual LevelExitCode Play( void ) = 0;
+
+ protected :
+
+ // Pointer to high score table.
+ HighScoreTable *highScores;
+
+ // Player playing the level.
+ // PlayerObject *player;
+
+ /*************/
+ /* PLAY LOOP */
+ /*************/
+ // Returns code indicating how level ended.
+ // This method should be called from the Play method after the
+ // level data has been initialised and the return value returned
+ // by the Play method.
+ virtual LevelExitCode PlayLoop( void ) = 0;
+
+ };
+
+#endif
+
+/* END of Level.h */
+