+
+ /* Check if chacrater is ASCII */
+ char ch[2];
+ if((event.key.keysym.unicode & 0xFF80) == 0)
+ {
+ ch[0] = event.key.keysym.unicode & 0x7F;
+ ch[1] = '\0';
+ }
+ last_keys.append(ch); // add to cheat keys
+
+ // Cheating words (the goal of this is really for debugging,
+ // but could be used for some cheating, nothing wrong with that)
+ if(compare_last(last_keys, "grow"))
+ {
+ tux.grow(false);
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "fire"))
+ {
+ tux.grow(false);
+ tux.got_power = tux.FIRE_POWER;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "ice"))
+ {
+ tux.grow(false);
+ tux.got_power = tux.ICE_POWER;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "lifeup"))
+ {
+ player_status.lives++;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "lifedown"))
+ {
+ player_status.lives--;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "grease"))
+ {
+ tux.physic.set_velocity_x(tux.physic.get_velocity_x()*3);
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "invincible"))
+ { // be invincle for the rest of the level
+ tux.invincible_timer.start(10000);
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "shrink"))
+ { // remove powerups
+ tux.kill(tux.SHRINK);
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "kill"))
+ { // kill Tux, but without losing a life
+ player_status.lives++;
+ tux.kill(tux.KILL);
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "grid"))
+ { // toggle debug grid
+ debug_grid = !debug_grid;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "hover"))
+ { // toggle hover ability on/off
+ tux.enable_hover = !tux.enable_hover;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "gotoend"))
+ { // goes to the end of the level
+ tux.move(Vector(
+ (currentsector->solids->get_width()*32)
+ - (screen->w*2),
+ 0));
+ currentsector->camera->reset(
+ Vector(tux.get_pos().x, tux.get_pos().y));
+ last_keys.clear();
+ }
+ // temporary to help player's choosing a flapping
+ if(compare_last(last_keys, "marek"))
+ {
+ tux.flapping_mode = Player::MAREK_FLAP;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "ricardo"))
+ {
+ tux.flapping_mode = Player::RICARDO_FLAP;
+ last_keys.clear();
+ }
+ if(compare_last(last_keys, "ryan"))
+ {
+ tux.flapping_mode = Player::RYAN_FLAP;
+ last_keys.clear();
+ }