Dance Dance Revolution program for main mbed

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

Committer:
wliu88
Date:
Fri Apr 29 02:04:07 2016 +0000
Revision:
0:8a02ac09eae0
new

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wliu88 0:8a02ac09eae0 1 #include "mbed.h"
wliu88 0:8a02ac09eae0 2 #include "globals.h"
wliu88 0:8a02ac09eae0 3
wliu88 0:8a02ac09eae0 4 //This file contains the code to setup the background for the game
wliu88 0:8a02ac09eae0 5
wliu88 0:8a02ac09eae0 6 int refarrow_left_x = 15;
wliu88 0:8a02ac09eae0 7 int refarrow_left_y = 12;
wliu88 0:8a02ac09eae0 8 int refarrow_up_x = 47;
wliu88 0:8a02ac09eae0 9 int refarrow_up_y = 12;
wliu88 0:8a02ac09eae0 10 int refarrow_down_x = 79;
wliu88 0:8a02ac09eae0 11 int refarrow_down_y = 12;
wliu88 0:8a02ac09eae0 12 int refarrow_right_x = 111;
wliu88 0:8a02ac09eae0 13 int refarrow_right_y = 12;
wliu88 0:8a02ac09eae0 14
wliu88 0:8a02ac09eae0 15
wliu88 0:8a02ac09eae0 16 void setup_lining(){
wliu88 0:8a02ac09eae0 17 uLCD.filled_rectangle(0,0,127,1,0xFF0000);
wliu88 0:8a02ac09eae0 18 uLCD.filled_rectangle(0,0,1,127,0xFF0000);
wliu88 0:8a02ac09eae0 19 uLCD.filled_rectangle(0,127,127,126,0xFF0000);
wliu88 0:8a02ac09eae0 20 uLCD.filled_rectangle(126,127,127,0,0xFF0000);
wliu88 0:8a02ac09eae0 21 uLCD.filled_rectangle(31,0,34,127,0xFF0000);
wliu88 0:8a02ac09eae0 22 uLCD.filled_rectangle(63,0,66,127,0xFF0000);
wliu88 0:8a02ac09eae0 23 uLCD.filled_rectangle(95,0,98,127,0xFF0000);
wliu88 0:8a02ac09eae0 24 }
wliu88 0:8a02ac09eae0 25
wliu88 0:8a02ac09eae0 26 void setup_goal_arrows(){
wliu88 0:8a02ac09eae0 27 //simple setup for reference arrows for Dance Dance Revolution
wliu88 0:8a02ac09eae0 28 uLCD.triangle(10,12,20,8,20,16,0xBEBEBE); //left
wliu88 0:8a02ac09eae0 29 uLCD.triangle(42,16,47,8,52,16,0xBEBEBEB);//up
wliu88 0:8a02ac09eae0 30 uLCD.triangle(74,8,79,16,84,8,0xBEBEBE); //down
wliu88 0:8a02ac09eae0 31 uLCD.triangle(106,8,106,16,116,12,0xBEBEBEB);//right
wliu88 0:8a02ac09eae0 32 }
wliu88 0:8a02ac09eae0 33
wliu88 0:8a02ac09eae0 34 void setup_goal_arrows_complex() {
wliu88 0:8a02ac09eae0 35 //left arrow
wliu88 0:8a02ac09eae0 36 uLCD.filled_rectangle(8,10,23,13,0xBEBEBE);
wliu88 0:8a02ac09eae0 37 uLCD.filled_rectangle(12,8,14,16,0xBEBEBE);
wliu88 0:8a02ac09eae0 38 }
wliu88 0:8a02ac09eae0 39
wliu88 0:8a02ac09eae0 40
wliu88 0:8a02ac09eae0 41 //
wliu88 0:8a02ac09eae0 42 //
wliu88 0:8a02ac09eae0 43 //
wliu88 0:8a02ac09eae0 44 //Second Screen
wliu88 0:8a02ac09eae0 45 void setup_lining2(){
wliu88 0:8a02ac09eae0 46 uLCD2.filled_rectangle(0,0,127,1,0xFF0000);
wliu88 0:8a02ac09eae0 47 uLCD2.filled_rectangle(0,0,1,127,0xFF0000);
wliu88 0:8a02ac09eae0 48 uLCD2.filled_rectangle(0,127,127,126,0xFF0000);
wliu88 0:8a02ac09eae0 49 uLCD2.filled_rectangle(126,127,127,0,0xFF0000);
wliu88 0:8a02ac09eae0 50 uLCD2.filled_rectangle(31,0,34,127,0xFF0000);
wliu88 0:8a02ac09eae0 51 uLCD2.filled_rectangle(63,0,66,127,0xFF0000);
wliu88 0:8a02ac09eae0 52 uLCD2.filled_rectangle(95,0,98,127,0xFF0000);
wliu88 0:8a02ac09eae0 53 }
wliu88 0:8a02ac09eae0 54
wliu88 0:8a02ac09eae0 55 void setup_goal_arrows2(){
wliu88 0:8a02ac09eae0 56 //simple setup for reference arrows for Dance Dance Revolution
wliu88 0:8a02ac09eae0 57 uLCD2.triangle(10,12,20,8,20,16,0xBEBEBE); //left
wliu88 0:8a02ac09eae0 58 uLCD2.triangle(42,16,47,8,52,16,0xBEBEBEB);//up
wliu88 0:8a02ac09eae0 59 uLCD2.triangle(74,8,79,16,84,8,0xBEBEBE); //down
wliu88 0:8a02ac09eae0 60 uLCD2.triangle(106,8,106,16,116,12,0xBEBEBEB);//right
wliu88 0:8a02ac09eae0 61 }
wliu88 0:8a02ac09eae0 62
wliu88 0:8a02ac09eae0 63 void setup_goal_arrows_complex2() {
wliu88 0:8a02ac09eae0 64 //left arrow
wliu88 0:8a02ac09eae0 65 uLCD2.filled_rectangle(8,10,23,13,0xBEBEBE);
wliu88 0:8a02ac09eae0 66 uLCD2.filled_rectangle(12,8,14,16,0xBEBEBE);
wliu88 0:8a02ac09eae0 67 }
wliu88 0:8a02ac09eae0 68
wliu88 0:8a02ac09eae0 69
wliu88 0:8a02ac09eae0 70 void end_screen(){
wliu88 0:8a02ac09eae0 71 uLCD.filled_rectangle(0,0,127,1,0xFF0000);
wliu88 0:8a02ac09eae0 72 uLCD.filled_rectangle(0,0,1,127,0xFF0000);
wliu88 0:8a02ac09eae0 73 uLCD.filled_rectangle(0,127,127,126,0xFF0000);
wliu88 0:8a02ac09eae0 74 uLCD.filled_rectangle(126,127,127,0,0xFF0000);
wliu88 0:8a02ac09eae0 75 uLCD2.filled_rectangle(0,0,127,1,0x0000FF);
wliu88 0:8a02ac09eae0 76 uLCD2.filled_rectangle(0,0,1,127,0x0000FF);
wliu88 0:8a02ac09eae0 77 uLCD2.filled_rectangle(0,127,127,126,0x0000FF);
wliu88 0:8a02ac09eae0 78 uLCD2.filled_rectangle(126,127,127,0,0x0000FF);
wliu88 0:8a02ac09eae0 79
wliu88 0:8a02ac09eae0 80 }