int main() { char key = 'n'; int score, speed; Tetromino tetromino; printf("Speed for demo (1 = fast, 9 = slow): "); scanf("%d", &speed); speed *= 100; printf("Seed: "); scanf("%d", &seed); init(); score = 0; showIntro(); startNewScreen(score, &tetromino); while (key != QUIT) { if(play(&score, &tetromino)) { do { key = getKey(); if (key == RIGHT || key == LEFT || key == UP || key == DOWN) changeTetromino(&tetromino, key); } while(advanceTime(speed) && key != QUIT); } // if not killed and still a centipede after moving spark and centipede else // tetromino cannot move { intermission(); startNewScreen(score, &tetromino); } } // while key != QUIT return 0; } // main()
int main() { char key = 'n', str[10]; int i, score, lives, wandX, playCount, bodyCount, speed; int counts[14][38]; Centipede centipedes[6]; int sparkXs[14]; printf("Speed for demo (1 = fast, 9 = slow): "); scanf("%d", &speed); speed *= 100; init(); bodyCount = score = 0; lives = 3; wandX = 17; showIntro(); startNewScreen(centipedes, counts, sparkXs, score, wandX, &bodyCount); while (key != QUIT) { if(play(centipedes, sparkXs, counts, &score, &lives, &playCount, &bodyCount)) { do { key = getKey(); if (key == RIGHT || key == LEFT) moveWand(key, &wandX); else if(key == ' ') fireWand(wandX, sparkXs); } while(advanceTime(speed) && key != QUIT); } // if not killed and still a centipede after moving spark and centipede else // life lost or last centipede part shot intermission(centipedes, &bodyCount, wandX, lives, &key); } // while key != QUIT return 0; } // main()