#19217 - darknet - Wed Apr 14, 2004 4:52 am
A long time ago I posted a question involving button taps versus presses, and since I have used the code given to me to effectively differentiate between the two.
However, I am having an odd problem that I cannot seem to fix. I have 3 mini-games, each equipped with its own set of introduction screens. To shift through each intro screen, the user presses the 'A' button. However, the last intro screen goes directly into the game without caring about a prompt from the user. In another words, when I press 'A' on the 2nd of three intro screens, the third is quickly shown on the screen and the game is started. Rather, I would like to the game only to begin on the user's input on the third screen. Here the code in question:
However, I am having an odd problem that I cannot seem to fix. I have 3 mini-games, each equipped with its own set of introduction screens. To shift through each intro screen, the user presses the 'A' button. However, the last intro screen goes directly into the game without caring about a prompt from the user. In another words, when I press 'A' on the 2nd of three intro screens, the third is quickly shown on the screen and the game is started. Rather, I would like to the game only to begin on the user's input on the third screen. Here the code in question:
Code: |
void showDefenderIntro() { int previousButton, button, down, up; setMode(MODE_3 | BG2_ENABLE); drawMode3Background(videoBuffer, defenderIntroOne_Bitmap); waitForVSync(); while(defend_state !=IN_DEFENDER) { button = *BUTTONS ^ 0x03ff; down = button & ~previousButton; //pressed since last loop up = previousButton & ~button; //released since last loop if( (down & A_BUTTON) !=0) { switch(defend_state) { case SECOND_DEFENDER_INTRO: drawMode3Background(videoBuffer, defenderIntroTwo_Bitmap); defend_state = FINAL_DEFENDER_INTRO; break; case FINAL_DEFENDER_INTRO: drawMode3Background(videoBuffer, defenderIntroThree_Bitmap); defend_state = IN_DEFENDER; break; } } previousButton = button; waitForVSync(); } } |