(images "tilesets/brick1.png"))
)
- (sprite (name "invisibleblock")
+ (sprite (name "rock")
(action
- (name "empty")
- (images "tilesets/bonus2-d.png"))
+ (name "default")
+ (images "tilesets/block11.png"))
)
-
+
; Stomp
(sprite (name "stomp")
(action
(background (image "arctis.jpg")
(speed 0.5))
(spawnpoint (name "main") (x 50) (y 200))
+ (rock (x 50) (y 50))
(tilemap
(layer "background")
(solid #f)
msgstr "Grumbels Schneegespür"
#: data/levels/world1/extro.txt:7
-#, fuzzy
msgid ""
"-Entering Nolok's Throne Room!\n"
"\n"
"#up. Penny was counting on him."
msgstr ""
"-In Noloks Thronsaal\n"
-"#Tux betrat Noloks Thronsaal und\n"
-"#suchte verzweifelt nach seiner Geliebten,\n"
-"#leider konnte er weder Penny noch Nolok\n"
-"#dort entdecken, stattdessen fand er eine\n"
-"#weitere Nachricht.\n"
"\n"
-"#\"Gut gemaacht mein leiber Tux, sehr gut.\n"
+"#Tux betrat Noloks Thronsaal und suchte\n"
+"#verzweifelt nach seiner Geliebten. Leider\n"
+"#konnte er weder Penny noch Nolok dort\n"
+"#entdecken, stattdessen fand er eine\n"
+"#weitere Nachricht:\n"
+"\n"
+"#\"Gut gemacht mein lieber Tux, sehr gut.\n"
"#Wenn du dies hier liest, hast du diese\n"
"#eisige Festung von mir befreit. Aber wie\n"
"#du siehst ist deine geliebte Penny nicht\n"
"#einer weiteren fliehen. Sei nicht dumm,\n"
"#es wäre das beste jetzt aufzugeben.\n"
"\n"
-"#Tux verliess traurig den Sall, als etwas\n"
+"#Tux verliess traurig den Saal, als etwas\n"
"#unter seinem Fuss raschelte...\n"
"#Ein Briefumschlag mit seinem Namen!\n"
"#In dem Umschlag war eine grobe Karte,\n"
(start_pos_x 100)
(start_pos_y 170)
(background "cave2.jpg")
- (music "cave.mod")
+ (music "cave_remastered.ogg")
(bkgd_red_top 150)
(bkgd_green_top 150)
(bkgd_blue_top 150)
-supertux.pot
+messages.pot
msgid ""
msgstr ""
"Project-Id-Version: SuperTux 0.1.1\n"
-"POT-Creation-Date: 2004-12-05 18:22+0100\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2004-12-15 17:21+0100\n"
"PO-Revision-Date: 2004-12-06 18:26+0100\n"
"Last-Translator: Matze Braun <matze@braunis.de>\n"
"Language-Team: German <de@li.org>\n"
"Content-Type: text/plain; charset=ISO-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
+#: lib/app/setup.cpp:798
+#, c-format
+msgid ""
+"Usage: %s [OPTIONS] FILENAME\n"
+"\n"
+msgstr ""
+"Aufruf: %s [OPTIONS] FILENAME\n"
+"\n"
+
+#: lib/app/setup.cpp:799
+msgid ""
+"Display Options:\n"
+" -f, --fullscreen Run in fullscreen mode.\n"
+" -w, --window Run in window mode.\n"
+" --opengl If OpenGL support was compiled in, this will tell\n"
+" SuperTux to make use of it.\n"
+" --sdl Use the SDL software graphical renderer\n"
+"\n"
+"Sound Options:\n"
+" --disable-sound If sound support was compiled in, this will\n"
+" disable sound for this session of the game.\n"
+" --disable-music Like above, but this will disable music.\n"
+"\n"
+"Misc Options:\n"
+" -j, --joystick NUM Use joystick NUM (default: 0)\n"
+" --joymap XAXIS:YAXIS:A:B:START\n"
+" Define how joystick buttons and axis should be mapped\n"
+" --leveleditor Opens the leveleditor in a file.\n"
+" --worldmap Opens the specified worldmap file.\n"
+" --flip-levels Flip levels upside-down.\n"
+" -d, --datadir DIR Load Game data from DIR (default: automatic)\n"
+" --debug Enables the debug mode, which is useful for "
+"developers.\n"
+" --help Display a help message summarizing command-line\n"
+" options, license and game controls.\n"
+" --usage Display a brief message summarizing command-line "
+"options.\n"
+" --version Display the version of SuperTux you're running.\n"
+"\n"
+msgstr ""
+"Display Options:\n"
+" -f, --fullscreen Im Vollbildmodus starten\n"
+" -w, --window Im Fenstermodus starten\n"
+" --opengl OpenGL benutzen\n"
+" --sdl SDL Software renderer benutzen\n"
+"\n"
+"Sound Options:\n"
+" --disable-sound Sound deaktivieren\n"
+" --disable-music Musik deaktivieren\n"
+"\n"
+"Misc Options:\n"
+" -j, --joystick NUM Joystick NUM benutzen (default: 0)\n"
+" --joymap XAXIS:YAXIS:A:B:START\n"
+" Belegung der Joystick Knöpfe und Axen einstellen\n"
+" --leveleditor Startet den Level Editor\n"
+" --worldmap Startet im Worldmap Modus\n"
+" -d, --datadir DIR Verzeichnis mit Spieldaten (standard: automatisch)\n"
+" --debug Debug Modus aktivieren\n"
+" --help diese Hilfe anzeigen und beenden\n"
+" --usage kurzen Hilfstext über Optionen anzeigen\n"
+" --version Versionsinformationen anzeigen\n"
+"\n"
+
+#: lib/app/setup.cpp:858
+#, c-format
+msgid ""
+"Usage: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--"
+"debug] | [--usage | --help | --version] [--leveleditor] [--worldmap] [--flip-"
+"levels] FILENAME\n"
+msgstr ""
+"Aufruf: %s [--fullscreen] [--opengl] [--disable-sound] [--disable-music] [--"
+"debug] | [--usage | --help | --version] [--leveleditor] [--worldmap] [--flip-"
+"levels] DATEI\n"
+
+#: lib/gui/menu.cpp:68
+msgid "Yes"
+msgstr "Ja"
+
+#: lib/gui/menu.cpp:69
+msgid "No"
+msgstr "Nein"
+
+#: lib/gui/menu.cpp:237
+msgid "Up cursor"
+msgstr "Nach Oben"
+
+#: lib/gui/menu.cpp:240
+msgid "Down cursor"
+msgstr "Nach Unten"
+
+#: lib/gui/menu.cpp:243
+msgid "Left cursor"
+msgstr "Nach Links"
+
+#: lib/gui/menu.cpp:246
+msgid "Right cursor"
+msgstr "Nach Rechts"
+
+#: lib/gui/menu.cpp:249
+msgid "Return"
+msgstr "Return"
+
+#: lib/gui/menu.cpp:252
+msgid "Space"
+msgstr "Space"
+
+#: lib/gui/menu.cpp:255
+msgid "Right Shift"
+msgstr "Shift Rechts"
+
+#: lib/gui/menu.cpp:258
+msgid "Left Shift"
+msgstr "Shift Links"
+
+#: lib/gui/menu.cpp:261
+msgid "Right Control"
+msgstr "Steuerung Rechts"
+
+#: lib/gui/menu.cpp:264
+msgid "Left Control"
+msgstr "Steuerung Links"
+
+#: lib/gui/menu.cpp:267
+msgid "Right Alt"
+msgstr "Alt Rechts"
+
+#: lib/gui/menu.cpp:270
+msgid "Left Alt"
+msgstr "Alt Links"
+
#: src/worldmap.cpp:802
msgid "GAMEOVER"
msgstr "Game Over"
-#: src/worldmap.cpp:805
-#: src/gameloop.cpp:922
+#: src/worldmap.cpp:805 src/gameloop.cpp:922
#, c-format
msgid "COINS: %d"
msgstr "Münzen: %d"
msgid "Total Statistics"
msgstr "Gesamt Statistiken"
-#: src/worldmap.cpp:963
-#: src/gameloop.cpp:843
+#: src/worldmap.cpp:963 src/gameloop.cpp:843
msgid "SCORE"
msgstr "Punkte"
-#: src/worldmap.cpp:967
-#: src/gameloop.cpp:865
-#: src/gameloop.cpp:866
+#: src/worldmap.cpp:967 src/gameloop.cpp:865 src/gameloop.cpp:866
msgid "COINS"
msgstr "Münzen"
-#: src/worldmap.cpp:988
-#: src/worldmap.cpp:989
-#: src/gameloop.cpp:887
+#: src/worldmap.cpp:988 src/worldmap.cpp:989 src/gameloop.cpp:887
#: src/gameloop.cpp:888
msgid "LIVES"
msgstr "Leben"
-#: src/title.cpp:124
-#: src/misc.cpp:98
+#: src/title.cpp:124 src/misc.cpp:98
msgid "Contrib Levels"
msgstr "Zusatzlevel"
-#: src/title.cpp:143
-#: src/title.cpp:216
-#: src/misc.cpp:129
-#: src/misc.cpp:140
-#: src/misc.cpp:153
-#: src/misc.cpp:164
-#: src/leveleditor.cpp:67
+#: src/title.cpp:143 src/title.cpp:216 src/misc.cpp:129 src/misc.cpp:140
+#: src/misc.cpp:153 src/misc.cpp:164 src/leveleditor.cpp:67
#: src/leveleditor.cpp:77
msgid "Back"
msgstr "Zurück"
-#: src/title.cpp:350
+#: src/title.cpp:351
msgid ""
"Copyright (c) 2003 SuperTux Devel Team\n"
"This game comes with ABSOLUTELY NO WARRANTY. This is free software, and you\n"
-"are welcome to redistribute it under certain conditions; see the file COPYING\n"
+"are welcome to redistribute it under certain conditions; see the file "
+"COPYING\n"
"for details.\n"
msgstr ""
"Copyright (c) 2003 SuperTux Devel Team\n"
"Diese Spiel kommt OHNE GEWÄHRLEISTUNG. Dies ist freie Software und sie\n"
-"dürfen sie gerne unter bestimmten Bedingungen weiterverteilen; Details finden\n"
+"dürfen sie gerne unter bestimmten Bedingungen weiterverteilen; Details "
+"finden\n"
"Sie in der Datei COPYING.\n"
-#: src/title.cpp:404
+#: src/title.cpp:408
msgid "Are you sure you want to delete slot"
msgstr "Sind sie sicher, dass sie den Spielstand löschen wollen?"
msgid "Min time needed: %d / %d"
msgstr "Min Zeit benötigt: %d / %d"
-#: src/misc.cpp:97
-#: src/misc.cpp:156
+#: src/misc.cpp:97 src/misc.cpp:156
msgid "Start Game"
msgstr "Spiel Beginnen"
-#: src/misc.cpp:99
-#: src/misc.cpp:104
-#: src/misc.cpp:179
-#: src/misc.cpp:186
+#: src/misc.cpp:99 src/misc.cpp:104 src/misc.cpp:179 src/misc.cpp:186
msgid "Options"
msgstr "Einstellungen"
-#: src/misc.cpp:100
-#: src/leveleditor.cpp:562
+#: src/misc.cpp:100 src/leveleditor.cpp:562
msgid "Level Editor"
msgstr "Level Editor"
msgid "Fullscreen"
msgstr "Ganzer Bildschirm"
-#: src/misc.cpp:114
-#: src/misc.cpp:119
+#: src/misc.cpp:114 src/misc.cpp:119
msgid "Sound "
msgstr "Sound"
-#: src/misc.cpp:115
-#: src/misc.cpp:120
+#: src/misc.cpp:115 src/misc.cpp:120
msgid "Music "
msgstr "Musik"
msgid "Save Game"
msgstr "Spiel Speichern"
-#: src/misc.cpp:176
-#: src/misc.cpp:183
+#: src/misc.cpp:176 src/misc.cpp:183
msgid "Pause"
msgstr "Pause"
-#: src/misc.cpp:178
-#: src/misc.cpp:185
+#: src/misc.cpp:178 src/misc.cpp:185
msgid "Continue"
msgstr "Fortsetzen"
msgid "Setup level"
msgstr "Level-Einstellungen"
-#: src/leveleditor.cpp:237
-#: src/leveleditor.cpp:727
-#: src/leveleditor.cpp:752
+#: src/leveleditor.cpp:237 src/leveleditor.cpp:727 src/leveleditor.cpp:752
#: src/leveleditor.cpp:841
msgid "Level not saved. Wanna to?"
msgstr "Level wurde noch nicht gespeichert. Jetzt speichern?"
#, c-format
msgid "New max combo: %d"
msgstr "Neue Max Kombination: %d"
-
Coin(const Vector& pos);
~Coin();
- virtual HitResponse collision(GameObject& other, const CollisionHit& hit);
- virtual void action(float elapsed_time);
- virtual void draw(DrawingContext& context);
+ HitResponse collision(GameObject& other, const CollisionHit& hit);
+ void action(float elapsed_time);
+ void draw(DrawingContext& context);
void collect();
#include "app/globals.h"
#include "app/gettext.h"
+#include "special/sprite_manager.h"
#include "player.h"
#include "defines.h"
#include "scene.h"
#include "object/tilemap.h"
#include "object/camera.h"
#include "object/gameobjs.h"
+#include "object/portable.h"
#include "trigger/trigger_base.h"
static const int TILES_FOR_BUTTJUMP = 3;
Surface* tux_life = 0;
-Sprite* smalltux_gameover = 0;
-Sprite* smalltux_star = 0;
-Sprite* bigtux_star = 0;
-
TuxBodyParts* small_tux = 0;
TuxBodyParts* big_tux = 0;
TuxBodyParts* fire_tux = 0;
}
Player::Player()
+ : grabbed_object(0)
{
+ smalltux_gameover = sprite_manager->create("smalltux-gameover");
+ smalltux_star = sprite_manager->create("smalltux-star");
+ bigtux_star = sprite_manager->create("bigtux-star");
init();
}
Player::~Player()
{
+ delete smalltux_gameover;
+ delete smalltux_star;
+ delete bigtux_star;
}
void
Player::init()
{
- holding_something = false;
-
bbox.set_size(31.8, 31.8);
size = SMALL;
flaps_nb = 0;
on_ground_flag = false;
+ grabbed_object = 0;
player_input_init(&input);
return;
}
- if (input.fire == UP)
- holding_something = false;
+ if(input.fire == UP)
+ grabbed_object = 0;
+
if(dying == DYING_NOT)
handle_input();
movement = physic.get_movement(elapsed_time);
+ on_ground_flag = false;
#if 0
- // special exception for cases where we're stuck under tiles after
- // being ducked. In this case we drift out
- if(!duck && on_ground() && old_base.x == base.x && old_base.y == base.y
- && collision_object_map(base))
- {
- base.x += elapsed_time * WALK_SPEED * (dir ? 1: -1);
- previous_base = old_base = base;
- }
-
- /* Reset score multiplier (for multi-hits): */
- if (!invincible_timer.started())
- {
- if(player_status.score_multiplier > player_status.max_score_multiplier)
- {
- player_status.max_score_multiplier = player_status.score_multiplier;
-
- // show a message
- char str[124];
- sprintf(str, _("New max combo: %d"), player_status.max_score_multiplier-1);
- Sector::current()->add_floating_text(base, str);
- }
- player_status.score_multiplier = 1;
- }
- }
-
- }
+ // special exception for cases where we're stuck under tiles after
+ // being ducked. In this case we drift out
+ if(!duck && on_ground() && old_base.x == base.x && old_base.y == base.y
+ && collision_object_map(base)) {
+ base.x += elapsed_time * WALK_SPEED * (dir ? 1: -1);
+ previous_base = old_base = base;
+ }
#endif
- on_ground_flag = false;
+ if(grabbed_object != 0) {
+ Vector pos = get_pos() +
+ Vector(dir == LEFT ? -16 : 16,
+ bbox.get_height()*0.66666 - 32);
+ grabbed_object->grab(*this, pos);
+ }
}
bool
}
// changing directions?
- if(on_ground() && ((vx < 0 && dirsign >0) || (vx>0 && dirsign<0)))
- {
- // let's skid!
- if(fabs(vx)>SKID_XM && !skidding_timer.started())
- {
- skidding_timer.start(SKID_TIME);
- SoundManager::get()->play_sound(IDToSound(SND_SKID));
- // dust some partcles
- Sector::current()->add_object(
- new Particles(
- Vector(bbox.p1.x + (dir == RIGHT ? bbox.get_width() : 0),
- bbox.p2.y),
- dir == RIGHT ? 270+20 : 90-40, dir == RIGHT ? 270+40 : 90-20,
- Vector(280,-260), Vector(0,0.030), 3, Color(100,100,100), 3, .8,
- LAYER_OBJECTS+1));
-
- ax *= 2.5;
- }
- else
- {
- ax *= 2;
- }
+ if(on_ground() && ((vx < 0 && dirsign >0) || (vx>0 && dirsign<0))) {
+ // let's skid!
+ if(fabs(vx)>SKID_XM && !skidding_timer.started()) {
+ skidding_timer.start(SKID_TIME);
+ SoundManager::get()->play_sound(IDToSound(SND_SKID));
+ // dust some partcles
+ Sector::current()->add_object(
+ new Particles(
+ Vector(bbox.p1.x + (dir == RIGHT ? bbox.get_width() : 0),
+ bbox.p2.y),
+ dir == RIGHT ? 270+20 : 90-40, dir == RIGHT ? 270+40 : 90-20,
+ Vector(280,-260), Vector(0,0.030), 3, Color(100,100,100), 3, .8,
+ LAYER_OBJECTS+1));
+
+ ax *= 2.5;
+ } else {
+ ax *= 2;
}
+ }
// we get slower when not pressing any keys
if(dirsign == 0) {
- if(fabs(vx) < WALK_SPEED) {
- vx = 0;
- ax = 0;
- } else if(vx < 0) {
- ax = WALK_ACCELERATION_X * 1.5;
- } else {
- ax = WALK_ACCELERATION_X * -1.5;
- }
+ if(fabs(vx) < WALK_SPEED) {
+ vx = 0;
+ ax = 0;
+ } else if(vx < 0) {
+ ax = WALK_ACCELERATION_X * 1.5;
+ } else {
+ ax = WALK_ACCELERATION_X * -1.5;
+ }
}
#if 0
}
}
- // Hover
- //(disabled by default, use cheat code "hover" to toggle on/off)
- //TODO: needs some tweaking, especially when used together with double jump and jumping off badguys
- if (enable_hover && input.jump == DOWN && !jumping && !butt_jump && physic.get_velocity_y() <= 0)
- {
- physic.set_velocity_y(-100);
- }
-
#if 0
/* In case the player has pressed Down while in a certain range of air,
enable butt jump action */
}
void
-Player::grabdistros()
-{
-}
-
-void
Player::draw(DrawingContext& context)
{
TuxBodyParts* tux_body;
}
// Tux is holding something
- if ((holding_something && physic.get_velocity_y() == 0) ||
+ if ((grabbed_object != 0 && physic.get_velocity_y() == 0) ||
(shooting_timer.get_timeleft() > 0 && !shooting_timer.check()))
{
if (duck)
HitResponse
Player::collision(GameObject& other, const CollisionHit& hit)
{
+ Portable* portable = dynamic_cast<Portable*> (&other);
+ if(portable && grabbed_object == 0 && input.fire == DOWN
+ && fabsf(hit.normal.x) > .9) {
+ grabbed_object = portable;
+ return CONTINUE;
+ }
+
if(other.get_flags() & FLAG_SOLID) {
if(hit.normal.y < 0) { // landed on floor?
if (physic.get_velocity_y() < 0)
#ifndef SUPERTUX_PLAYER_H
#define SUPERTUX_PLAYER_H
+#include <vector>
#include "SDL.h"
#include "timer.h"
using namespace SuperTux;
class BadGuy;
+class Portable;
/* Times: */
#define TUX_FLAPPING_TIME 1 /* How long Tux can flap his wings to gain additional jump height */
#define TIME_WARNING 20 /* When to alert player they're low on time! */
-/* Scores: */
-
-#define SCORE_BRICK 5
-#define SCORE_DISTRO 20
-
/* Sizes: */
-
#define SMALL 0
#define BIG 1
-#include <vector>
-
struct PlayerKeymap
{
public:
extern Surface* tux_life;
-extern Sprite* smalltux_gameover;
-extern Sprite* smalltux_star;
-extern Sprite* bigtux_star;
#define GROWING_TIME 1.0
#define GROWING_FRAMES 7
int got_power;
int size;
bool duck;
- bool holding_something;
bool dead;
DyingType dying;
int key_event(SDLKey key, int state);
void level_begin();
void handle_input();
- void grabdistros();
PlayerStatus& get_status();
{
return invincible_timer.started();
}
+
void kill(HurtMode mode);
void player_remove_powerups();
void check_bounds(Camera* camera);
- bool on_ground();
- bool under_solid();
void grow(bool animate = false);
void move(const Vector& vector);
{ return dead; }
private:
+ bool on_ground();
+
void init();
void handle_horizontal_input();
void handle_vertical_input();
void remove_powerups();
+
+ Portable* grabbed_object;
+
+ Sprite* smalltux_gameover;
+ Sprite* smalltux_star;
+ Sprite* bigtux_star;
};
#endif /*SUPERTUX_PLAYER_H*/
-
-/* Local Variables: */
-/* mode:c++ */
-/* End: */
--- /dev/null
+#ifndef __PORTABLE_H__
+#define __PORTABLE_H__
+
+#include "special/moving_object.h"
+
+using namespace SuperTux;
+
+/**
+ * An object that inherits from this object is considered "portable" and can
+ * be carried around by the player.
+ * The object has to additionally set the PORTABLE flag (this allows to
+ * make the object only temporarily portable by resetting the flag)
+ */
+class Portable
+{
+public:
+ /**
+ * called each frame when the object has been grabbed.
+ */
+ virtual void grab(MovingObject& object, const Vector& pos) = 0;
+};
+
+#endif
--- /dev/null
+#include <config.h>
+
+#include "rock.h"
+#include "special/sprite.h"
+#include "special/sprite_manager.h"
+#include "lisp/writer.h"
+#include "video/drawing_context.h"
+#include "resources.h"
+
+Rock::Rock(const lisp::Lisp& reader)
+{
+ reader.get("x", bbox.p1.x);
+ reader.get("y", bbox.p1.y);
+ bbox.set_size(31.8, 31.8);
+ sprite = sprite_manager->create("rock");
+ grabbed = false;
+ flags |= FLAG_SOLID;
+}
+
+Rock::~Rock()
+{
+ delete sprite;
+}
+
+void
+Rock::write(lisp::Writer& writer)
+{
+ writer.start_list("rock");
+
+ writer.write_float("x", bbox.p1.x);
+ writer.write_float("y", bbox.p1.y);
+
+ writer.end_list("rock");
+}
+
+void
+Rock::draw(DrawingContext& context)
+{
+
+ sprite->draw(context, get_pos(), LAYER_OBJECTS);
+}
+
+void
+Rock::action(float elapsed_time)
+{
+ if(!grabbed) {
+ flags |= FLAG_SOLID;
+ flags &= ~FLAG_NO_COLLDET;
+ movement = physic.get_movement(elapsed_time);
+ } else {
+ physic.set_velocity(0, 0);
+ flags &= ~FLAG_SOLID;
+ flags |= FLAG_NO_COLLDET;
+ }
+
+ grabbed = false;
+}
+
+HitResponse
+Rock::collision(GameObject& , const CollisionHit& )
+{
+ if(grabbed)
+ return FORCE_MOVE;
+
+ physic.set_velocity(0, 0);
+ return CONTINUE;
+}
+
+void
+Rock::grab(MovingObject& , const Vector& pos)
+{
+ movement = pos - get_pos();
+ grabbed = true;
+}
+
--- /dev/null
+#ifndef __ROCK_H__
+#define __ROCK_H__
+
+#include "special/moving_object.h"
+#include "math/physic.h"
+#include "lisp/lisp.h"
+#include "portable.h"
+#include "serializable.h"
+
+namespace SuperTux {
+ class Sprite;
+}
+
+class Rock : public MovingObject, public Portable, public Serializable
+{
+public:
+ Rock(const lisp::Lisp& reader);
+ virtual ~Rock();
+
+ HitResponse collision(GameObject& other, const CollisionHit& hit);
+ void action(float elapsed_time);
+ void draw(DrawingContext& context);
+ void write(lisp::Writer& writer);
+
+ void grab(MovingObject& object, const Vector& pos);
+
+private:
+ bool grabbed;
+ Sprite* sprite;
+ Physic physic;
+};
+
+#endif
#include "object/gameobjs.h"
#include "object/player.h"
-Surface* img_waves[3];
-Surface* img_water;
-Surface* img_pole;
-Surface* img_poletop;
-Surface* img_flag[2];
-Surface* img_cloud[2][4];
-Surface* img_distro[4];
-
Menu* main_menu = 0;
Menu* game_menu = 0;
Menu* options_menu = 0;
/* Load graphics/sounds shared between all levels: */
void loadshared()
{
-
/* Load global images: */
gold_text = new Font(datadir + "/images/fonts/gold.png", Font::TEXT, 16,18);
blue_text = new Font(datadir + "/images/fonts/blue.png", Font::TEXT, 16,18,3);
tile_manager = new TileManager("/images/tilesets/supertux.stgt");
/* Tuxes: */
- smalltux_star = sprite_manager->create("smalltux-star");
- bigtux_star = sprite_manager->create("bigtux-star");
- smalltux_gameover = sprite_manager->create("smalltux-gameover");
-
char img_name[1024];
for (int i = 0; i < GROWING_FRAMES; i++)
{
ice_tux->arms = sprite_manager->create("big-tux-arms");
ice_tux->feet = sprite_manager->create("big-tux-feet");
- /* Water: */
- img_water = new Surface(datadir + "/images/shared/water.png", false);
-
- img_waves[0] = new Surface(datadir + "/images/shared/waves-0.png",
- true);
-
- img_waves[1] = new Surface(datadir + "/images/shared/waves-1.png",
- true);
-
-
- img_waves[2] = new Surface(datadir + "/images/shared/waves-2.png",
- true);
-
-
- /* Pole: */
-
- img_pole = new Surface(datadir + "/images/shared/pole.png", true);
- img_poletop = new Surface(datadir + "/images/shared/poletop.png",
- true);
-
-
- /* Flag: */
-
- img_flag[0] = new Surface(datadir + "/images/shared/flag-0.png",
- true);
- img_flag[1] = new Surface(datadir + "/images/shared/flag-1.png",
- true);
-
-
- /* Cloud: */
-
- img_cloud[0][0] = new Surface(datadir + "/images/shared/cloud-00.png",
- true);
-
- img_cloud[0][1] = new Surface(datadir + "/images/shared/cloud-01.png",
- true);
-
- img_cloud[0][2] = new Surface(datadir + "/images/shared/cloud-02.png",
- true);
-
- img_cloud[0][3] = new Surface(datadir + "/images/shared/cloud-03.png",
- true);
-
-
- img_cloud[1][0] = new Surface(datadir + "/images/shared/cloud-10.png",
- true);
-
- img_cloud[1][1] = new Surface(datadir + "/images/shared/cloud-11.png",
- true);
-
- img_cloud[1][2] = new Surface(datadir + "/images/shared/cloud-12.png",
- true);
-
- img_cloud[1][3] = new Surface(datadir + "/images/shared/cloud-13.png",
- true);
-
/* Objects */
load_object_gfx();
- /* Distros: */
- img_distro[0] = new Surface(datadir + "/images/tilesets/coin1.png",
- true);
-
- img_distro[1] = new Surface(datadir + "/images/tilesets/coin2.png",
- true);
-
- img_distro[2] = new Surface(datadir + "/images/tilesets/coin3.png",
- true);
-
- img_distro[3] = new Surface(datadir + "/images/tilesets/coin2.png",
- true);
-
-
/* Tux life: */
-
tux_life = new Surface(datadir + "/images/shared/tux-life.png",
true);
/* Sound effects: */
- /* if (use_sound) // this will introduce SERIOUS bugs here ! because "load_sound"
- // initialize sounds[i] with the correct pointer's value:
- // NULL or something else. And it will be dangerous to
- // play with not-initialized pointers.
- // This is also true with if (use_music)
- Send a mail to me: neoneurone@users.sf.net, if you have another opinion. :)
- */
for (i = 0; i < NUM_SOUNDS; i++)
- SoundManager::get
- ()->add_sound(SoundManager::get
+ SoundManager::get()->add_sound(SoundManager::get
()->load_sound(datadir + soundfilenames[i]),i);
/* Herring song */
/* Free shared data: */
void unloadshared(void)
{
- delete smalltux_star;
- delete bigtux_star;
- delete smalltux_gameover;
-
/* Free global images: */
delete gold_text;
delete white_text;
free_object_gfx();
- delete img_water;
- for (int i = 0; i < 3; i++)
- delete img_waves[i];
-
- delete img_pole;
- delete img_poletop;
-
- for (int i = 0; i < 2; i++)
- delete img_flag[i];
-
- for (int i = 0; i < 4; i++) {
- delete img_distro[i];
- delete img_cloud[0][i];
- delete img_cloud[1][i];
- }
-
delete tux_life;
delete small_tux;
extern char* soundfilenames[NUM_SOUNDS];
-extern Surface* img_waves[3];
-extern Surface* img_water;
-extern Surface* img_pole;
-extern Surface* img_poletop;
-extern Surface* img_flag[2];
-extern Surface* img_cloud[2][4];
-
extern Surface* img_super_bkgd;
extern MusicRef herring_song;
extern Font* white_big_text;
extern Font* yellow_nums;
-// maps a virtual resource path to a real path (ie. levels/bla is mapped to
-// $DATADIR/levels/bla or $HOME/.supertux/levels/bla)
+/** maps a virtual resource path to a real path (ie. levels/bla is mapped to
+ * $DATADIR/levels/bla or $HOME/.supertux/levels/bla)
+ * All paths inside the game should be handled in as virtual paths and then
+ * expanded with this function just before the call to fopen or std::ifstream.
+ */
std::string get_resource_filename(const std::string& resource);
void loadshared();
void unloadshared();
#endif
-
#include "object/invisible_block.h"
#include "object/platform.h"
#include "object/bullet.h"
+#include "object/rock.h"
#include "badguy/jumpy.h"
#include "badguy/snowball.h"
#include "badguy/bouncing_snowball.h"
return new Spiky(reader);
} else if(name == "nolok_01") {
return new Nolok_01(reader);
+ } else if(name == "rock") {
+ return new Rock(reader);
}
std::cerr << "Unknown object type '" << name << "'.\n";