A skydiving game created using an mbed. This code used threads and mutexes to create a skydiving simulation on an uLCD. The sounds being played are read off of a microSD card and played through the speakers. The user controls the skydiver's movements with a navigation switch.

Dependencies:   4DGL-uLCD-SE SDFileSystem mbed-rtos mbed wave_player

Files at this revision

API Documentation at this revision

Comitter:
mhennessy3
Date:
Wed Mar 16 20:39:39 2016 +0000
Parent:
0:2bc06deb0e7d
Commit message:
Skydiving game

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Mar 16 20:13:23 2016 +0000
+++ b/main.cpp	Wed Mar 16 20:39:39 2016 +0000
@@ -147,6 +147,10 @@
             uLCD.color(RED);
             uLCD.locate(2,2);
             uLCD.printf("\n  GAME \n  OVER!\n");
+            FILE *wave_file; 
+            wave_file=fopen("/sd/mydir/loser.wav","r");
+            waver.play(wave_file);
+            fclose(wave_file);
             wait(.05);
             lcd_mutex.unlock();
             break;   
@@ -161,6 +165,10 @@
             uLCD.color(RED);
             uLCD.locate(2,2);
             uLCD.printf("\n  GAME \n  OVER!\n");
+            FILE *wave_file; 
+            wave_file=fopen("/sd/mydir/loser.wav","r");
+            waver.play(wave_file);
+            fclose(wave_file);
             wait(.05);
             
             lcd_mutex.unlock();