Race around the city collecting the flags while avoiding those that stand in the way of your mission. Make no mistake you will need to be quick to outwit your opponents, they are smart and will try to box you in. I wrote this game to prove that writing a game with scrolling scenery is possible even with the limited 6kB of RAM available. I had to compromise sound effects for features, I wanted multiple opponents, I wanted to be able to drop smoke bombs to trap the opponents but all this required memory so the sound effects had to take a back seat.

Dependencies:   mbed

Revision:
1:1b8125937f28
Parent:
0:d85c449aca6d
--- a/main.cpp	Wed Jan 28 03:26:07 2015 +0000
+++ b/main.cpp	Sun Feb 01 00:43:25 2015 +0000
@@ -4,8 +4,9 @@
 #include "GameEngine.h"
 #include "Assets.h"
 #include "GameScreen.h"
+#include "Beeper.h"
 
-const uint16_t palette[] = 
+static const uint16_t palette[] = 
 {
     Color565::Black,
     Color565::Blue,
@@ -13,42 +14,57 @@
     0xfe20
 };
 
+void showIntro();
+
 GameScreen gameScreen;
 
-char buffer[10];
-Timer timer;
-
-CREATE_EFFECT(Sound_Intro)
-    TONE(1, 10, 329, 0, 128, 0),    
-END_EFFECT
-
-//static OneBitSound g_sound(P0_18);
+//char buffer[10];
+//Timer timer;
 
 main()
 {    
-    GameScreenInstance = &gameScreen;
-    
     Game::Surface.setPalette((uint16_t*)palette);
-    Game::Surface.clearScreen(HUD_BACKGROUND);
+    Game::Surface.clearScreen(0);    
     Game::Surface.setOrientation(LCD_ST7735::Rotate270, false);
     
-//    g_sound.play(0, EFFECT(Sound_Intro));
-            
-    timer.start();
-    int lastTime = timer.read_us();    
-    int updateCounter = 0;    
+    showIntro();
+    
+    Game::Surface.clearScreen(HUD_BACKGROUND);
+    
+  //  timer.start();
+//    int lastTime = timer.read_us();
+    
+//    int updateCounter = 0;    
     while(true)
-    {          
+    {   
         gameScreen.update();        
         gameScreen.draw();
-        
+/*
         int time = timer.read_us();
-        int duration = time - lastTime;
+        int elapsedTime = time - lastTime;
         lastTime = time;
         
-        sprintf(buffer, "%d", duration);
+        sprintf(buffer, "%d", elapsedTime);
         Game::Surface.drawString(font_ibm, 104, 120, buffer);
         
         ++updateCounter;
+*/        
     }     
-}
\ No newline at end of file
+}
+
+void showIntro()
+{
+    // Title
+    Game::Surface.drawBitmap(22, 0, titleGraphics, 0, 0, 115, 22, Color565::Aqua, Color565::Black);
+    
+    // Image
+    Game::Surface.drawBitmap(51, 50, titleGraphics, 0, 24, 57, 29, Color565::Blue, Color565::Black);
+    
+    // Press [] to start
+    Game::Surface.drawBitmap(43, 102, titleGraphics, 60, 24, 73, 8, Color565::White, Color565::Black);
+    
+    // (c)2015
+    Game::Surface.drawBitmap(44, 120, titleGraphics, 60, 34, 71, 8, Color565::White, Color565::Black);
+    
+    while (!GameInput::isSquarePressed());
+}