Assumptes #1 al #6 finiquitats. Piràmide secreta funcionant, amb la seua intro.

This commit is contained in:
2016-02-22 17:52:49 +01:00
parent f00afcf9a2
commit de9bac2b2c
12 changed files with 188 additions and 34 deletions

View File

@@ -6,6 +6,11 @@ const Uint8 *keystates;// = SDL_GetKeyboardState( NULL );
SDL_Event event;
Uint8 cheat[5];
bool key_pressed = false;
int waitTime = 0;
void JI_DisableKeyboard(Uint32 time) {
waitTime = time;
}
void JI_moveCheats( Uint8 new_key ) {
cheat[0] = cheat[1];
@@ -19,6 +24,8 @@ void JI_Update() {
key_pressed = false;
keystates = SDL_GetKeyboardState( NULL );
if (waitTime > 0) waitTime--;
while ( SDL_PollEvent( &event ) ) {
if ( event.type == SDL_QUIT ) JG_QuitSignal();
if( event.type == SDL_KEYUP ) {
@@ -29,7 +36,7 @@ void JI_Update() {
}
bool JI_KeyPressed(int key) {
return (keystates[key] != 0);
return waitTime > 0 ? false : (keystates[key] != 0);
}
bool JI_CheatActivated( const char* cheat_code ) {
@@ -41,5 +48,5 @@ bool JI_CheatActivated( const char* cheat_code ) {
}
bool JI_AnyKey() {
return key_pressed;
return waitTime > 0 ? false : key_pressed;
}