Dance Dance Revolution program for main mbed

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

background.h

Committer:
wliu88
Date:
2016-04-29
Revision:
0:8a02ac09eae0

File content as of revision 0:8a02ac09eae0:

#include "mbed.h"
#include "globals.h"

//This file contains the code to setup the background for the game

int refarrow_left_x = 15;
int refarrow_left_y = 12;
int refarrow_up_x = 47;
int refarrow_up_y = 12;
int refarrow_down_x = 79;
int refarrow_down_y = 12;
int refarrow_right_x = 111;
int refarrow_right_y = 12;


void setup_lining(){
    uLCD.filled_rectangle(0,0,127,1,0xFF0000);
    uLCD.filled_rectangle(0,0,1,127,0xFF0000);
    uLCD.filled_rectangle(0,127,127,126,0xFF0000);
    uLCD.filled_rectangle(126,127,127,0,0xFF0000);  
    uLCD.filled_rectangle(31,0,34,127,0xFF0000);  
    uLCD.filled_rectangle(63,0,66,127,0xFF0000); 
    uLCD.filled_rectangle(95,0,98,127,0xFF0000); 
}

void setup_goal_arrows(){
   //simple setup for reference arrows for Dance Dance Revolution
   uLCD.triangle(10,12,20,8,20,16,0xBEBEBE); //left
   uLCD.triangle(42,16,47,8,52,16,0xBEBEBEB);//up
   uLCD.triangle(74,8,79,16,84,8,0xBEBEBE);  //down
   uLCD.triangle(106,8,106,16,116,12,0xBEBEBEB);//right 
}

void setup_goal_arrows_complex() {
    //left arrow
    uLCD.filled_rectangle(8,10,23,13,0xBEBEBE);
    uLCD.filled_rectangle(12,8,14,16,0xBEBEBE);
}


//
//
//
//Second Screen
void setup_lining2(){
    uLCD2.filled_rectangle(0,0,127,1,0xFF0000);
    uLCD2.filled_rectangle(0,0,1,127,0xFF0000);
    uLCD2.filled_rectangle(0,127,127,126,0xFF0000);
    uLCD2.filled_rectangle(126,127,127,0,0xFF0000);  
    uLCD2.filled_rectangle(31,0,34,127,0xFF0000);  
    uLCD2.filled_rectangle(63,0,66,127,0xFF0000); 
    uLCD2.filled_rectangle(95,0,98,127,0xFF0000); 
}

void setup_goal_arrows2(){
   //simple setup for reference arrows for Dance Dance Revolution
   uLCD2.triangle(10,12,20,8,20,16,0xBEBEBE); //left
   uLCD2.triangle(42,16,47,8,52,16,0xBEBEBEB);//up
   uLCD2.triangle(74,8,79,16,84,8,0xBEBEBE);  //down
   uLCD2.triangle(106,8,106,16,116,12,0xBEBEBEB);//right 
}

void setup_goal_arrows_complex2() {
    //left arrow
    uLCD2.filled_rectangle(8,10,23,13,0xBEBEBE);
    uLCD2.filled_rectangle(12,8,14,16,0xBEBEBE);
}


void end_screen(){
    uLCD.filled_rectangle(0,0,127,1,0xFF0000);
    uLCD.filled_rectangle(0,0,1,127,0xFF0000);
    uLCD.filled_rectangle(0,127,127,126,0xFF0000);
    uLCD.filled_rectangle(126,127,127,0,0xFF0000);  
    uLCD2.filled_rectangle(0,0,127,1,0x0000FF);
    uLCD2.filled_rectangle(0,0,1,127,0x0000FF);
    uLCD2.filled_rectangle(0,127,127,126,0x0000FF);
    uLCD2.filled_rectangle(126,127,127,0,0x0000FF);  
    
}