Update of /cvsroot/super-tux/supertux/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8957/src
Modified Files:
gameloop.cpp
Log Message:
Added a "gotoend" cheat to put Tux near the end of the level.
Also improved the pause hack.
Index: gameloop.cpp
===================================================================
RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v
retrieving revision 1.180
retrieving revision 1.181
diff -u -d -r1.180 -r1.181
--- gameloop.cpp 15 Sep 2004 22:39:21 -0000 1.180
+++ gameloop.cpp 16 Sep 2004 11:56:39 -0000 1.181
@@ -365,6 +365,11 @@
case SDLK_p:
if(!Menu::current())
{
+ // "lifeup" cheat activates pause cause of the 'p'
+ // so work around to ignore it
+ if(compare_last(last_keys, "lifeu"))
+ break;
+
if(game_pause)
{
game_pause = false;
@@ -414,18 +419,6 @@
{
player_status.lives++;
last_keys.clear();
- // "lifeup" activates pause cause of the 'p'
- // so work around to ignore it
- if(game_pause)
- {
- game_pause = false;
- Ticks::pause_stop();
- }
- else
- {
- game_pause = true;
- Ticks::pause_start();
- }
}
if(compare_last(last_keys, "lifedown"))
{
@@ -437,21 +430,28 @@
tux.invincible_timer.start(time_left.get_left());
last_keys.clear();
}
- if(compare_last(last_keys, "shrink"))
+ if(compare_last(last_keys, "shrink"))
{ // remove powerups
tux.kill(tux.SHRINK);
last_keys.clear();
}
- if(compare_last(last_keys, "kill"))
+ if(compare_last(last_keys, "kill"))
{ // kill Tux
tux.kill(tux.KILL);
last_keys.clear();
}
- if(compare_last(last_keys, "hover"))
+ 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();
+ }
break;
case SDL_JOYAXISMOTION:
|