void drawgame() { if(mxhwnd.KeyCheck(DIK_UP)) { if(bar_y > 0) { bar_y = bar_y - 6; } else { bar_y = 0; } } if(mxhwnd.KeyCheck(DIK_DOWN)) { if(bar_y < 480-80) { bar_y = bar_y + 6; } else { bar_y = 480-80; } } moveball(); // drawing the wall mxhwnd.paint.mxdrawrect(640-10,0,640,480,RGB(255,255,255),RGB(255,255,255)); // ddrawing th ebar mxhwnd.paint.mxdrawrect(bar_x,bar_y,bar_x+10,bar_y+80,RGB(255,255,255),RGB(255,255,255)); // drawing the ball //mxhwnd.paint.mxdrawellipse(ball_x,ball_y,ball_x + 10,ball_y + 10,RGB(255,255,255),RGB(255,255,255)); ball.DisplayGraphic(ball_x,ball_y); drawscore(); }
void main() { // unsigned char i; y8 = 1; reset_game(); /* for (i = 0; i < 40; i++) if (minefield[i] == 0) drawval(i, count_mines(i)); */ while(1) { drawscore(); readkeyboard(); if (KEYDOWN(1)) do_key(0); if (KEYDOWN(2)) do_key(1); if (KEYDOWN(3)) do_key(2); if (KEYDOWN(4)) do_key(3); if (KEYDOWN(5)) do_key(4); if (KEYDOWN(6)) do_key(5); if (KEYDOWN(7)) do_key(6); if (KEYDOWN(8)) do_key(7); if (KEYDOWN(9)) do_key(8); if (KEYDOWN(0)) do_key(9); if (KEYDOWN(Q)) do_key(10); if (KEYDOWN(W)) do_key(11); if (KEYDOWN(E)) do_key(12); if (KEYDOWN(R)) do_key(13); if (KEYDOWN(T)) do_key(14); if (KEYDOWN(Y)) do_key(15); if (KEYDOWN(U)) do_key(16); if (KEYDOWN(I)) do_key(17); if (KEYDOWN(O)) do_key(18); if (KEYDOWN(P)) do_key(19); if (KEYDOWN(A)) do_key(20); if (KEYDOWN(S)) do_key(21); if (KEYDOWN(D)) do_key(22); if (KEYDOWN(F)) do_key(23); if (KEYDOWN(G)) do_key(24); if (KEYDOWN(H)) do_key(25); if (KEYDOWN(J)) do_key(26); if (KEYDOWN(K)) do_key(27); if (KEYDOWN(L)) do_key(28); if (KEYDOWN(ENTER)) do_key(29); if (KEYDOWN(SHIFT)) do_key(30); if (KEYDOWN(Z)) do_key(31); if (KEYDOWN(X)) do_key(32); if (KEYDOWN(C)) do_key(33); if (KEYDOWN(V)) do_key(34); if (KEYDOWN(B)) do_key(35); if (KEYDOWN(N)) do_key(36); if (KEYDOWN(M)) do_key(37); if (KEYDOWN(SYM)) do_key(38); if (KEYDOWN(SPACE)) do_key(39); framecounter++; do_halt(); if (framecounter > 500) { framecounter = 0; // 12345678901234567890123456789012 switch (infoloop) { case 0: drawstring("Welcome to \"Rotten Egg Mines\" ", 0, 176); drawstring("By Jari Komppa http://iki.fi/sol", 0, 184); break; case 1: drawstring("How to play: ", 0, 176); drawstring("Press keys to find mines. ", 0, 184); break; case 2: case 4: case 6: case 8: drawstring(". . . . . . . . . . . . . . . . ", 0, 176); drawstring(" . . . . . . . . . . . . . . . .", 0, 184); break; case 3: drawstring("Sound effects played via ", 0, 176); drawstring("BeepFX by Shiru ", 0, 184); break; case 5: drawstring("Art made by using the ", 0, 176); drawstring("Image Spectrumizer ", 0, 184); break; case 7: drawstring("Sources can be found at ", 0, 176); drawstring("github.com/jarikomppa/speccy ", 0, 184); break; case 12: drawstring(" [ . . . . . . . . . . .] ", 0, 176); drawstring(" [. . . . . . . . . . . ] ", 0, 184); break; case 13: drawstring(" [ . . . . . . .] ", 0, 176); drawstring(" [. . . . . . . ] ", 0, 184); break; case 14: drawstring(" [ . . .] ", 0, 176); drawstring(" [. . . ] ", 0, 184); break; case 15: drawstring(" ", 0, 176); drawstring(" ", 0, 184); break; } infoloop++; if (infoloop == 16) infoloop = 0; } } }