Revenge of the Mouse

Dependencies:   4DGL-uLCD-SE EthernetInterface Game_Synchronizer LCD_fonts MMA8452 SDFileSystem mbed-rtos mbed wave_player

Fork of 2035_Tanks_Shell by ECE2035 Spring 2015 TA

Files at this revision

API Documentation at this revision

Comitter:
jford38
Date:
Fri Oct 30 11:08:31 2015 +0000
Parent:
26:317310d660b2
Child:
28:fdaa7ecfbd80
Commit message:
Added a folder for sound. Clarified the role of globals.h

Changed in this revision

Bullet/bullet.cpp Show annotated file Show diff for this revision Revisions of this file
Sound/playSound.cpp Show annotated file Show diff for this revision Revisions of this file
Sound/playSound.h Show annotated file Show diff for this revision Revisions of this file
Tank/tank.cpp Show annotated file Show diff for this revision Revisions of this file
globals.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
misc/misc.cpp Show diff for this revision Revisions of this file
misc/misc.h Show diff for this revision Revisions of this file
--- a/Bullet/bullet.cpp	Fri Oct 30 09:18:28 2015 +0000
+++ b/Bullet/bullet.cpp	Fri Oct 30 11:08:31 2015 +0000
@@ -1,7 +1,7 @@
 #include "uLCD_4DGL.h"
 #include "bullet.h"
 #include "game_synchronizer.h"
-#include "misc.h"
+#include "globals.h"
 #include "math.h"
 
 extern Game_Synchronizer sync;
@@ -40,4 +40,5 @@
     //      BULLET_NO_COLLISION: no collision
     //      BULLET_OFF_SCREEN:   off the side of the screen
     //      Otherwise, return the color you've hit in 16bpp format. 
+    return BULLET_NO_COLLISION;
 }
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sound/playSound.cpp	Fri Oct 30 11:08:31 2015 +0000
@@ -0,0 +1,26 @@
+#include "playSound.h"
+#include "uLCD_4DGL.h"
+#include "SDFileSystem.h"
+#include "wave_player.h"
+
+extern uLCD_4DGL uLCD;
+extern wave_player player;
+
+// Given the filename of a .wav file in the SD card, play the file over the speaker.
+void playSound(char * wav)
+{
+    // open wav file
+    FILE *wave_file;
+    wave_file=fopen(wav,"r");
+
+    if(wave_file == NULL){
+        uLCD.locate(0,4);
+        uLCD.printf("Error in SD");
+        return;
+    }
+    // play wav file
+    player.play(wave_file);
+
+    // close wav file
+    fclose(wave_file);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Sound/playSound.h	Fri Oct 30 11:08:31 2015 +0000
@@ -0,0 +1,6 @@
+#ifndef PLAYSOUND_H__
+#define PLAYSOUND_H__
+
+void playSound(char * wav);
+
+#endif //PLAYSOUND_H__
\ No newline at end of file
--- a/Tank/tank.cpp	Fri Oct 30 09:18:28 2015 +0000
+++ b/Tank/tank.cpp	Fri Oct 30 11:08:31 2015 +0000
@@ -1,5 +1,5 @@
 #include "tank.h"
-#include "misc.h"
+#include "globals.h"
 #include "math.h"
 #include "game_synchronizer.h"
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/globals.h	Fri Oct 30 11:08:31 2015 +0000
@@ -0,0 +1,23 @@
+#ifndef GLOBAL_H__
+#define GLOBAL_H__
+
+#define SKY_COLOR  0x7EC0EE
+#define GND_COLOR  0x66CD00
+#define TANK_RED   0xCD0000
+#define TANK_BLUE  0x000080
+
+#define U_BUTTON 0
+#define R_BUTTON 1
+#define D_BUTTON 2
+#define L_BUTTON 3
+
+#define TURN_P1 0
+#define TURN_P2 1
+
+#define ACC_THRESHOLD 0.25
+
+#define PI  3.1415926535797
+
+
+
+#endif //GLOBAL_H__
\ No newline at end of file
--- a/main.cpp	Fri Oct 30 09:18:28 2015 +0000
+++ b/main.cpp	Fri Oct 30 11:08:31 2015 +0000
@@ -7,7 +7,7 @@
 #include "game_synchronizer.h"
 #include "tank.h"
 #include "bullet.h"
-#include "misc.h"
+#include "globals.h"
 
 
 DigitalOut led1(LED1);
--- a/misc/misc.cpp	Fri Oct 30 09:18:28 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,26 +0,0 @@
-#include "misc.h"
-#include "uLCD_4DGL.h"
-#include "SDFileSystem.h"
-#include "wave_player.h"
-
-extern uLCD_4DGL uLCD;
-extern wave_player player;
-
-// Given the filename of a .wav file in the SD card, play the file over the speaker.
-void playSound(char * wav)
-{
-    // open wav file
-    FILE *wave_file;
-    wave_file=fopen(wav,"r");
-
-    if(wave_file == NULL){
-        uLCD.locate(0,4);
-        uLCD.printf("Error in SD");
-        return;
-    }
-    // play wav file
-    player.play(wave_file);
-
-    // close wav file
-    fclose(wave_file);
-}
\ No newline at end of file
--- a/misc/misc.h	Fri Oct 30 09:18:28 2015 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,25 +0,0 @@
-#ifndef GLOBAL_H__
-#define GLOBAL_H__
-
-#define SKY_COLOR  0x7EC0EE
-#define GND_COLOR  0x66CD00
-#define TANK_RED   0xCD0000
-#define TANK_BLUE  0x000080
-
-#define U_BUTTON 0
-#define R_BUTTON 1
-#define D_BUTTON 2
-#define L_BUTTON 3
-
-#define TURN_P1 0
-#define TURN_P2 1
-
-
-
-#define ACC_THRESHOLD 0.25
-
-#define PI  3.1415926535797
-
-void playSound(char * wav);
-
-#endif //GLOBAL_H__
\ No newline at end of file