Skip to content
Snippets Groups Projects
Commit 29f1a0a7 authored by mc1n18's avatar mc1n18
Browse files

final commit

parent 3e9382c5
No related branches found
No related tags found
No related merge requests found
...@@ -4,9 +4,9 @@ the structure of this file is an adapted version of the code from pong.c on the ...@@ -4,9 +4,9 @@ the structure of this file is an adapted version of the code from pong.c on the
this code is under the GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 this code is under the GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
This application uses the SmallGraphics library written by Nick Bishop, also under the This application uses the SmallGraphics library written by Nick Bishop, also under the
GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
Author of pong.c code: Steve Gunn Author of pong.c code: Steve Gunn
* Licence: This work is licensed under the Creative Commons Attribution License. * Licence: The pong code is licensed under the Creative Commons Attribution License.
* View this license at http://creativecommons.org/about/licenses/ * View this license at http://creativecommons.org/about/licenses/
*/ */
#include <avr/io.h> #include <avr/io.h>
...@@ -113,7 +113,9 @@ ISR(TIMER1_COMPA_vect) ...@@ -113,7 +113,9 @@ ISR(TIMER1_COMPA_vect)
(ball1.centre_x>rover1.back.x_coordinate && ball1.centre_x<rover1.front.x_coordinate)){ (ball1.centre_x>rover1.back.x_coordinate && ball1.centre_x<rover1.front.x_coordinate)){
color1 =BROWN; color1 =BROWN;
color2=BROWN; color2=BROWN;
if(abs(ball1.vertical_v)>15){
lives=0; lives=0;
}
} }
ball1.vertical_v= (-0.8*ball1.vertical_v); ball1.vertical_v= (-0.8*ball1.vertical_v);
if(abs(ball1.vertical_v)<20){ if(abs(ball1.vertical_v)<20){
...@@ -127,7 +129,9 @@ ISR(TIMER1_COMPA_vect) ...@@ -127,7 +129,9 @@ ISR(TIMER1_COMPA_vect)
(ball2.centre_x>rover1.back.x_coordinate && ball2.centre_x<rover1.front.x_coordinate)){ (ball2.centre_x>rover1.back.x_coordinate && ball2.centre_x<rover1.front.x_coordinate)){
color1 =BROWN; color1 =BROWN;
color2= BROWN; color2= BROWN;
lives=0; if(abs(ball2.vertical_v)>15){
lives=0;
}
} }
...@@ -144,7 +148,9 @@ ISR(TIMER1_COMPA_vect) ...@@ -144,7 +148,9 @@ ISR(TIMER1_COMPA_vect)
(ball3.centre_x>rover1.back.x_coordinate && ball3.centre_x<rover1.front.x_coordinate)){ (ball3.centre_x>rover1.back.x_coordinate && ball3.centre_x<rover1.front.x_coordinate)){
color1 =BROWN; color1 =BROWN;
color2= BROWN; color2= BROWN;
lives=0; if(abs(ball3.vertical_v)>15){
lives=0;
}
} }
......
No preview for this file type
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment