Su 200943147

Dependencies:   Gamepad N5110 mbed

Committer:
GS00
Date:
Fri Apr 21 13:26:10 2017 +0000
Revision:
2:84e6975dd4b2
Parent:
0:444b4d0a113d
Version3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
GS00 2:84e6975dd4b2 1
GS00 2:84e6975dd4b2 2 void Engine::CollisionCheck()
GS00 2:84e6975dd4b2 3 {
GS00 2:84e6975dd4b2 4 for(int u=0; u<84; u++) {
GS00 2:84e6975dd4b2 5 for(int o=0; o<48; o++) {
GS00 2:84e6975dd4b2 6 if(array[u][o]==1) {
GS00 2:84e6975dd4b2 7 if(fill[u][o+1]==1) {
GS00 2:84e6975dd4b2 8 z=1;
GS00 2:84e6975dd4b2 9 }
GS00 2:84e6975dd4b2 10 }
GS00 2:84e6975dd4b2 11 if(fill[u][o]==1) {
GS00 2:84e6975dd4b2 12 if(array[u+1][o]==1) {
GS00 2:84e6975dd4b2 13 v=1;
GS00 2:84e6975dd4b2 14 }
GS00 2:84e6975dd4b2 15 }
GS00 2:84e6975dd4b2 16 if(fill[u+1][0]==1) {
GS00 2:84e6975dd4b2 17 if(array[u][o]==1) {
GS00 2:84e6975dd4b2 18 p=1;
GS00 2:84e6975dd4b2 19 }
GS00 2:84e6975dd4b2 20 }
GS00 2:84e6975dd4b2 21 }
GS00 2:84e6975dd4b2 22 }
GS00 2:84e6975dd4b2 23 }
GS00 2:84e6975dd4b2 24
GS00 2:84e6975dd4b2 25 void Engine::Drop()
GS00 2:84e6975dd4b2 26 {
GS00 2:84e6975dd4b2 27 if(z==1) {
GS00 2:84e6975dd4b2 28 y=y;
GS00 2:84e6975dd4b2 29 } else {
GS00 2:84e6975dd4b2 30 y=y+1;
GS00 2:84e6975dd4b2 31 z=0;
GS00 2:84e6975dd4b2 32 }
GS00 2:84e6975dd4b2 33
GS00 2:84e6975dd4b2 34 }
GS00 2:84e6975dd4b2 35
GS00 2:84e6975dd4b2 36 void Engine::Movement(Direction d)
GS00 2:84e6975dd4b2 37 {
GS00 2:84e6975dd4b2 38 Direction d = joystick.get_direction();
GS00 2:84e6975dd4b2 39
GS00 2:84e6975dd4b2 40 if(d == W) {
GS00 2:84e6975dd4b2 41 if(v==1) {
GS00 2:84e6975dd4b2 42 x=x;
GS00 2:84e6975dd4b2 43 v=0;
GS00 2:84e6975dd4b2 44 } else {
GS00 2:84e6975dd4b2 45 x=x-1;
GS00 2:84e6975dd4b2 46 }
GS00 2:84e6975dd4b2 47
GS00 2:84e6975dd4b2 48 } else if(d == E) {
GS00 2:84e6975dd4b2 49 if(p==1) {
GS00 2:84e6975dd4b2 50 x=x;
GS00 2:84e6975dd4b2 51 p=0;
GS00 2:84e6975dd4b2 52 } else {
GS00 2:84e6975dd4b2 53 x=x+1;
GS00 2:84e6975dd4b2 54 }
GS00 2:84e6975dd4b2 55 }
GS00 2:84e6975dd4b2 56 }