// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "background.h"
-#include "globals.h"
+#include "app/globals.h"
#include "camera.h"
-#include "screen/drawing_context.h"
-#include "lispwriter.h"
+#include "video/drawing_context.h"
+#include "utils/lispwriter.h"
Background::Background()
: type(INVALID), image(0)
#ifndef SUPERTUX_BACKGROUND_H
#define SUPERTUX_BACKGROUND_H
-#include "screen/surface.h"
-#include "screen/drawing_context.h"
-#include "game_object.h"
-#include "lispreader.h"
+#include "video/surface.h"
+#include "video/drawing_context.h"
+#include "special/game_object.h"
+#include "utils/lispreader.h"
#include "serializable.h"
class DisplayManager;
#include <iostream>
#include <cmath>
-#include "globals.h"
-#include "defines.h"
+#include "app/globals.h"
+#include "app/defines.h"
+#include "special/sprite_manager.h"
+#include "utils/lispwriter.h"
#include "badguy.h"
#include "tile.h"
#include "resources.h"
-#include "sprite_manager.h"
#include "camera.h"
-#include "lispwriter.h"
#include "level.h"
#include "sector.h"
#include "tilemap.h"
if (mode != HELD)
{
// move
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if (dying != DYING_FALLING)
collision_swept_object_map(&old_base,&base);
}
tux.kick_timer.start(KICKING_TIME);
set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
physic.set_velocity_x((dir == LEFT) ? -3.5 : 3.5);
- sound_manager->play_sound(sounds[SND_KICK], this);
+ sound_manager->play_sound(sounds[SND_KICK], this, Sector::current()->player->get_pos());
}
}
check_horizontal_bump();
if(mode == KICK && changed != dir)
{
- sound_manager->play_sound(sounds[SND_RICOCHET], get_pos());
+ sound_manager->play_sound(sounds[SND_RICOCHET], get_pos(), Sector::current()->player->get_pos());
}
}
dir = LEFT;
// move
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(dying == DYING_NOT)
collision_swept_object_map(&old_base, &base);
}
fall();
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if (dying != DYING_FALLING)
collision_swept_object_map(&old_base,&base);
}
dying = DYING_NOT; // now the bomb hurts
timer.start(EXPLODETIME);
- sound_manager->play_sound(sounds[SND_EXPLODE], this);
+ sound_manager->play_sound(sounds[SND_EXPLODE], this, Sector::current()->player->get_pos());
} else if(mode == BOMB_EXPLODE) {
remove_me();
return;
}
// move
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
collision_swept_object_map(&old_base,&base);
}
}
// move
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(dying == DYING_SQUISHED && !timer.check())
remove_me();
physic.enable_gravity(true);
}
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(dying == DYING_NOT)
collision_swept_object_map(&old_base, &base);
// check for right/left collisions
check_horizontal_bump();
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(dying == DYING_NOT)
collision_swept_object_map(&old_base, &base);
if(dying != DYING_NOT)
physic.enable_gravity(true);
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(dying == DYING_NOT || dying == DYING_SQUISHED)
collision_swept_object_map(&old_base, &base);
}
#endif
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if (dying != DYING_FALLING)
collision_swept_object_map(&old_base,&base);
}
fall();
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if (dying != DYING_FALLING)
collision_swept_object_map(&old_base,&base);
physic.set_velocity(dirsign * WINGLING_FLY_SPEED, 0);
}
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
// Handle dying timer:
}
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if (dying != DYING_FALLING)
collision_swept_object_map(&old_base,&base);
Sector::current()->add_score(Vector(base.x, base.y),
50 * player_status.score_multiplier);
- sound_manager->play_sound(sounds[SND_SQUISH], get_pos());
+ sound_manager->play_sound(sounds[SND_SQUISH], get_pos(), Sector::current()->player->get_pos());
player_status.score_multiplier++;
dying = DYING_SQUISHED;
player->bounce(this);
Sector::current()->add_score(Vector(base.x, base.y),
50 * player_status.score_multiplier);
- sound_manager->play_sound(sounds[SND_SQUISH], get_pos());
+ sound_manager->play_sound(sounds[SND_SQUISH], get_pos(), Sector::current()->player->get_pos());
player_status.score_multiplier++;
return;
if (mode == NORMAL || mode == KICK)
{
/* Flatten! */
- sound_manager->play_sound(sounds[SND_STOMP], get_pos());
+ sound_manager->play_sound(sounds[SND_STOMP], get_pos(), Sector::current()->player->get_pos());
mode = FLAT;
set_sprite(img_mriceblock_flat_left, img_mriceblock_flat_right);
physic.set_velocity_x(0);
timer.start(4000);
} else if (mode == FLAT) {
/* Kick! */
- sound_manager->play_sound(sounds[SND_KICK], this);
+ sound_manager->play_sound(sounds[SND_KICK], this, Sector::current()->player->get_pos());
if (player->base.x < base.x + (base.width/2)) {
physic.set_velocity_x(5);
score * player_status.score_multiplier);
/* Play death sound: */
- sound_manager->play_sound(sounds[SND_FALL], this);
+ sound_manager->play_sound(sounds[SND_FALL], this, Sector::current()->player->get_pos());
}
void
/* Get kicked if were flat */
if (mode == FLAT && !dying)
{
- sound_manager->play_sound(sounds[SND_KICK], this);
+ sound_manager->play_sound(sounds[SND_KICK], this, Sector::current()->player->get_pos());
// Hit from left side
if (player->base.x < base.x) {
#include "SDL.h"
-#include "timer.h"
-#include "screen/surface.h"
-#include "physic.h"
-#include "sprite.h"
-#include "defines.h"
-#include "moving_object.h"
+#include "special/timer.h"
+#include "video/surface.h"
+#include "math/physic.h"
+#include "special/sprite.h"
+#include "app/defines.h"
+#include "special/moving_object.h"
#include "collision.h"
#include "serializable.h"
+#include "scene.h"
+
+/* Timing constants (in ms): */
+
+#define KICKING_TIME 200
/* Bad guy kinds: */
enum BadGuyKind {
#include <cmath>
#include "camera.h"
-#include "lispwriter.h"
+#include "utils/lispwriter.h"
#include "player.h"
#include "tilemap.h"
#include "gameloop.h"
-#include "globals.h"
+#include "app/globals.h"
#include "sector.h"
Camera::Camera(Sector* newsector)
#include <vector>
#include <cassert>
-#include "defines.h"
-#include "vector.h"
-#include "game_object.h"
+#include "app/defines.h"
+#include "math/vector.h"
+#include "special/game_object.h"
#include "serializable.h"
class LispReader;
// 02111-1307, USA.
#include <cmath>
-#include "defines.h"
+#include "app/defines.h"
#include "collision.h"
#include "bitmask.h"
#include "scene.h"
#ifndef SUPERTUX_COLLISION_H
#define SUPERTUX_COLLISION_H
-#include "type.h"
+#include "special/base.h"
class Tile;
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "door.h"
-#include "lispreader.h"
-#include "lispwriter.h"
+#include "utils/lispreader.h"
+#include "utils/lispwriter.h"
#include "gameloop.h"
#include "resources.h"
-#include "sprite.h"
-#include "sprite_manager.h"
-#include "screen/drawing_context.h"
-#include "globals.h"
+#include "special/sprite.h"
+#include "special/sprite_manager.h"
+#include "video/drawing_context.h"
+#include "app/globals.h"
/** data images */
Sprite* door;
#include <string>
+#include "video/surface.h"
#include "interactive_object.h"
#include "serializable.h"
-#include "timer.h"
+#include "special/timer.h"
class Sprite;
#include <ctype.h>
#endif
-#include "defines.h"
-#include "globals.h"
+#include "app/defines.h"
+#include "app/globals.h"
#include "gameloop.h"
-#include "screen/screen.h"
-#include "setup.h"
+#include "video/screen.h"
+#include "app/setup.h"
#include "high_scores.h"
-#include "menu.h"
+#include "gui/menu.h"
#include "badguy.h"
#include "sector.h"
#include "special.h"
#include "resources.h"
#include "background.h"
#include "tilemap.h"
-#include "gettext.h"
+#include "app/gettext.h"
+#include "worldmap.h"
+#include "intro.h"
+#include "misc.h"
GameSession* GameSession::current_ = 0;
Sector::current()->add_bouncy_brick(Vector(((int)(x + 1) / 32) * 32,
(int)(y / 32) * 32));
- sound_manager->play_sound(sounds[SND_BRICK], Vector(x, y));
+ sound_manager->play_sound(sounds[SND_BRICK], Vector(x, y), Sector::current()->player->get_pos());
}
/* (Status): */
return tmp;
}
+bool process_load_game_menu()
+{
+ int slot = load_game_menu->check();
+
+ if(slot != -1 && load_game_menu->get_item_by_id(slot).kind == MN_ACTION)
+ {
+ char slotfile[1024];
+ snprintf(slotfile, 1024, "%s/slot%d.stsg", st_save_dir, slot);
+
+ if (access(slotfile, F_OK) != 0)
+ {
+ draw_intro();
+ }
+
+ // shrink_fade(Point((screen->w/2),(screen->h/2)), 1000);
+ fadeout(256);
+ WorldMapNS::WorldMap worldmap;
+
+ // Load the game or at least set the savegame_file variable
+ worldmap.loadgame(slotfile);
+ worldmap.display();
+
+ Menu::set_current(main_menu);
+
+ st_pause_ticks_stop();
+ return true;
+ }
+ else
+ {
+ return false;
+ }
+}
#ifndef SUPERTUX_GAMELOOP_H
#define SUPERTUX_GAMELOOP_H
-#include "sound.h"
-#include "type.h"
+#include "special/timer.h"
+#include "audio/sound.h"
+#include "special/base.h"
/* GameLoop modes */
#define ST_GL_LOAD_LEVEL_FILE 3
#define ST_GL_DEMO_GAME 4
+
+enum GameMenuIDs {
+ MNID_CONTINUE,
+ MNID_ABORTLEVEL
+ };
+
extern int game_started;
class Level;
bool rectcollision(base_type* one, base_type* two);
void bumpbrick(float x, float y);
+/** Return true if the gameloop() was entered, false otherwise */
+bool process_load_game_menu();
+
#endif /*SUPERTUX_GAMELOOP_H*/
#include <iostream>
#include <cmath>
-#include "globals.h"
+#include "app/globals.h"
#include "tile.h"
#include "tile_manager.h"
#include "gameloop.h"
#include "gameobjs.h"
-#include "sprite_manager.h"
+#include "special/sprite_manager.h"
#include "resources.h"
#include "sector.h"
#include "tilemap.h"
}
}
- physic.apply(frame_ratio, base.x, base.y);
+ physic.apply(frame_ratio, base.x, base.y, Sector::current()->gravity);
collision_swept_object_map(&old_base, &base);
}
#ifndef SUPERTUX_GAMEOBJS_H
#define SUPERTUX_GAMEOBJS_H
-#include "type.h"
-#include "screen/surface.h"
-#include "timer.h"
+#include "special/base.h"
+#include "video/surface.h"
+#include "special/timer.h"
#include "scene.h"
-#include "physic.h"
+#include "math/physic.h"
#include "collision.h"
-#include "game_object.h"
-#include "moving_object.h"
+#include "special/game_object.h"
+#include "special/moving_object.h"
#include "serializable.h"
-#include "lispwriter.h"
+#include "utils/lispwriter.h"
/* Bounciness of distros: */
#define NO_BOUNCE 0
#include <cstring>
#include <cstdlib>
-#include "globals.h"
+#include "app/globals.h"
#include "high_scores.h"
-#include "menu.h"
-#include "screen/drawing_context.h"
-#include "screen/screen.h"
-#include "screen/surface.h"
-#include "setup.h"
-#include "lispreader.h"
+#include "gui/menu.h"
+#include "video/drawing_context.h"
+#include "video/screen.h"
+#include "video/surface.h"
+#include "app/setup.h"
+#include "utils/lispreader.h"
#ifdef WIN32
const char * highscore_filename = "/st_highscore.dat";
#ifndef SUPERTUX_INTERACTIVE_OBJECT_H
#define SUPERTUX_INTERACTIVE_OBJECT_H
-#include "game_object.h"
-#include "type.h"
+#include "special/game_object.h"
+#include "special/base.h"
enum InteractionType
{
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "intro.h"
-#include "globals.h"
-#include "defines.h"
-#include "screen/font.h"
-#include "screen/screen.h"
+#include "app/globals.h"
+#include "app/defines.h"
+#include "video/font.h"
+#include "video/screen.h"
void draw_intro()
{
- display_text_file("intro.txt", SCROLL_SPEED_MESSAGE);
+ display_text_file("intro.txt", 1);
}
#include <fstream>
#include <stdexcept>
-#include "globals.h"
-#include "setup.h"
+#include "app/globals.h"
+#include "app/setup.h"
#include "camera.h"
-#include "screen/screen.h"
+#include "video/screen.h"
#include "level.h"
-#include "physic.h"
+#include "math/physic.h"
#include "scene.h"
#include "sector.h"
#include "tile.h"
-#include "lispreader.h"
+#include "utils/lispreader.h"
#include "resources.h"
#include "gameobjs.h"
-#include "lispwriter.h"
+#include "utils/lispwriter.h"
using namespace std;
// 02111-1307, USA.
#include <assert.h>
-#include "setup.h"
+#include "app/setup.h"
#include "level.h"
-#include "globals.h"
-#include "screen/surface.h"
+#include "app/globals.h"
+#include "video/surface.h"
#include "level_subset.h"
static bool has_suffix(const std::string& data, const std::string& suffix)
#include <vector>
#include <string>
-#include "lispreader.h"
+#include "utils/lispreader.h"
class Surface;
#include "SDL_image.h"
#include "leveleditor.h"
-#include "screen/screen.h"
-#include "defines.h"
-#include "globals.h"
-#include "setup.h"
+#include "video/screen.h"
+#include "app/defines.h"
+#include "app/globals.h"
+#include "app/setup.h"
#include "sector.h"
#include "tilemap.h"
#include "gameloop.h"
#define SELECT_W 2 // size of the selections lines
#define SELECT_CLR 0, 255, 0, 255 // lines color (R, G, B, A)
+/* Frames per second: */
+
+#define FPS (1000 / 25)
+
enum { TM_IA, TM_BG, TM_FG };
LevelEditor::LevelEditor()
#ifndef SUPERTUX_LEVELEDITOR_H
#define SUPERTUX_LEVELEDITOR_H
-#include "screen/drawing_context.h"
-#include "game_object.h"
-#include "screen/surface.h"
+#include "video/drawing_context.h"
+#include "special/game_object.h"
+#include "video/surface.h"
#include "level.h"
#include "level_subset.h"
-#include "moving_object.h"
-#include "button.h"
-#include "menu.h"
+#include "special/moving_object.h"
+#include "gui/button.h"
+#include "gui/menu.h"
+
+enum LevelEditorMainMenuIDs {
+ MNID_RETURNLEVELEDITOR,
+ MNID_SUBSETSETTINGS,
+ MNID_QUITLEVELEDITOR
+ };
+
+enum LevelEditorSubsetSettingsIDs {
+ MNID_SUBSETTITLE,
+ MNID_SUBSETDESCRIPTION,
+ MNID_SUBSETSAVECHANGES
+ };
+
+enum LevelEditorSubsetNewIDs {
+ MNID_SUBSETNAME,
+ MNID_CREATESUBSET
+};
+enum LevelEditorSettingsMenuIDs {
+ MNID_NAME,
+ MNID_AUTHOR,
+ MNID_SONG,
+ MNID_BGIMG,
+ MNID_PARTICLE,
+ MNID_LENGTH,
+ MNID_HEIGHT,
+ MNID_TIME,
+ MNID_GRAVITY,
+ MNID_BGSPEED,
+ MNID_TopRed,
+ MNID_TopGreen,
+ MNID_TopBlue,
+ MNID_BottomRed,
+ MNID_BottomGreen,
+ MNID_BottomBlue,
+ MNID_APPLY
+ };
+
+
class LevelEditor
{
public:
#include <cmath>
#include "particlesystem.h"
-#include "globals.h"
-#include "lispreader.h"
-#include "lispwriter.h"
-#include "screen/drawing_context.h"
+#include "app/globals.h"
+#include "utils/lispreader.h"
+#include "utils/lispwriter.h"
+#include "video/drawing_context.h"
ParticleSystem::ParticleSystem()
{
#include <vector>
-#include "screen/surface.h"
-#include "game_object.h"
+#include "video/surface.h"
+#include "special/game_object.h"
#include "serializable.h"
class LispReader;
#include <cassert>
#include "gameloop.h"
-#include "globals.h"
+#include "app/globals.h"
#include "player.h"
-#include "defines.h"
+#include "app/defines.h"
#include "scene.h"
#include "tile.h"
-#include "sprite.h"
+#include "special/sprite.h"
#include "sector.h"
#include "tilemap.h"
#include "camera.h"
#include "gameobjs.h"
#include "resources.h"
#include "interactive_object.h"
-#include "screen/screen.h"
+#include "video/screen.h"
// behavior definitions:
#define TILES_FOR_BUTTJUMP 3
if(dying == DYING_NOT)
handle_input();
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(dying == DYING_NOT)
{
#include "SDL.h"
#include "bitmask.h"
-#include "type.h"
-#include "timer.h"
-#include "screen/surface.h"
+#include "special/timer.h"
+#include "special/base.h"
+#include "video/surface.h"
#include "collision.h"
-#include "sound.h"
-#include "moving_object.h"
-#include "physic.h"
+#include "audio/sound.h"
+#include "special/moving_object.h"
+#include "math/physic.h"
+#include "app/defines.h"
class BadGuy;
#define SCORE_BRICK 5
#define SCORE_DISTRO 25
+/* Sizes: */
+
+#define SMALL 0
+#define BIG 1
+
#include <vector>
struct PlayerKeymap
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#include "globals.h"
+#include "app/globals.h"
#include "scene.h"
#include "player.h"
#include "badguy.h"
#include "gameobjs.h"
#include "special.h"
#include "resources.h"
-#include "sprite_manager.h"
-#include "sound_manager.h"
-#include "setup.h"
+#include "special/sprite_manager.h"
+#include "audio/sound_manager.h"
+#include "app/setup.h"
#include "door.h"
Surface* img_waves[3];
SpriteManager* sprite_manager = 0;
SoundManager* sound_manager = 0;
+char * soundfilenames[NUM_SOUNDS] = {
+ "/sounds/jump.wav",
+ "/sounds/bigjump.wav",
+ "/sounds/skid.wav",
+ "/sounds/coin.wav",
+ "/sounds/invincible.wav",
+ "/sounds/brick.wav",
+ "/sounds/hurt.wav",
+ "/sounds/squish.wav",
+ "/sounds/fall.wav",
+ "/sounds/ricochet.wav",
+ "/sounds/bump-upgrade.wav",
+ "/sounds/upgrade.wav",
+ "/sounds/grow.wav",
+ "/sounds/fire-flower.wav",
+ "/sounds/shoot.wav",
+ "/sounds/lifeup.wav",
+ "/sounds/stomp.wav",
+ "/sounds/kick.wav",
+ "/sounds/explosion.wav"
+ };
+
/* Load graphics/sounds shared between all levels: */
void loadshared()
{
Send a mail to me: neoneurone@users.sf.net, if you have another opinion. :)
*/
for (i = 0; i < NUM_SOUNDS; i++)
- sounds[i] = load_sound(datadir + soundfilenames[i]);
+ sounds.push_back(load_sound(datadir + soundfilenames[i]));
/* Herring song */
herring_song = sound_manager->load_music(datadir + "/music/SALCON.MOD");
#ifndef SUPERTUX_RESOURCES_H
#define SUPERTUX_RESOURCES_H
-#include "musicref.h"
+#include "audio/musicref.h"
class SpriteManager;
class SoundManager;
+/* Sound files: */
+enum {
+ SND_JUMP,
+ SND_BIGJUMP,
+ SND_SKID,
+ SND_DISTRO,
+ SND_HERRING,
+ SND_BRICK,
+ SND_HURT,
+ SND_SQUISH,
+ SND_FALL,
+ SND_RICOCHET,
+ SND_BUMP_UPGRADE,
+ SND_UPGRADE,
+ SND_EXCELLENT,
+ SND_COFFEE,
+ SND_SHOOT,
+ SND_LIFEUP,
+ SND_STOMP,
+ SND_KICK,
+ SND_EXPLODE,
+ NUM_SOUNDS
+};
+
+extern char* soundfilenames[NUM_SOUNDS];
+
extern Surface* img_waves[3];
extern Surface* img_water;
extern Surface* img_pole;
#include <cstdlib>
#include "scene.h"
-#include "defines.h"
+#include "app/defines.h"
PlayerStatus player_status;
#ifndef SUPERTUX_SCENE_H
#define SUPERTUX_SCENE_H
-#include "screen/surface.h"
-#include "timer.h"
+#include "video/surface.h"
+#include "special/timer.h"
#define FRAME_RATE 10 // 100 Frames per second (10ms)
#include <fstream>
#include <stdexcept>
-#include "globals.h"
+#include "app/globals.h"
#include "sector.h"
-#include "lispreader.h"
+#include "utils/lispreader.h"
#include "badguy.h"
#include "special.h"
#include "gameobjs.h"
#include "particlesystem.h"
#include "tile.h"
#include "tilemap.h"
-#include "sound_manager.h"
+#include "audio/sound_manager.h"
#include "gameloop.h"
#include "resources.h"
#include "interactive_object.h"
#include <string>
#include <vector>
-#include "vector.h"
+#include "math/vector.h"
#include "badguy.h"
#include "special.h"
-#include "musicref.h"
-#include "screen/drawing_context.h"
+#include "audio/musicref.h"
+#include "video/drawing_context.h"
class GameObject;
class InteractiveObject;
#include "special.h"
#include "camera.h"
#include "gameloop.h"
-#include "screen/screen.h"
-#include "sound.h"
+#include "video/screen.h"
+#include "audio/sound.h"
#include "scene.h"
-#include "globals.h"
+#include "app/globals.h"
#include "player.h"
#include "sector.h"
-#include "sprite_manager.h"
+#include "special/sprite_manager.h"
#include "resources.h"
Sprite* img_firebullet;
float old_y = base.y;
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
collision_swept_object_map(&old_base,&base);
if (issolid(base.x+2, base.y + 4) || issolid(base.x+2, base.y))
}
/* Move around? */
- physic.apply(elapsed_time, base.x, base.y);
+ physic.apply(elapsed_time, base.x, base.y, Sector::current()->gravity);
if(kind == UPGRADE_GROWUP) {
collision_swept_object_map(&old_base, &base);
}
if(kind != UPGRADE_GROWUP)
return;
- sound_manager->play_sound(sounds[SND_BUMP_UPGRADE], Vector(base.x, base.y));
+ sound_manager->play_sound(sounds[SND_BUMP_UPGRADE], Vector(base.x, base.y), Sector::current()->player->get_pos());
// determine new direction
Direction old_dir = dir;
#include "SDL.h"
#include "bitmask.h"
-#include "type.h"
-#include "screen/surface.h"
+#include "special/base.h"
+#include "video/surface.h"
#include "collision.h"
#include "player.h"
-#include "physic.h"
+#include "math/physic.h"
/* Upgrade types: */
#include <iostream>
#include <exception>
-#include "exceptions.h"
-#include "defines.h"
-#include "globals.h"
-#include "setup.h"
+#include "utils/exceptions.h"
+#include "app/defines.h"
+#include "app/globals.h"
+#include "app/setup.h"
#include "intro.h"
#include "title.h"
#include "gameloop.h"
#include "leveleditor.h"
-#include "screen/screen.h"
+#include "video/screen.h"
#include "worldmap.h"
#include "resources.h"
-#include "screen/surface.h"
+#include "video/surface.h"
#include "tile_manager.h"
-#include "gettext.h"
+#include "app/gettext.h"
+#include "player.h"
+#include "misc.h"
+#include "utils/configfile.h"
int main(int argc, char * argv[])
{
#ifndef DEBUG
try {
#endif
+ config = new MyConfig;
setlocale(LC_ALL, "");
bindtextdomain(PACKAGE, LOCALEDIR);
textdomain(PACKAGE);
unloadshared();
st_general_free();
+ st_menu_free();
TileManager::destroy_instance();
#ifdef DEBUG
Surface::debug_check();
#include <cassert>
#include <iostream>
-#include "globals.h"
+#include "app/globals.h"
#include "tile.h"
#include "scene.h"
-#include "lispreader.h"
-#include "vector.h"
-#include "screen/drawing_context.h"
+#include "utils/lispreader.h"
+#include "math/vector.h"
+#include "video/drawing_context.h"
/** Dirty little helper to create a surface from a snipped of lisp:
*
#include <vector>
#include "SDL.h"
-#include "screen/surface.h"
+#include "video/surface.h"
class Vector;
class LispReader;
// 02111-1307, USA.
#include <assert.h>
-#include "screen/drawing_context.h"
-#include "setup.h"
-#include "globals.h"
-#include "lispreader.h"
+#include "video/drawing_context.h"
+#include "app/setup.h"
+#include "app/globals.h"
+#include "utils/lispreader.h"
#include "tile.h"
#include "tile_manager.h"
+#include "scene.h"
TileManager* TileManager::instance_ = 0;
std::set<TileGroup>* TileManager::tilegroups_ = 0;
#include <cmath>
#include "tilemap.h"
-#include "screen/drawing_context.h"
+#include "video/drawing_context.h"
#include "level.h"
#include "tile.h"
#include "tile_manager.h"
-#include "globals.h"
-#include "lispreader.h"
-#include "lispwriter.h"
+#include "app/globals.h"
+#include "utils/lispreader.h"
+#include "utils/lispwriter.h"
TileMap::TileMap()
: solid(false), speed(1), width(0), height(0), layer(LAYER_TILES), vertical_flip(false)
#include <vector>
-#include "game_object.h"
+#include "special/game_object.h"
#include "serializable.h"
-#include "vector.h"
+#include "math/vector.h"
class Level;
class TileManager;
#include <ctype.h>
#endif
-#include "defines.h"
-#include "globals.h"
+#include "app/defines.h"
+#include "app/globals.h"
#include "title.h"
-#include "screen/screen.h"
-#include "screen/surface.h"
+#include "video/screen.h"
+#include "video/surface.h"
#include "high_scores.h"
-#include "menu.h"
-#include "timer.h"
-#include "setup.h"
+#include "gui/menu.h"
+#include "special/timer.h"
+#include "app/setup.h"
#include "level.h"
#include "level_subset.h"
#include "gameloop.h"
#include "sector.h"
#include "tilemap.h"
#include "resources.h"
-#include "type.h"
-#include "gettext.h"
+#include "special/base.h"
+#include "app/gettext.h"
+#include "misc.h"
static Surface* bkg_title;
static Surface* logo;
static LevelEditor* leveleditor;
+void update_load_save_game_menu(Menu* pmenu)
+{
+ for(int i = 2; i < 7; ++i)
+ {
+ // FIXME: Insert a real savegame struct/class here instead of
+ // doing string vodoo
+ std::string tmp = slotinfo(i - 1);
+ pmenu->item[i].kind = MN_ACTION;
+ pmenu->item[i].change_text(tmp.c_str());
+ }
+}
+
void free_contrib_menu()
{
for(std::vector<LevelSubset*>::iterator i = contrib_subsets.begin();
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
// 02111-1307, USA.
+#ifndef SUPERTUX_TITLE_H
+#define SUPERTUX_TITLE_H
+
+enum MainMenuIDs {
+ MNID_STARTGAME,
+ MNID_LEVELS_CONTRIB,
+ MNID_OPTIONMENU,
+ MNID_LEVELEDITOR,
+ MNID_CREDITS,
+ MNID_QUITMAINMENU
+ };
+
+/* Scrolling text speed */
+
+#define SCROLL_SPEED_CREDITS 2.0
+#define SCROLL_SPEED_MESSAGE 1.0
+
void title(void);
+#endif //SUPERTUX_TITLE_H
+
// EOF //
#include <cassert>
#include <unistd.h>
-#include "globals.h"
-#include "screen/surface.h"
-#include "screen/screen.h"
-#include "screen/drawing_context.h"
-#include "lispreader.h"
+#include "app/globals.h"
+#include "video/surface.h"
+#include "video/screen.h"
+#include "video/drawing_context.h"
+#include "utils/lispreader.h"
#include "gameloop.h"
-#include "setup.h"
+#include "app/setup.h"
#include "sector.h"
#include "worldmap.h"
-#include "sound_manager.h"
+#include "audio/sound_manager.h"
#include "resources.h"
-#include "gettext.h"
+#include "app/gettext.h"
+#include "misc.h"
+
+Menu* worldmap_menu = 0;
namespace WorldMapNS {
#include <vector>
#include <string>
-#include "vector.h"
-#include "musicref.h"
-#include "screen/screen.h"
+#include "math/vector.h"
+#include "audio/musicref.h"
+#include "video/screen.h"
+
+extern Menu* worldmap_menu;
namespace WorldMapNS {
+enum WorldMapMenuIDs {
+ MNID_RETURNWORLDMAP,
+ MNID_QUITWORLDMAP
+ };
+
class Tile
{
public: