home *** CD-ROM | disk | FTP | other *** search
- #include "manic.h"
- #include "gfxlibs/keyboard.h"
- #include "gfxlibs/gfx.h"
- #include "gfxdata/gfxdata.h"
- #include "miscdata/misc.h"
- #include "functions.h"
- #include "sndlibs/snd.h"
-
- static void DemoSetup (void);
- static void RunDemo (void);
- static void DrawDemoLevel (void);
-
-
- void
- DoDemo (void)
- {
- switch (DEMOm) {
- case 0:
- if (TONKS == 0)
- LEVEL = 0;
- else
- LEVEL = 20;
-
- DemoSetup ();
- break;
- case 1:
- RunDemo ();
- break;
- case 2:
- NextDemo ();
- break;
- }
- }
-
- /* ////////////////////////////////////////////////////////////
- // Setup Demo
- //////////////////////////////////////////////////////////// */
- static void
- DemoSetup (void)
- {
- int count;
-
- DEMOm = 1;
- DEMOp = 0;
- LIVES = 3;
- LIVESp = 0;
- LIVESf = 0;
-
- for (count = 0; count < 768; count++) {
- PALwhite[count] = 63;
- PALblack[count] = 0;
- PALfade[count] = PALmain[count];
- PALover[count] = PALmain[count];
- }
-
- CopyLevelInfo ();
- DrawDemoLevel ();
- mm_gfx_flush ();
- mm_gfx_palset (PALmain);
- }
-
- /* ////////////////////////////////////////////////////////////
- // Do Demo
- //////////////////////////////////////////////////////////// */
- static void
- RunDemo (void)
- {
- int waitvrcount;
-
- cWILLY.pos.x = 0;
- cWILLY.pos.y = 128;
-
- RemoveSPG ();
- RemoveSky ();
- RemoveKong ();
- RemoveVRobo ();
- RemoveHRobo ();
- RemoveEugene ();
-
- DrawKeys ();
- DrawConv ();
-
- DrawSwitches ();
-
- DoHRobo ();
- DoVRobo ();
- DoSpecialRobo ();
-
- DrawExit ();
- DrawAir ();
-
- DrawLives ();
-
- DEMOp++;
-
- if (DEMOp > 60) {
- DEMOm = 2;
- LevelDoneExtra ();
- mm_gfx_flush ();
- FadeToBlue ();
- }
-
- for (waitvrcount = 0; waitvrcount < SPEED; waitvrcount++) {
- mm_gfx_waitvr ();
- mm_snd_update ();
- }
- mm_gfx_flush ();
-
- if (mm_keyb_pressed (KEYB_ANYKEY)) {
- MODE = 0;
- TITLEm = 0;
- mm_snd_stopmod ();
- }
- }
-
- /* ////////////////////////////////////////////////////////////
- // Draw Level
- //////////////////////////////////////////////////////////// */
- static void
- DrawDemoLevel (void)
- {
- DrawCurrentLevel ();
- DrawConv ();
- DrawKeys ();
- DrawSwitches ();
- DrawExit ();
- DrawTPlate ();
- DrawAirBG ();
- DoHRobo ();
- DoVRobo ();
- DoSpecialRobo ();
- DrawExit ();
- DrawAir ();
-
- mm_gfx_fillbox (0, 144, 256, 48, PAPER);
-
- PrintScore ();
- PrintHighScore ();
- DrawLives ();
- }
-
- /* ////////////////////////////////////////////////////////////
- // Next Demo Level
- //////////////////////////////////////////////////////////// */
- void
- NextDemo (void)
- {
- LEVEL++;
- if (LEVEL == 20 || LEVEL == 40)
- LEVEL -= 20;
-
- DemoSetup ();
- }
-