+
+ /* 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(time_left.get_left());
+ 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, "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.base.x = (currentsector->solids->get_width()*32) - (screen->w*2);
+ tux.base.y = 0;
+ currentsector->camera->reset(Vector(tux.base.x, tux.base.y));
+ last_keys.clear();
+ }