16
Dependencies: Ball Ball1 Gamepad N5110 Paddle1 PongEngine cab lab mbed
Fork of Pong by
Diff: main.cpp
- Revision:
- 5:33cac7200f38
- Parent:
- 4:d349e5d847cf
--- a/main.cpp Sun Mar 05 23:19:55 2017 +0000 +++ b/main.cpp Thu May 04 06:40:29 2017 +0000 @@ -5,9 +5,20 @@ #include "PongEngine.h" #define PADDLE_WIDTH 2 -#define PADDLE_HEIGHT 8 -#define BALL_SIZE 2 +#define PADDLE_HEIGHT 15 +#define BALL_SIZE 4 +#define BALL1_SIZE 6 #define BALL_SPEED 3 +#define PADDLE1_WIDTH 15 +#define PADDLE1_HEIGHT 2 +#define LAB_WIDTH 3 +#define LAB_HEIGHT 35 +#define CAB_WIDTH 10 +#define CAB_HEIGHT 6 + + + + /////////////// structs ///////////////// struct UserInput { @@ -50,7 +61,7 @@ pad.init(); // initialise the game - pong.init(PADDLE_WIDTH,PADDLE_HEIGHT,BALL_SIZE,BALL_SPEED); + pong.init(PADDLE_WIDTH,PADDLE_HEIGHT,BALL_SIZE, BALL1_SIZE, BALL_SPEED, PADDLE1_WIDTH, PADDLE1_HEIGHT, LAB_WIDTH, LAB_HEIGHT, CAB_WIDTH, CAB_HEIGHT); } @@ -64,8 +75,106 @@ void welcome() { - lcd.printString(" Pong! ",0,1); - lcd.printString(" Press Start ",0,4); +lcd.printString("Weclome",25,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("To the", 25,2); +wait(1.0); +lcd.refresh(); +lcd.printString("Labirint!",24,3); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("Rules:",5,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("Press L", 5,2); +wait(1.0); +lcd.refresh(); +lcd.printString("To get bigger",5,3); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("Or",5,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("Press R", 5,2); +wait(1.0); +lcd.refresh(); +lcd.printString("To get",5,3); +wait(1.0); +lcd.refresh(); +lcd.printString("Smaller",5,4); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("Small can",5,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("go only", 5,2); +wait(1.0); +lcd.refresh(); +lcd.printString("horizontally",5,3); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("Big can",5,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("go only", 5,2); +wait(1.0); +lcd.refresh(); +lcd.printString("vertically",5,3); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("You have",5,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("2 paddles", 5,2); +wait(1.0); +lcd.refresh(); +lcd.printString("to deliver",5,3); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("Ball to the",5,1); +wait(1.0); +lcd.refresh(); +wait(1.0); +lcd.printString("Home", 5,2); +wait(1.0); +lcd.refresh(); +lcd.printString("Enjoy!",5,3); +wait(1.0); +lcd.refresh(); +lcd.clear(); +wait(1.0); + +lcd.printString("Press Start",15,2); +wait(1.0); +lcd.printString("To Begin",25,4); +wait(1.0); + + lcd.refresh(); // wait flashing LEDs until start button is pressed @@ -75,5 +184,4 @@ pad.leds_off(); wait(0.1); } - } \ No newline at end of file