ELEC2645 Joseph Allison 200860349

Dependencies:   N5110 Tetris mbed

Files at this revision

API Documentation at this revision

Comitter:
el14ja
Date:
Thu May 05 10:41:45 2016 +0000
Parent:
6:9cb8171ca6df
Commit message:
submitted 1.2

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
main.h Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu May 05 10:01:26 2016 +0000
+++ b/main.cpp	Thu May 05 10:41:45 2016 +0000
@@ -25,10 +25,12 @@
 {
 
     srand(floor(ain.read()*10000)); //Gets a random seed so the the random number generator creates a different set of random numbers each time the game is played
-
     
     lcd.init(); //initilises the screen
 
+    startScreen();
+    wait(2);
+
     setupInterruptInputs();
 
     newShapeBag();//create bag of shapes to use
@@ -52,7 +54,10 @@
         score = 0; //sets all game varibles to default values
         level = 1;
         completedlines = 0;
-
+        gamespeed = 0.8;
+        
+        setTicker(gamespeed);
+        
         //resests the game screen
         setGameAreaArray();
         tetris.clearGame();
@@ -171,10 +176,18 @@
     //set all the flags to zero before the game starts
 }
 
+void startScreen(){
+    
+    lcd.printString("TETRIS",27,1);
+    lcd.printString("Created by",12,2);
+    lcd.printString("Joe Allison",9,3);
+    lcd.refresh();
+    }
+
 
 void gameOverScreen()
 {
-
+    buzzer.write(0);
     bool gameoverscreen = true;
     lcd.clear();
 
--- a/main.h	Thu May 05 10:01:26 2016 +0000
+++ b/main.h	Thu May 05 10:41:45 2016 +0000
@@ -1,6 +1,6 @@
 /**
 @file main.h
-@breif Version 1.1
+@breif Version 1.2
 @author Joseph Allison
 @date 27/3/2016
 */
@@ -86,6 +86,11 @@
 InterruptIn down(PTC0); //PTC5
 
 /**
+Displays the splash Screen
+*/
+void startScreen();
+
+/**
 Sets up the mode and the rise settings of the button interrupts
 */
 void setupInterruptInputs();