Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #define W while
- #define R int
- #define S(X,Y,C,A)b[Y][X]=(R)(C)|A<<16;
- #define D(K)GetAsyncKeyState(K)&1<<16
- #define Q(A)x=A;W(x--)
- void* h;
- int b[70][90]; //0xCC00AA00
- R x, y, a, Z=37, V, B, L=0, E, G, e[15], K, k, X, Y, j, U, I;
- INT64 s[3]={0x42247E5AFFBDA542,0x183C7EDBFF245AA5,0x2418BDDBBD99C300};
- void d(R N, R M, INT64 g,R o=0) {
- W(g) {
- y=8;
- W(y--) {
- if(!o||g&1)S(N,M,g&1?219:32,a);
- g>>=1;
- N++;
- }
- N -= 8;
- M--;
- }
- }
- void t(R N, R M, char* T) {
- W(*T)
- S(N++, M, *T++, a);
- }
- void m() {
- SMALL_RECT r{0, 0, 90, 70};
- WriteConsoleOutput(h, (CHAR_INFO*)&b, COORD{90, 70}, COORD(), &r);
- }
- R main() {
- h = GetStdHandle(-11);
- // Reset
- r:
- E=G=B=K=0;
- ZeroMemory(&e,60);
- W(1) {
- // ClearScreen
- Q(6300)
- S(x, 0, 0, 0);
- // HandleInput
- Z+=D(65)?-1:D(68)?1:0;
- Z = Z < 0 ? 0 : Z > 80 ? 80 : Z;
- W(D(32) && !B) {
- Beep(500, 30);
- V = Z + 2;
- B = 62;
- }
- !B?V=-1:B--;
- //if(!B)
- // V=-1;
- //else
- // B--;
- // DrawPlayer
- a = 10;
- d(Z, 65, 265759);
- if(B>=0)
- S(V, B, 64, 13);
- //G++%2?E++:0;
- // DrawEnemies
- //if(G++ % 2)
- // E++;
- k=++E/26,j=E/2%13;
- X = k % 2 ? (13 - j) : j;
- goto test;
- Q(15) {
- if(!e[x]) {
- a = x%2+14-L;
- U = X + x%5 * 16, I = k + 8 + x/5 * 10;
- d(U, I, s[(L+(a&1))%3]);
- if(V>U&&V<U+8&&B>I-8&&B<I) {
- e[x] = 1;
- B=0;
- if(++K==15) {
- // Win
- Q(6300)
- S(x, 0, 219, (x&(L+1)*4%15));
- if(++L==1) {
- test:
- L=380;
- d(15,15,0xFFBD7E3C18183C);
- m();
- W(++L)Beep(s[L%3]&L,100);
- }
- a = 14;
- Q(2)d(35+x*5,35,0xE010D090E0,1);
- char h[7]="Lvl: ";
- h[5] =L+48;
- t(40, 37, &h[0]);
- m();
- Q(6)
- Beep(x&1?200:300, 300);
- goto r;
- }
- }
- if(I > 62) {
- Q(4)
- Beep(210+x*10, x?300:1000);
- L=0;
- goto r;
- }
- }
- }
- m();
- Sleep(40-L*4);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement