super-tux-commit Mailing List for Super Tux (Page 63)
Brought to you by:
wkendrick
You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
(94) |
Apr
(500) |
May
(531) |
Jun
(196) |
Jul
(224) |
Aug
(193) |
Sep
(117) |
Oct
(115) |
Nov
(319) |
Dec
(97) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(19) |
Feb
|
Mar
(105) |
Apr
(41) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2007 |
Jan
(1) |
Feb
(2) |
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
(2) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(4) |
Jul
|
Aug
|
Sep
(7) |
Oct
(12) |
Nov
(26) |
Dec
(39) |
2009 |
Jan
(6) |
Feb
(15) |
Mar
(10) |
Apr
(25) |
May
(29) |
Jun
(21) |
Jul
(26) |
Aug
(8) |
Sep
(3) |
Oct
|
Nov
|
Dec
(10) |
2010 |
Jan
(5) |
Feb
(5) |
Mar
(2) |
Apr
|
May
(5) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
(2) |
Oct
(2) |
Nov
|
Dec
|
From: Matze B. <mat...@us...> - 2004-05-23 20:20:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7534 Modified Files: level.cpp Log Message: default image changed to arctis.jpg Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.82 retrieving revision 1.83 diff -u -d -r1.82 -r1.83 --- level.cpp 21 May 2004 00:22:57 -0000 1.82 +++ level.cpp 23 May 2004 20:20:20 -0000 1.83 @@ -220,7 +220,7 @@ name = "UnNamed"; author = "UnNamed"; song_title = "Mortimers_chipdisko.mod"; - bkgd_image = "arctis.png"; + bkgd_image = "arctis.jpg"; width = 0; height = 0; start_pos_x = 100; |
From: Ricardo C. <rm...@us...> - 2004-05-23 00:12:07
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8984/src Modified Files: player.cpp player.h Log Message: Made butt-jump to behave according to what Marek asked. You can tune a definition... Now, we just need a butt-jump image. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.117 retrieving revision 1.118 diff -u -d -r1.117 -r1.118 --- player.cpp 22 May 2004 15:27:40 -0000 1.117 +++ player.cpp 23 May 2004 00:11:58 -0000 1.118 @@ -29,9 +29,12 @@ #include "sprite.h" #include "screen.h" -#define AUTOSCROLL_DEAD_INTERVAL 300 +// behavior definitions: +#define TILES_FOR_BUTTJUMP 3 // animation times (in ms): #define SHOOTING_TIME 320 +// others stuff: +#define AUTOSCROLL_DEAD_INTERVAL 300 Surface* tux_life; @@ -310,6 +313,19 @@ issolid(base.x + base.width - 1, base.y) ); } +bool +Player::tiles_on_air(int tiles) +{ + for(int t = 0; t != tiles; t++) + { + if(issolid(base.x + base.width / 2, base.y + base.height + (tiles*32)) || + issolid(base.x + 1, base.y + base.height + (tiles*32)) || + issolid(base.x + base.width - 1, base.y + base.height + (tiles*32))) + return false; + } + return true; +} + void Player::handle_horizontal_input() { @@ -415,7 +431,6 @@ --base.y; jumping = true; can_jump = false; - butt_jump = true; // player started jumping, enable butt jump if (size == SMALL) play_sound(sounds[SND_JUMP], SOUND_CENTER_SPEAKER); else @@ -426,15 +441,19 @@ { jumping = false; physic.set_velocity_y(0); - butt_jump = false; // jump was not full, disable butt jump } - /* Do butt jump, in case the player has done the combination - (full jump and hold DOWN) */ - if (input.down == UP && physic.get_velocity_y() == World::current()->get_level()->gravity && butt_jump) - butt_jump = false; // in case DOWN is not hold after the full jump, disable it - - if (input.down == DOWN && butt_jump && on_ground() && size == BIG) + /* In case the player has pressed Down while in a certain range of air, + enable butt jump action */ + if (input.down == DOWN && !butt_jump) + if(tiles_on_air(TILES_FOR_BUTTJUMP)) + butt_jump = true; + + /* When Down is not held anymore, disable butt jump */ + if(butt_jump && input.down == UP) + butt_jump = false; + + if (butt_jump && on_ground() && size == BIG) { if(World::current()->trybreakbrick(base.x, base.y + base.height, false) || World::current()->trybreakbrick( @@ -442,7 +461,7 @@ // make tux jumping a little bit again after breaking the bricks physic.set_velocity_y(2); } -// butt_jump = false; +// butt_jump = false; // comment this, in case you won't to disable the continued use of buttjump } if ( (issolid(base.x + base.width / 2, base.y + base.height + 64) || Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- player.h 22 May 2004 15:27:45 -0000 1.59 +++ player.h 23 May 2004 00:11:58 -0000 1.60 @@ -162,6 +162,7 @@ void check_bounds(ViewPort& viewport, bool back_scrolling, bool hor_autoscroll); bool on_ground(); bool under_solid(); + bool tiles_on_air(int tiles); void grow(); private: |
From: Ricardo C. <rm...@us...> - 2004-05-22 18:42:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14153/src Modified Files: badguy.cpp Log Message: Don't remove badguys, just because they are out of the screen borders. Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.85 retrieving revision 1.86 diff -u -d -r1.85 -r1.86 --- badguy.cpp 22 May 2004 17:55:39 -0000 1.85 +++ badguy.cpp 22 May 2004 18:42:40 -0000 1.86 @@ -758,13 +758,6 @@ float scroll_y = World::current()->displaymanager .get_viewport().get_translation().y; - // Remove if it's far off the screen: - if (base.x < scroll_x - X_OFFSCREEN_DISTANCE) - { - remove_me(); - return; - } - // BadGuy fall below the ground if (base.y > World::current()->get_level()->height * 32) { remove_me(); |
From: Ricardo C. <rm...@us...> - 2004-05-22 17:55:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6029/src Modified Files: badguy.cpp defines.h special.cpp Log Message: Fixes. Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.84 retrieving revision 1.85 diff -u -d -r1.84 -r1.85 --- badguy.cpp 21 May 2004 00:22:57 -0000 1.84 +++ badguy.cpp 22 May 2004 17:55:39 -0000 1.85 @@ -755,9 +755,11 @@ { float scroll_x = World::current()->displaymanager .get_viewport().get_translation().x; + float scroll_y = World::current()->displaymanager + .get_viewport().get_translation().y; // Remove if it's far off the screen: - if (base.x < scroll_x - OFFSCREEN_DISTANCE) + if (base.x < scroll_x - X_OFFSCREEN_DISTANCE) { remove_me(); return; @@ -781,7 +783,10 @@ } // Once it's on screen, it's activated! - if (base.x <= scroll_x + screen->w + OFFSCREEN_DISTANCE) + if (base.x > scroll_x - X_OFFSCREEN_DISTANCE && + base.x < scroll_x + screen->w + X_OFFSCREEN_DISTANCE && + base.y > scroll_y - Y_OFFSCREEN_DISTANCE && + base.y < scroll_y + screen->h + Y_OFFSCREEN_DISTANCE) seen = true; if(!seen) Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- defines.h 21 May 2004 23:37:56 -0000 1.40 +++ defines.h 22 May 2004 17:55:44 -0000 1.41 @@ -92,7 +92,8 @@ /* Size constraints: */ -#define OFFSCREEN_DISTANCE 256 +#define X_OFFSCREEN_DISTANCE 280 +#define Y_OFFSCREEN_DISTANCE 240 #define LEVEL_WIDTH 375 Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- special.cpp 21 May 2004 00:22:57 -0000 1.48 +++ special.cpp 22 May 2004 17:55:44 -0000 1.49 @@ -190,15 +190,15 @@ World::current()->displaymanager.get_viewport().get_translation().x; float scroll_y = World::current()->displaymanager.get_viewport().get_translation().y; - if(base.x < scroll_x - OFFSCREEN_DISTANCE - || base.y < scroll_y - OFFSCREEN_DISTANCE) { - remove_me(); - return; - } - if(base.y > scroll_y + screen->h) { + + if(base.x < scroll_x - X_OFFSCREEN_DISTANCE || + base.x > scroll_x + screen->w + X_OFFSCREEN_DISTANCE || + base.y < scroll_y - Y_OFFSCREEN_DISTANCE || + base.y > scroll_y + screen->h + Y_OFFSCREEN_DISTANCE) + { remove_me(); return; - } + } /* Move around? */ physic.apply(elapsed_time, base.x, base.y); |
From: Ricardo C. <rm...@us...> - 2004-05-22 15:27:54
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10618/src Modified Files: player.cpp player.h world.cpp world.h Log Message: Tux shows arm when firing. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.116 retrieving revision 1.117 diff -u -d -r1.116 -r1.117 --- player.cpp 21 May 2004 00:43:30 -0000 1.116 +++ player.cpp 22 May 2004 15:27:40 -0000 1.117 @@ -30,6 +30,8 @@ #include "screen.h" #define AUTOSCROLL_DEAD_INTERVAL 300 +// animation times (in ms): +#define SHOOTING_TIME 320 Surface* tux_life; @@ -110,6 +112,7 @@ safe_timer.init(true); frame_timer.init(true); kick_timer.init(true); + shooting_timer.init(true); physic.reset(); } @@ -474,8 +477,9 @@ /* Shoot! */ if (input.fire == DOWN && input.old_fire == UP && got_power != NONE_POWER) { - World::current()->add_bullet(Vector(base.x, base.y + (base.height/2)), - physic.get_velocity_x(), dir); + if(World::current()->add_bullet(Vector(base.x, base.y + (base.height/2)), + physic.get_velocity_x(), dir)) + shooting_timer.start(SHOOTING_TIME); input.old_fire = DOWN; } @@ -590,7 +594,7 @@ if(layer == LAYER_OBJECTS + 1) { // Draw arm overlay graphics when Tux is holding something - if (holding_something && physic.get_velocity_y() == 0) + if ((holding_something && physic.get_velocity_y() == 0) || shooting_timer.check()) { if (dir == RIGHT) sprite->grab_right->draw(pos); Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- world.h 21 May 2004 00:22:57 -0000 1.46 +++ world.h 22 May 2004 15:27:45 -0000 1.47 @@ -106,7 +106,7 @@ BadGuy* add_bad_guy(float x, float y, BadGuyKind kind); void add_upgrade(const Vector& pos, Direction dir, UpgradeKind kind); - void add_bullet(const Vector& pos, float xm, Direction dir); + bool add_bullet(const Vector& pos, float xm, Direction dir); /** Try to grab the coin at the given coordinates */ void trygrabdistro(float x, float y, int bounciness); Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.108 retrieving revision 1.109 diff -u -d -r1.108 -r1.109 --- world.cpp 21 May 2004 00:22:57 -0000 1.108 +++ world.cpp 22 May 2004 15:27:45 -0000 1.109 @@ -538,18 +538,18 @@ add_object(new Upgrade(displaymanager, pos, dir, kind)); } -void +bool World::add_bullet(const Vector& pos, float xm, Direction dir) { if(tux->got_power == Player::FIRE_POWER) { if(bullets.size() > MAX_FIRE_BULLETS-1) - return; + return false; } else if(tux->got_power == Player::ICE_POWER) { if(bullets.size() > MAX_ICE_BULLETS-1) - return; + return false; } Bullet* new_bullet = 0; @@ -562,6 +562,8 @@ add_object(new_bullet); play_sound(sounds[SND_SHOOT], SOUND_CENTER_SPEAKER); + + return true; } void Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.58 retrieving revision 1.59 diff -u -d -r1.58 -r1.59 --- player.h 21 May 2004 00:22:57 -0000 1.58 +++ player.h 22 May 2004 15:27:45 -0000 1.59 @@ -135,6 +135,7 @@ Timer safe_timer; Timer frame_timer; Timer kick_timer; + Timer shooting_timer; // used to show the arm when Tux is shooting Physic physic; public: |
From: Ryan F. <sik...@us...> - 2004-05-21 23:38:05
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15381 Modified Files: menu.cpp menu.h defines.h Log Message: - made some changes for joystick in menu. better? Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- menu.cpp 14 May 2004 05:14:30 -0000 1.72 +++ menu.cpp 21 May 2004 23:37:55 -0000 1.73 @@ -326,6 +326,8 @@ arrange_left = 0; active_item = 0; effect.init(false); + + joystick_timer.init(true); } void Menu::set_pos(int x, int y, float rw, float rh) @@ -818,10 +820,18 @@ case SDL_JOYAXISMOTION: if(event.jaxis.axis == joystick_keymap.y_axis) { - if (event.jaxis.value > 1024) + if (event.jaxis.value > joystick_keymap.dead_zone && !joystick_timer.started()) + { menuaction = MENU_ACTION_DOWN; - else if (event.jaxis.value < -1024) + joystick_timer.start(JOYSTICK_MENU_DELAY); + } + else if (event.jaxis.value < -joystick_keymap.dead_zone && !joystick_timer.started()) + { menuaction = MENU_ACTION_UP; + joystick_timer.start(JOYSTICK_MENU_DELAY); + } + else + joystick_timer.stop(); } break; case SDL_JOYBUTTONDOWN: Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- defines.h 14 May 2004 20:50:22 -0000 1.39 +++ defines.h 21 May 2004 23:37:56 -0000 1.40 @@ -39,6 +39,9 @@ #define UP 0 #define DOWN 1 +/* Joystick menu delay */ +#define JOYSTICK_MENU_DELAY 500 + /* Dying types: */ /* ---- NO 0 */ Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- menu.h 14 May 2004 02:44:34 -0000 1.62 +++ menu.h 21 May 2004 23:37:55 -0000 1.63 @@ -179,6 +179,7 @@ /* input implementation variables */ int delete_character; char mn_input_char; + Timer joystick_timer; public: Timer effect; |
From: Ryan F. <sik...@us...> - 2004-05-21 19:35:24
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31693 Modified Files: leveleditor.cpp Log Message: - fixed level editor crash - inserting objects still doesn't work, however Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.124 retrieving revision 1.125 diff -u -d -r1.124 -r1.125 --- leveleditor.cpp 21 May 2004 00:22:57 -0000 1.124 +++ leveleditor.cpp 21 May 2004 19:35:14 -0000 1.125 @@ -27,6 +27,7 @@ #include <unistd.h> #include <SDL.h> #include <SDL_image.h> +#include <algorithm> #include "leveleditor.h" #include "screen.h" @@ -502,22 +503,21 @@ select_objects_menu->additem(MN_LABEL,"Objects",0,0); select_objects_menu->additem(MN_HL,"",0,0); // TODO fix this -#if 0 select_objects_menu->additem(MN_ACTION,"BadGuys",0,0,1); objects_map["BadGuys"] = new ButtonPanel(screen->w - 64,96, 64, 318); DisplayManager dummy; for(int i = 0; i < NUM_BadGuyKinds; ++i) { - BadGuy bad_tmp(dummy, 0,0,BadGuyKind(i),false); + BadGuy bad_tmp(dummy, BadGuyKind(i), 0, 0); objects_map["BadGuys"]->additem(new Button("", "BadGuy",(SDLKey)(i+'a'),0,0,32,32),1000000+i); objects_map["BadGuys"]->manipulate_button(i)->set_drawable(new BadGuy(dummy, + BadGuyKind(i), objects_map["BadGuys"]->manipulate_button(i)->get_pos().x, - objects_map["BadGuys"]->manipulate_button(i)->get_pos().y, - BadGuyKind(i), false)); + objects_map["BadGuys"]->manipulate_button(i)->get_pos().y + )); } -#endif select_objects_menu->additem(MN_HL,"",0,0); @@ -867,7 +867,7 @@ if(TileManager::instance()->get(le_current.tile)->editor_images.size() > 0) TileManager::instance()->get(le_current.tile)->editor_images[0]->draw( screen->w - 32, screen->h - 32); } -#if 0 // XXX FIXME TODO +#if 0 // XXX FIXME TODO: Do we have a new solution for draw_on_screen()? if(le_current.IsObject() && MouseCursor::current() != mouse_select_object) { le_current.obj->draw_on_screen(screen->w - 32, screen->h - 32); @@ -951,7 +951,7 @@ if(!TileManager::instance()->get(le_current.tile)->images.empty()) fillrect(cursor_x-pos_x,cursor_y-pos_y,TileManager::instance()->get(le_current.tile)->images[0]->w,TileManager::instance()->get(le_current.tile)->images[0]->h,50,50,50,50); } -#if 0 // XXX FIXME TODO +#if 0 // XXX FIXME TODO: Do we have a new solution for move_to()? if(le_current.IsObject()) { le_current.obj->move_to(cursor_x, cursor_y); @@ -1414,7 +1414,7 @@ { if(pbutton->get_state() == BUTTON_CLICKED) { -#if 0 // TODO fixme!! +#if 0 // TODO FIXME XXX: New solution for this? le_current.Object(pbutton->get_drawable()); #endif } @@ -1506,20 +1506,23 @@ } else { -#if 0 // FIXME TODO + // FIXME TODO if(le_current.IsObject()) { le_level_changed = true; std::string type = le_current.obj->type(); + if(type == "BadGuy") { + ViewPort viewport(le_world->displaymanager.get_viewport()); + DisplayManager dummy; BadGuy* pbadguy = dynamic_cast<BadGuy*>(le_current.obj); - le_world->bad_guys.push_back(new BadGuy(cursor_x+scroll_x, cursor_y,pbadguy->kind,false)); - le_world->get_level()->badguy_data.push_back(le_world->bad_guys.back()); + le_world->bad_guys.push_back(new BadGuy(dummy, pbadguy->kind, cursor_x + viewport.get_translation().x, cursor_y + viewport.get_translation().y)); + le_world->gameobjects.push_back(le_world->bad_guys.back()); } } -#endif + } le_mouse_clicked[LEFT] = false; @@ -1674,16 +1677,19 @@ /* if there is a bad guy over there, remove it */ // XXX TODO -#if 0 - for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); it != le_world->bad_guys.end(); ++it, ++i) - if(rectcollision(cursor_base,(*it)->base)) + for(std::vector<GameObject*>::iterator it = le_world->gameobjects.begin(); + it != le_world->gameobjects.end(); ++it) + if ((*it)->type() == "BadGuy") { - delete (*it); - le_world->bad_guys.erase(it); - le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); - break; + BadGuy* pbadguy = dynamic_cast<BadGuy*>((*it)); + if(rectcollision(cursor_base, pbadguy->base)) + { + delete (*it); + //le_world->bad_guys.erase(it); + le_world->gameobjects.erase(std::remove(le_world->gameobjects.begin(), le_world->gameobjects.end(), *it), le_world->gameobjects.end()); + break; + } } -#endif break; case SQUARE: @@ -1715,25 +1721,26 @@ /* if there is a bad guy over there, remove it */ // TODO FIXME -#if 0 - for(std::list<BadGuy*>::iterator it = le_world->bad_guys.begin(); - it != le_world->bad_guys.end(); /* will be at end of loop */) + for(std::vector<GameObject*>::iterator it = le_world->gameobjects.begin(); + it != le_world->gameobjects.end(); ++it /* will be at end of loop */) { - if((*it)->base.x/32 >= x1 && (*it)->base.x/32 <= x2 - && (*it)->base.y/32 >= y1 && (*it)->base.y/32 <= y2) - { - delete (*it); - it = le_world->bad_guys.erase(it); - le_world->get_level()->badguy_data.erase(le_world->get_level()->badguy_data.begin() + i); - continue; - } - else + if ((*it)->type() == "BadGuy") { - ++i; - ++it; + MovingObject* pmobject = dynamic_cast<MovingObject*> (*it); + if(pmobject->base.x/32 >= x1 && pmobject->base.x/32 <= x2 + && pmobject->base.y/32 >= y1 && pmobject->base.y/32 <= y2) + { + delete (*it); + //it = le_world->gameobjects.erase(it); + le_world->gameobjects.erase(std::remove(le_world->gameobjects.begin(), le_world->gameobjects.end(), *it), le_world->gameobjects.end()); + continue; + } + else + { + ++it; + } } } -#endif for(xx = x1; xx <= x2; xx++) for(yy = y1; yy <= y2; yy++) |
From: Matze B. <mat...@us...> - 2004-05-21 00:43:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18902/src Modified Files: player.cpp Log Message: fix firetux not being able to pickup stuff Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.115 retrieving revision 1.116 diff -u -d -r1.115 -r1.116 --- player.cpp 21 May 2004 00:22:57 -0000 1.115 +++ player.cpp 21 May 2004 00:43:30 -0000 1.116 @@ -474,7 +474,6 @@ /* Shoot! */ if (input.fire == DOWN && input.old_fire == UP && got_power != NONE_POWER) { - holding_something = true; World::current()->add_bullet(Vector(base.x, base.y + (base.height/2)), physic.get_velocity_x(), dir); input.old_fire = DOWN; |
From: Matze B. <mat...@us...> - 2004-05-21 00:23:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15232/src Modified Files: badguy.cpp gameloop.cpp level.cpp level.h leveleditor.cpp player.cpp player.h scene.cpp scene.h special.cpp title.cpp world.cpp world.h Log Message: eliminated global scroll_x and scroll_y variables Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- scene.cpp 11 May 2004 21:53:50 -0000 1.28 +++ scene.cpp 21 May 2004 00:22:57 -0000 1.29 @@ -68,9 +68,6 @@ return PlayerStatus::NO_BONUS; } -// FIXME: Move this into a view class -float scroll_x, scroll_y; - unsigned int global_frame_counter; // EOF // Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- world.h 20 May 2004 23:07:25 -0000 1.45 +++ world.h 21 May 2004 00:22:57 -0000 1.46 @@ -33,6 +33,7 @@ #include "display_manager.h" class Level; +class Background; /** The World class holds a level and all the game objects (badguys, bouncy distros, etc) that are needed to run a game. */ @@ -54,6 +55,7 @@ static World* current_; public: + Background* background; BadGuys bad_guys; std::vector<Upgrade*> upgrades; @@ -79,8 +81,8 @@ void set_defaults(); void draw(); - void action(double frame_ratio); - void scrolling(double frame_ratio); // camera scrolling + void action(float elapsed_time); + void scrolling(float elapsed_time); // camera scrolling void play_music(int musictype); int get_music_type(); Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- special.cpp 20 May 2004 23:07:25 -0000 1.47 +++ special.cpp 21 May 2004 00:22:57 -0000 1.48 @@ -95,9 +95,14 @@ else if(physic.get_velocity_y() < -9) physic.set_velocity_y(-9); + float scroll_x = + World::current()->displaymanager.get_viewport().get_translation().x; + float scroll_y = + World::current()->displaymanager.get_viewport().get_translation().y; if (base.x < scroll_x || base.x > scroll_x + screen->w || - base.y > screen->h || + base.y < scroll_y || + base.y > scroll_y + screen->h || issolid(base.x + 4, base.y + 2) || issolid(base.x, base.y + 2) || life_count <= 0) @@ -181,11 +186,16 @@ } /* Away from the screen? Kill it! */ - if(base.x < scroll_x - OFFSCREEN_DISTANCE) { + float scroll_x = + World::current()->displaymanager.get_viewport().get_translation().x; + float scroll_y = + World::current()->displaymanager.get_viewport().get_translation().y; + if(base.x < scroll_x - OFFSCREEN_DISTANCE + || base.y < scroll_y - OFFSCREEN_DISTANCE) { remove_me(); return; } - if(base.y > screen->h) { + if(base.y > scroll_y + screen->h) { remove_me(); return; } Index: level.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.h,v retrieving revision 1.51 retrieving revision 1.52 diff -u -d -r1.51 -r1.52 --- level.h 20 May 2004 23:07:24 -0000 1.51 +++ level.h 21 May 2004 00:22:57 -0000 1.52 @@ -140,9 +140,6 @@ /** Resize the level to a new width/height */ void resize(int new_width, int new_height); - /* Draw background */ - void draw_bg(); - /** Return the id of the tile at position x/y */ unsigned int gettileid(float x, float y) const; /** returns the id of the tile at position x,y Index: scene.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- scene.h 11 May 2004 21:53:50 -0000 1.29 +++ scene.h 21 May 2004 00:22:57 -0000 1.30 @@ -46,7 +46,6 @@ extern PlayerStatus player_status; -extern float scroll_x, scroll_y; extern unsigned int global_frame_counter; #endif /*SUPERTUX_SCENE_H*/ Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.83 retrieving revision 1.84 diff -u -d -r1.83 -r1.84 --- badguy.cpp 20 May 2004 23:07:24 -0000 1.83 +++ badguy.cpp 21 May 2004 00:22:57 -0000 1.84 @@ -35,6 +35,7 @@ #include "gameloop.h" #include "display_manager.h" #include "lispwriter.h" +#include "viewport.h" Sprite* img_mriceblock_flat_left; Sprite* img_mriceblock_flat_right; @@ -315,6 +316,9 @@ check_horizontal_bump(); if(mode == KICK && changed != dir) { + float scroll_x = World::current()->displaymanager + .get_viewport().get_translation().x; + /* handle stereo sound (number 10 should be tweaked...)*/ if (base.x < scroll_x + screen->w/2 - 10) play_sound(sounds[SND_RICOCHET], SOUND_LEFT_SPEAKER); @@ -514,6 +518,9 @@ dying = DYING_NOT; // now the bomb hurts timer.start(EXPLODETIME); + float scroll_x = World::current()->displaymanager + .get_viewport().get_translation().x; + /* play explosion sound */ // FIXME: is the stereo all right? maybe we should use player cordinates... if (base.x < scroll_x + screen->w/2 - 10) play_sound(sounds[SND_EXPLODE], SOUND_LEFT_SPEAKER); @@ -746,6 +753,9 @@ void BadGuy::action(float elapsed_time) { + float scroll_x = World::current()->displaymanager + .get_viewport().get_translation().x; + // Remove if it's far off the screen: if (base.x < scroll_x - OFFSCREEN_DISTANCE) { Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.135 retrieving revision 1.136 diff -u -d -r1.135 -r1.136 --- gameloop.cpp 20 May 2004 15:57:26 -0000 1.135 +++ gameloop.cpp 21 May 2004 00:22:57 -0000 1.136 @@ -53,6 +53,7 @@ #include "tile.h" #include "particlesystem.h" #include "resources.h" +#include "background.h" #include "music_manager.h" GameSession* GameSession::current_ = 0; @@ -145,8 +146,9 @@ music_manager->halt_music(); char str[60]; - - get_level()->draw_bg(); + + ViewPort dummy; + world->background->draw(dummy, LAYER_BACKGROUND0); sprintf(str, "%s", world->get_level()->name.c_str()); gold_text->drawf(str, 0, 220, A_HMIDDLE, A_TOP, 1); @@ -717,7 +719,8 @@ { char str[80]; - get_level()->draw_bg(); + ViewPort dummy; + world->background->draw(dummy, LAYER_BACKGROUND0); blue_text->drawf("Result:", 0, 200, A_HMIDDLE, A_TOP, 1); Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- leveleditor.cpp 20 May 2004 23:07:24 -0000 1.123 +++ leveleditor.cpp 21 May 2004 00:22:57 -0000 1.124 @@ -42,6 +42,7 @@ #include "tile.h" #include "resources.h" #include "music_manager.h" +#include "background.h" #include "display_manager.h" /* definitions to aid development */ @@ -524,8 +525,6 @@ int le_init() { - - level_subsets = dsubdirs("/levels", "level1.stl"); le_level_subset = new LevelSubset; @@ -535,7 +534,6 @@ active_tm = TM_IA; le_show_grid = true; show_selections = true; - scroll_x = 0; done = 0; le_frame = 0; /* support for frames in some tiles, like waves and bad guys */ @@ -944,7 +942,8 @@ Uint8 a; /* Draw the real background */ - le_world->get_level()->draw_bg(); + le_world->background->draw(le_world->displaymanager.get_viewport(), + LAYER_BACKGROUND0); if(le_current.IsTile()) { Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.114 retrieving revision 1.115 diff -u -d -r1.114 -r1.115 --- player.cpp 20 May 2004 23:46:50 -0000 1.114 +++ player.cpp 21 May 2004 00:22:57 -0000 1.115 @@ -669,7 +669,8 @@ } if (debug_mode) - fillrect(base.x - scroll_x, base.y - scroll_y, + fillrect(base.x - viewport.get_translation().x, + base.y - viewport.get_translation().y, base.width, base.height, 75,75,75, 150); } @@ -828,6 +829,10 @@ bool Player::is_dead() { + float scroll_x = + World::current()->displaymanager.get_viewport().get_translation().x; + float scroll_y = + World::current()->displaymanager.get_viewport().get_translation().y; if(base.y > screen->h + scroll_y || base.y > World::current()->get_level()->height*32 || base.x < scroll_x - AUTOSCROLL_DEAD_INTERVAL) // can happen in auto-scrolling return true; @@ -845,7 +850,8 @@ } void -Player::check_bounds(bool back_scrolling, bool hor_autoscroll) +Player::check_bounds(ViewPort& viewport, + bool back_scrolling, bool hor_autoscroll) { /* Keep tux in bounds: */ if (base.x < 0) @@ -860,17 +866,17 @@ kill(KILL); } - if(base.x < scroll_x && (!back_scrolling || hor_autoscroll)) // can happen if back scrolling is disabled - base.x = scroll_x; + if(base.x < viewport.get_translation().x && (!back_scrolling || hor_autoscroll)) // can happen if back scrolling is disabled + base.x = viewport.get_translation().x; if(hor_autoscroll) { - if(base.x == scroll_x) + if(base.x == viewport.get_translation().x) if(issolid(base.x+32, base.y) || (size != SMALL && issolid(base.x+32, base.y+32))) kill(KILL); - if(base.x + base.width > scroll_x + screen->w) - base.x = scroll_x + screen->w - base.width; + if(base.x + base.width > viewport.get_translation().x + screen->w) + base.x = viewport.get_translation().x + screen->w - base.width; } } Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.57 retrieving revision 1.58 diff -u -d -r1.57 -r1.58 --- player.h 20 May 2004 19:56:37 -0000 1.57 +++ player.h 21 May 2004 00:22:57 -0000 1.58 @@ -158,7 +158,7 @@ void is_dying(); bool is_dead(); void player_remove_powerups(); - void check_bounds(bool back_scrolling, bool hor_autoscroll); + void check_bounds(ViewPort& viewport, bool back_scrolling, bool hor_autoscroll); bool on_ground(); bool under_solid(); void grow(); Index: level.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/level.cpp,v retrieving revision 1.81 retrieving revision 1.82 diff -u -d -r1.81 -r1.82 --- level.cpp 20 May 2004 23:07:24 -0000 1.81 +++ level.cpp 21 May 2004 00:22:57 -0000 1.82 @@ -613,25 +613,6 @@ } } -void Level::draw_bg() -{ - if(img_bkgd) - { - // Tile background horizontally - int sx = (int)((float)scroll_x * ((float)bkgd_speed/100.0f)) % img_bkgd->w; - int sy = (int)((float)scroll_y * ((float)bkgd_speed/100.0f)) % img_bkgd->h; - for (int x = 0; (x-1)*img_bkgd->w <= screen->w; x++) - for (int y = 0; (y-1)*img_bkgd->h <= screen->h; y++) - img_bkgd->draw_part(x == 0 ? sx : 0, y == 0 ? sy : 0, - x == 0 ? 0 : (img_bkgd->w * x) - sx, y == 0 ? 0 : (img_bkgd->h * y) - sy, - x == 0 ? img_bkgd->w - sx : img_bkgd->w, y == 0 ? img_bkgd->h - sy : img_bkgd->h); - } - else - { - drawgradient(bkgd_top, bkgd_bottom); - } -} - void Level::load_song() { Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.107 retrieving revision 1.108 diff -u -d -r1.107 -r1.108 --- world.cpp 20 May 2004 23:58:31 -0000 1.107 +++ world.cpp 21 May 2004 00:22:57 -0000 1.108 @@ -59,13 +59,13 @@ get_level()->load_gfx(); // add background activate_particle_systems(); - Background* bg = new Background(displaymanager); + background = new Background(displaymanager); if(level->img_bkgd) { - bg->set_image(level->img_bkgd, level->bkgd_speed); + background->set_image(level->img_bkgd, level->bkgd_speed); } else { - bg->set_gradient(level->bkgd_top, level->bkgd_bottom); + background->set_gradient(level->bkgd_top, level->bkgd_bottom); } - gameobjects.push_back(bg); + gameobjects.push_back(background); // add tilemap gameobjects.push_back(new TileMap(displaymanager, get_level())); @@ -92,13 +92,13 @@ get_level()->load_gfx(); activate_particle_systems(); - Background* bg = new Background(displaymanager); + background = new Background(displaymanager); if(level->img_bkgd) { - bg->set_image(level->img_bkgd, level->bkgd_speed); + background->set_image(level->img_bkgd, level->bkgd_speed); } else { - bg->set_gradient(level->bkgd_top, level->bkgd_bottom); + background->set_gradient(level->bkgd_top, level->bkgd_bottom); } - gameobjects.push_back(bg); + gameobjects.push_back(background); // add tilemap gameobjects.push_back(new TileMap(displaymanager, get_level())); get_level()->load_song(); @@ -140,9 +140,6 @@ void World::set_defaults() { - // Set defaults: - scroll_x = 0; - player_status.score_multiplier = 1; counting_distros = false; @@ -213,7 +210,6 @@ World::draw() { /* Draw objects */ - displaymanager.get_viewport().set_translation(Vector(scroll_x, scroll_y)); displaymanager.draw(); } @@ -226,7 +222,8 @@ for(size_t i = 0; i < gameobjects.size(); ++i) gameobjects[i]->action(elapsed_time); - tux->check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); + tux->check_bounds(displaymanager.get_viewport(), + level->back_scrolling, (bool)level->hor_autoscroll_speed); scrolling(elapsed_time); /* Handle all possible collisions. */ @@ -284,6 +281,9 @@ /* This functions takes cares of the scrolling */ void World::scrolling(float elapsed_time) { + float scroll_x = displaymanager.get_viewport().get_translation().x; + float scroll_y = displaymanager.get_viewport().get_translation().y; + /* Y-axis scrolling */ float tux_pos_y = tux->base.y + (tux->base.height/2); @@ -308,6 +308,7 @@ if(level->hor_autoscroll_speed) { scroll_x += level->hor_autoscroll_speed * elapsed_time; + displaymanager.get_viewport().set_translation(Vector(scroll_x, scroll_y)); return; } @@ -379,6 +380,8 @@ scroll_x = level->width * 32 - screen->w; if(scroll_x < 0) scroll_x = 0; + + displaymanager.get_viewport().set_translation(Vector(scroll_x, scroll_y)); } void Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- title.cpp 20 May 2004 19:56:37 -0000 1.88 +++ title.cpp 21 May 2004 00:22:57 -0000 1.89 @@ -192,7 +192,6 @@ if(plevel->width * 32 - 320 < tux->base.x) { tux->level_begin(); - scroll_x = 0; } tux->can_jump = true; @@ -339,8 +338,6 @@ else if (process_load_game_menu()) { // FIXME: shouldn't be needed if GameSession doesn't relay on global variables - // reset tux - scroll_x = 0; //titletux.level_begin(); update_time = st_get_ticks(); } |
From: Matze B. <mat...@us...> - 2004-05-20 23:58:42
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10770/src Modified Files: world.cpp Log Message: fix jerky scrolling Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.106 retrieving revision 1.107 diff -u -d -r1.106 -r1.107 --- world.cpp 20 May 2004 23:34:53 -0000 1.106 +++ world.cpp 20 May 2004 23:58:31 -0000 1.107 @@ -218,16 +218,16 @@ } void -World::action(double frame_ratio) +World::action(float elapsed_time) { - tux->check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); - scrolling(frame_ratio); - /* update objects (don't use iterators here, because the list might change * during the iteration) */ for(size_t i = 0; i < gameobjects.size(); ++i) - gameobjects[i]->action(frame_ratio); + gameobjects[i]->action(elapsed_time); + + tux->check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); + scrolling(elapsed_time); /* Handle all possible collisions. */ collision_handler(); @@ -282,7 +282,7 @@ #define CHANGE_DIR_SCROLL_SPEED 2000 /* This functions takes cares of the scrolling */ -void World::scrolling(double frame_ratio) +void World::scrolling(float elapsed_time) { /* Y-axis scrolling */ @@ -307,7 +307,7 @@ /* Auto scrolling */ if(level->hor_autoscroll_speed) { - scroll_x += level->hor_autoscroll_speed * frame_ratio; + scroll_x += level->hor_autoscroll_speed * elapsed_time; return; } @@ -354,12 +354,13 @@ constant2 = 0.; } - float number = 2.5/(frame_ratio * CHANGE_DIR_SCROLL_SPEED/1000)*exp((CHANGE_DIR_SCROLL_SPEED-scrolling_timer.get_left())/1400.); + float number = 2.5/(elapsed_time * CHANGE_DIR_SCROLL_SPEED/1000)*exp((CHANGE_DIR_SCROLL_SPEED-scrolling_timer.get_left())/1400.); if(left) number *= -1.; scroll_x += number - + constant1 * tux->physic.get_velocity_x() * frame_ratio - + constant2 * tux->physic.get_acceleration_x() * frame_ratio * frame_ratio; + + constant1 * tux->physic.get_velocity_x() * elapsed_time + + constant2 * tux->physic.get_acceleration_x() * elapsed_time * + elapsed_time; if ((right && final_scroll_x - scroll_x < 0) || (left && final_scroll_x - scroll_x > 0)) scroll_x = final_scroll_x; |
From: Matze B. <mat...@us...> - 2004-05-20 23:47:00
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7896 Modified Files: player.cpp Log Message: improve tux holding objects Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.113 retrieving revision 1.114 diff -u -d -r1.113 -r1.114 --- player.cpp 20 May 2004 23:07:25 -0000 1.113 +++ player.cpp 20 May 2004 23:46:50 -0000 1.114 @@ -66,7 +66,8 @@ Player::Player(DisplayManager& display_manager) { - display_manager.add_drawable(this, LAYER_OBJECTS); + display_manager.add_drawable(this, LAYER_OBJECTS-1); // for tux himself + display_manager.add_drawable(this, LAYER_OBJECTS+1); // for the arm init(); } @@ -573,10 +574,44 @@ } void -Player::draw(ViewPort& viewport, int ) +Player::draw(ViewPort& viewport, int layer) { + PlayerSprite* sprite; + + if (size == SMALL) + sprite = &smalltux; + else if (got_power == FIRE_POWER) + sprite = &firetux; + else if (got_power == ICE_POWER) + sprite = &icetux; + else + sprite = &largetux; + Vector pos = viewport.world2screen(Vector(base.x, base.y)); + if(layer == LAYER_OBJECTS + 1) { + // Draw arm overlay graphics when Tux is holding something + if (holding_something && physic.get_velocity_y() == 0) + { + if (dir == RIGHT) + sprite->grab_right->draw(pos); + else + sprite->grab_left->draw(pos); + } + + // Draw blinking star overlay + if (invincible_timer.started() && + (invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 3)) + { + if (size == SMALL || duck) + smalltux_star->draw(pos); + else + largetux_star->draw(pos); + } + + return; + } + if (!safe_timer.started() || (global_frame_counter % 2) == 0) { if (dying == DYING_SQUISHED) @@ -585,17 +620,6 @@ } else { - PlayerSprite* sprite; - - if (size == SMALL) - sprite = &smalltux; - else if (got_power == FIRE_POWER) - sprite = &firetux; - else if (got_power == ICE_POWER) - sprite = &icetux; - else - sprite = &largetux; - if (duck && size != SMALL) { if (dir == RIGHT) @@ -641,25 +665,6 @@ sprite->walk_left->draw(pos); } } - - // Draw arm overlay graphics when Tux is holding something - if (holding_something && physic.get_velocity_y() == 0) - { - if (dir == RIGHT) - sprite->grab_right->draw(pos); - else - sprite->grab_left->draw(pos); - } - - // Draw blinking star overlay - if (invincible_timer.started() && - (invincible_timer.get_left() > TUX_INVINCIBLE_TIME_WARNING || global_frame_counter % 3)) - { - if (size == SMALL || duck) - smalltux_star->draw(pos); - else - largetux_star->draw(pos); - } } } |
From: Matze B. <mat...@us...> - 2004-05-20 23:35:03
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5239/src Modified Files: world.cpp Log Message: fixed bullet problems Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.105 retrieving revision 1.106 diff -u -d -r1.105 -r1.106 --- world.cpp 20 May 2004 23:25:30 -0000 1.105 +++ world.cpp 20 May 2004 23:34:53 -0000 1.106 @@ -395,7 +395,7 @@ { // We have detected a collision and now call the // collision functions of the collided objects. - (*j)->collision(&bullets[i], CO_BULLET, COLLISION_NORMAL); + (*j)->collision(bullets[i], CO_BULLET, COLLISION_NORMAL); bullets[i]->collision(CO_BADGUY); break; // bullet is invalid now, so break } |
From: Matze B. <mat...@us...> - 2004-05-20 23:25:39
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3337 Modified Files: world.cpp Log Message: don't remove trampolines twice Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.104 retrieving revision 1.105 diff -u -d -r1.104 -r1.105 --- world.cpp 20 May 2004 23:07:25 -0000 1.104 +++ world.cpp 20 May 2004 23:25:30 -0000 1.105 @@ -129,17 +129,10 @@ World::~World() { - for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) - delete *i; - for (std::vector<GameObject*>::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) { - Drawable* drawable = dynamic_cast<Drawable*> (*i); - if(drawable) - displaymanager.remove_drawable(drawable); delete *i; } - bad_guys.clear(); delete level; } |
From: Matze B. <mat...@us...> - 2004-05-20 23:20:09
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2292 Modified Files: Makefile.am background.cpp background.h display_manager.cpp display_manager.h drawable.h game_object.cpp game_object.h lispwriter.cpp lispwriter.h serializable.h tilemap.cpp tilemap.h viewport.cpp viewport.h Log Message: added standard header to files Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- Makefile.am 20 May 2004 19:56:36 -0000 1.25 +++ Makefile.am 20 May 2004 23:19:55 -0000 1.26 @@ -89,6 +89,7 @@ tilemap.h \ tilemap.cpp \ moving_object.h \ -moving_object.cpp +moving_object.cpp \ +serializable.h # EOF # Index: background.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/background.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- background.cpp 20 May 2004 14:56:16 -0000 1.1 +++ background.cpp 20 May 2004 23:19:55 -0000 1.2 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "background.h" #include "globals.h" Index: viewport.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/viewport.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- viewport.h 20 May 2004 13:33:26 -0000 1.2 +++ viewport.h 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __VIEWPORT_H__ #define __VIEWPORT_H__ Index: background.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/background.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- background.h 20 May 2004 23:07:23 -0000 1.2 +++ background.h 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __BACKGROUND_H__ #define __BACKGROUND_H__ Index: drawable.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/drawable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- drawable.h 20 May 2004 12:12:38 -0000 1.1 +++ drawable.h 20 May 2004 23:19:55 -0000 1.2 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br...> +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __DRAWABLE_H__ #define __DRAWABLE_H__ Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- tilemap.cpp 20 May 2004 19:56:37 -0000 1.3 +++ tilemap.cpp 20 May 2004 23:19:55 -0000 1.4 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <assert.h> #include "tilemap.h" Index: tilemap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- tilemap.h 20 May 2004 23:07:25 -0000 1.2 +++ tilemap.h 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __TILEMAP_H__ #define __TILEMAP_H__ Index: display_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/display_manager.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- display_manager.h 20 May 2004 14:55:41 -0000 1.2 +++ display_manager.h 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br...> +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __DISPLAY_MANAGER_H__ #define __DISPLAY_MANAGER_H__ Index: serializable.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/serializable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- serializable.h 20 May 2004 19:57:20 -0000 1.1 +++ serializable.h 20 May 2004 23:19:55 -0000 1.2 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __SERIALIZABLE_H__ #define __SERIALIZABLE_H__ Index: lispwriter.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispwriter.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lispwriter.h 20 May 2004 23:07:25 -0000 1.2 +++ lispwriter.h 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __LISPWRITER_H__ #define __LISPWRITER_H__ Index: viewport.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/viewport.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- viewport.cpp 20 May 2004 12:12:38 -0000 1.1 +++ viewport.cpp 20 May 2004 23:19:55 -0000 1.2 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "viewport.h" ViewPort::ViewPort() Index: lispwriter.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/lispwriter.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- lispwriter.cpp 20 May 2004 23:07:25 -0000 1.2 +++ lispwriter.cpp 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "lispwriter.h" #include <iostream> Index: game_object.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/game_object.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- game_object.h 20 May 2004 23:07:24 -0000 1.2 +++ game_object.h 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __GAMEOBJECT_HPP__ #define __GAMEOBJECT_HPP__ Index: display_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/display_manager.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- display_manager.cpp 20 May 2004 23:07:24 -0000 1.2 +++ display_manager.cpp 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "display_manager.h" #include <algorithm> Index: game_object.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/game_object.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- game_object.cpp 20 May 2004 23:07:24 -0000 1.2 +++ game_object.cpp 20 May 2004 23:19:55 -0000 1.3 @@ -1,3 +1,21 @@ +// $Id$ +// +// SuperTux - A Jump'n Run +// Copyright (C) 2004 Matthias Braun <ma...@br... +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "game_object.h" GameObject::GameObject() |
From: Matze B. <mat...@us...> - 2004-05-20 23:09:49
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32723/data Modified Files: Makefile.am Log Message: also install xpm icon Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/data/Makefile.am,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Makefile.am 13 May 2004 23:20:45 -0000 1.13 +++ Makefile.am 20 May 2004 23:09:40 -0000 1.14 @@ -11,6 +11,7 @@ CREDITS \ $(wildcard sounds/*.wav) \ $(wildcard images/*.png) \ + $(wildcard images/*.xpm) \ $(wildcard images/background/*.png) \ $(wildcard images/background/*.jpg) \ $(wildcard images/highscore/*.png) \ |
From: Matze B. <mat...@us...> - 2004-05-20 23:09:28
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32654/data/levels/test Modified Files: level6.stl Log Message: fix for trampoline syntax Index: level6.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/level6.stl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- level6.stl 16 May 2004 23:11:54 -0000 1.2 +++ level6.stl 20 May 2004 23:09:19 -0000 1.3 @@ -78,7 +78,7 @@ (objects (mriceblock (x 439) (y 159) (stay-on-platform #t)) (mriceblock (x 479) (y 159) (stay-on-platform #f)) - (trampoline (x 250) (y 150) (power 7.5) (type "trampoline")) + (trampoline (x 250) (y 150) (power 7.5)) ) ) |
From: Matze B. <mat...@us...> - 2004-05-20 19:57:28
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24847 Added Files: lispwriter.cpp lispwriter.h serializable.h Log Message: forgot to add some files --- NEW FILE: serializable.h --- #ifndef __SERIALIZABLE_H__ #define __SERIALIZABLE_H__ class LispWriter; class Serializable { public: virtual void write(LispWriter& writer) = 0; }; #endif --- NEW FILE: lispwriter.cpp --- #include "lispwriter.h" #include <iostream> LispWriter::LispWriter(std::ostream& newout) : out(newout), indent_depth(0) { } LispWriter::~LispWriter() { if(lists.size() > 0) { std::cerr << "Warning: Not all sections closed in lispwriter!\n"; } } void LispWriter::writeComment(const std::string& comment) { out << "; " << comment << "\n"; } void LispWriter::startList(const std::string& listname) { indent(); out << '(' << listname << '\n'; indent_depth += 2; lists.push_back(listname); } void LispWriter::endList(const std::string& listname) { if(lists.size() == 0) { std::cerr << "Trying to close list '" << listname << "', which is not open.\n"; return; } if(lists.back() != listname) { std::cerr << "Warning: trying to close list '" << listname << "' while list '" << lists.back() << "' is open.\n"; return; } lists.pop_back(); indent_depth -= 2; indent(); out << ")\n"; } void LispWriter::writeInt(const std::string& name, int value) { indent(); out << '(' << name << ' ' << value << ")\n"; } void LispWriter::writeFloat(const std::string& name, float value) { indent(); out << '(' << name << ' ' << value << ")\n"; } void LispWriter::writeString(const std::string& name, const std::string& value) { indent(); out << '(' << name << " \"" << value << "\")\n"; } void LispWriter::writeBool(const std::string& name, bool value) { indent(); out << '(' << name << ' ' << (value ? "#t" : "#f") << ")\n"; } void LispWriter::writeIntVector(const std::string& name, const std::vector<int>& value) { indent(); out << '(' << name; for(std::vector<int>::const_iterator i = value.begin(); i != value.end(); ++i) out << " " << *i; out << ")\n"; } void LispWriter::writeIntVector(const std::string& name, const std::vector<unsigned int>& value) { indent(); out << '(' << name; for(std::vector<unsigned int>::const_iterator i = value.begin(); i != value.end(); ++i) out << " " << *i; out << ")\n"; } void LispWriter::indent() { for(int i = 0; i<indent_depth; ++i) out << ' '; } --- NEW FILE: lispwriter.h --- #ifndef __LISPWRITER_H__ #define __LISPWRITER_H__ #include <iostream> #include <vector> class LispWriter { public: LispWriter(std::ostream& out); ~LispWriter(); void writeComment(const std::string& comment); void startList(const std::string& listname); void writeInt(const std::string& name, int value); void writeFloat(const std::string& name, float value); void writeString(const std::string& name, const std::string& value); void writeBool(const std::string& name, bool value); void writeIntVector(const std::string& name, const std::vector<int>& value); void writeIntVector(const std::string& name, const std::vector<unsigned int>& value); // add more write-functions when needed... void endList(const std::string& listname); private: void indent(); std::ostream& out; int indent_depth; std::vector<std::string> lists; }; #endif |
From: Matze B. <mat...@us...> - 2004-05-20 15:58:19
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7202 Added Files: moving_object.cpp moving_object.h Log Message: converted player to new object system --- NEW FILE: moving_object.cpp --- #include "moving_object.h" MovingObject::MovingObject() { } MovingObject::~MovingObject() { } --- NEW FILE: moving_object.h --- #ifndef __MOVING_OBJECT_H__ #define __MOVING_OBJECT_H__ #include "type.h" #include "game_object.h" #include "vector.h" //#include "rectangle.h" /** * Base class for all dynamic/moving game objects. This class contains things * for handling the bounding boxes and collision feedback. */ class MovingObject : public _GameObject { public: MovingObject(); virtual ~MovingObject(); /** this function is called when the object collided with any other object */ virtual void collision(const MovingObject& other_object, int collision_type) = 0; base_type base; base_type old_base; protected: #if 0 // this will be used in my collision detection rewrite later /// the current position of the object Vector pos; /// the position we want to move until next frame Vector new_pos; /// the bounding box relative to the current position Rectangle bounding_box; #endif }; #endif |
From: Matze B. <mat...@us...> - 2004-05-20 15:57:42
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6983 Modified Files: Makefile.am gameloop.cpp gameobjs.cpp gameobjs.h player.cpp player.h world.cpp world.h Log Message: converted player to new object system Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- world.h 20 May 2004 12:12:39 -0000 1.42 +++ world.h 20 May 2004 15:57:26 -0000 1.43 @@ -44,7 +44,7 @@ typedef std::list<Trampoline*> Trampolines; Trampolines trampolines; Level* level; - Player tux; + Player* tux; Timer scrolling_timer; @@ -72,7 +72,7 @@ ~World(); Level* get_level() { return level; } - Player* get_tux() { return &tux; } + Player* get_tux() { return tux; } void set_defaults(); Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- Makefile.am 20 May 2004 14:55:41 -0000 1.23 +++ Makefile.am 20 May 2004 15:57:26 -0000 1.24 @@ -81,9 +81,12 @@ game_object.h \ display_manager.h \ display_manager.cpp \ +drawable.h \ background.h \ background.cpp \ tilemap.h \ -tilemap.cpp +tilemap.cpp \ +moving_object.h \ +moving_object.cpp # EOF # Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- player.h 12 May 2004 17:56:34 -0000 1.55 +++ player.h 20 May 2004 15:57:26 -0000 1.56 @@ -27,6 +27,8 @@ #include "texture.h" #include "collision.h" #include "sound.h" +#include "moving_object.h" +#include "drawable.h" #include "physic.h" /* Times: */ @@ -105,7 +107,7 @@ extern PlayerSprite firetux; extern PlayerSprite icetux; -class Player : public GameObject +class Player : public MovingObject, public Drawable { public: enum HurtMode { KILL, SHRINK }; @@ -136,13 +138,22 @@ Physic physic; public: + Player(DisplayManager& display_manager); + virtual ~Player(); + void init(); int key_event(SDLKey key, int state); void level_begin(); - void action(double frame_ratio); void handle_input(); void grabdistros(); - void draw(); + + virtual void action(float elapsed_time); + virtual void draw(ViewPort& viewport, int layer); + virtual void collision(const MovingObject& other_object, + int collision_type); + virtual std::string type() const + { return "Player"; } + void collision(void* p_c_object, int c_object); void kill(HurtMode mode); void is_dying(); @@ -153,8 +164,6 @@ bool under_solid(); void grow(); - std::string type() { return "Player";}; - private: void handle_horizontal_input(); void handle_vertical_input(); Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.111 retrieving revision 1.112 diff -u -d -r1.111 -r1.112 --- player.cpp 19 May 2004 13:46:45 -0000 1.111 +++ player.cpp 20 May 2004 15:57:26 -0000 1.112 @@ -64,6 +64,16 @@ pplayer_input->old_up = UP; } +Player::Player(DisplayManager& display_manager) +{ + display_manager.add_drawable(this, LAYER_OBJECTS); + init(); +} + +Player::~Player() +{ +} + void Player::init() { @@ -162,7 +172,7 @@ } void -Player::action(double frame_ratio) +Player::action(float elapsed_time) { bool jumped_in_solid = false; @@ -176,7 +186,7 @@ if(dying == DYING_NOT) handle_input(); - physic.apply(frame_ratio, base.x, base.y); + physic.apply(elapsed_time, base.x, base.y); if(dying == DYING_NOT) { @@ -203,7 +213,7 @@ if(!duck && on_ground() && old_base.x == base.x && old_base.y == base.y && collision_object_map(base)) { - base.x += frame_ratio * WALK_SPEED * (dir ? 1: -1); + base.x += elapsed_time * WALK_SPEED * (dir ? 1: -1); previous_base = old_base = base; } @@ -566,8 +576,11 @@ } void -Player::draw() +Player::draw(ViewPort& viewport, int ) { + float scroll_x = viewport.get_translation().x; + float scroll_y = viewport.get_translation().y; + if (!safe_timer.started() || (global_frame_counter % 2) == 0) { if (dying == DYING_SQUISHED) @@ -660,6 +673,14 @@ } void +Player::collision(const MovingObject& other, int collision_type) +{ + (void) other; + (void) collision_type; + // will be implemented later +} + +void Player::collision(void* p_c_object, int c_object) { BadGuy* pbad_c = NULL; Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.101 retrieving revision 1.102 diff -u -d -r1.101 -r1.102 --- world.cpp 20 May 2004 14:55:41 -0000 1.101 +++ world.cpp 20 May 2004 15:57:26 -0000 1.102 @@ -49,7 +49,9 @@ current_ = this; level = new Level(filename); - tux.init(); + + tux = new Player(displaymanager); + gameobjects.push_back(tux); set_defaults(); @@ -82,7 +84,7 @@ current_ = this; level = new Level(subset, level_nr); - tux.init(); + tux->init(); set_defaults(); @@ -109,6 +111,7 @@ void World::apply_bonuses() { +#if 0 // Apply bonuses from former levels switch (player_status.bonus) { @@ -116,16 +119,17 @@ break; case PlayerStatus::FLOWER_BONUS: - tux.got_power = tux.FIRE_POWER; // FIXME: add ice power to here + tux->got_power = tux.FIRE_POWER; // FIXME: add ice power to here // fall through case PlayerStatus::GROWUP_BONUS: // FIXME: Move this to Player class - tux.size = BIG; - tux.base.height = 64; - tux.base.y -= 32; + tux->size = BIG; + tux->base.height = 64; + tux->base.y -= 32; break; } +#endif } World::~World() @@ -214,8 +218,6 @@ for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) (*i)->draw(); - tux.draw(); - for (unsigned int i = 0; i < bullets.size(); ++i) bullets[i].draw(); @@ -226,8 +228,7 @@ void World::action(double frame_ratio) { - tux.action(frame_ratio); - tux.check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); + tux->check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); scrolling(frame_ratio); for (unsigned int i = 0; i < bullets.size(); ++i) @@ -242,10 +243,11 @@ for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) (*i)->action(frame_ratio); - /* update objects */ - for(std::vector<_GameObject*>::iterator i = gameobjects.begin(); - i != gameobjects.end(); ++i) - (*i)->action(frame_ratio); + /* update objects (don't use iterators here, because the list might change + * during the iteration) + */ + for(size_t i = 0; i < gameobjects.size(); ++i) + gameobjects[i]->action(frame_ratio); /* Handle all possible collisions. */ collision_handler(); @@ -291,9 +293,9 @@ { /* Y-axis scrolling */ - float tux_pos_y = tux.base.y + (tux.base.height/2); + float tux_pos_y = tux->base.y + (tux->base.height/2); - if(level->height > VISIBLE_TILES_Y-1 && !tux.dying) + if(level->height > VISIBLE_TILES_Y-1 && !tux->dying) { if (scroll_y < tux_pos_y - (screen->h - Y_SPACE)) scroll_y = tux_pos_y - (screen->h - Y_SPACE); @@ -318,20 +320,20 @@ /* Horizontal backscrolling */ - float tux_pos_x = tux.base.x + (tux.base.width/2); + float tux_pos_x = tux->base.x + (tux->base.width/2); - if(tux.old_dir != tux.dir && level->back_scrolling) + if(tux->old_dir != tux->dir && level->back_scrolling) scrolling_timer.start(CHANGE_DIR_SCROLL_SPEED); bool right = false; bool left = false; - if (tux.physic.get_velocity_x() > 0) + if (tux->physic.get_velocity_x() > 0) right = true; - else if (tux.physic.get_velocity_x() < 0) + else if (tux->physic.get_velocity_x() < 0) left = true; else { - if (tux.dir == RIGHT) + if (tux->dir == RIGHT) right = true; else left = true; @@ -347,7 +349,8 @@ else final_scroll_x = tux_pos_x - X_SPACE; - if((tux.physic.get_velocity_x() > 0 && tux.dir == RIGHT) || (tux.physic.get_velocity_x() < 0 && tux.dir == LEFT)) + if((tux->physic.get_velocity_x() > 0 && tux->dir == RIGHT) + || (tux->physic.get_velocity_x() < 0 && tux->dir == LEFT)) { constant1 = 1.0; constant2 = .4; @@ -362,8 +365,8 @@ if(left) number *= -1.; scroll_x += number - + constant1 * tux.physic.get_velocity_x() * frame_ratio - + constant2 * tux.physic.get_acceleration_x() * frame_ratio * frame_ratio; + + constant1 * tux->physic.get_velocity_x() * frame_ratio + + constant2 * tux->physic.get_acceleration_x() * frame_ratio * frame_ratio; if ((right && final_scroll_x - scroll_x < 0) || (left && final_scroll_x - scroll_x > 0)) scroll_x = final_scroll_x; @@ -431,7 +434,7 @@ } } - if(tux.dying != DYING_NOT) return; + if(tux->dying != DYING_NOT) return; // CO_BADGUY & CO_PLAYER check for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) @@ -439,21 +442,21 @@ if((*i)->dying != DYING_NOT) continue; - if(rectcollision_offset((*i)->base, tux.base, 0, 0)) + if(rectcollision_offset((*i)->base, tux->base, 0, 0)) { // We have detected a collision and now call the collision // functions of the collided objects. - if (tux.previous_base.y < tux.base.y && - tux.previous_base.y + tux.previous_base.height + if (tux->previous_base.y < tux->base.y && + tux->previous_base.y + tux->previous_base.height < (*i)->base.y + (*i)->base.height/2 - && !tux.invincible_timer.started()) + && !tux->invincible_timer.started()) { - (*i)->collision(&tux, CO_PLAYER, COLLISION_SQUISH); + (*i)->collision(tux, CO_PLAYER, COLLISION_SQUISH); } else { - tux.collision(*i, CO_BADGUY); - (*i)->collision(&tux, CO_PLAYER, COLLISION_NORMAL); + tux->collision(*i, CO_BADGUY); + (*i)->collision(tux, CO_PLAYER, COLLISION_NORMAL); } } } @@ -461,29 +464,29 @@ // CO_UPGRADE & CO_PLAYER check for(unsigned int i = 0; i < upgrades.size(); ++i) { - if(rectcollision(upgrades[i].base, tux.base)) + if(rectcollision(upgrades[i].base, tux->base)) { // We have detected a collision and now call the collision // functions of the collided objects. - upgrades[i].collision(&tux, CO_PLAYER, COLLISION_NORMAL); + upgrades[i].collision(tux, CO_PLAYER, COLLISION_NORMAL); } } // CO_TRAMPOLINE & (CO_PLAYER or CO_BADGUY) for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) { - if (rectcollision((*i)->base, tux.base)) + if (rectcollision((*i)->base, tux->base)) { - if (tux.previous_base.y < tux.base.y && - tux.previous_base.y + tux.previous_base.height + if (tux->previous_base.y < tux->base.y && + tux->previous_base.y + tux->previous_base.height < (*i)->base.y + (*i)->base.height/2) { - (*i)->collision(&tux, CO_PLAYER, COLLISION_SQUISH); + (*i)->collision(tux, CO_PLAYER, COLLISION_SQUISH); } - else if (tux.previous_base.y <= tux.base.y) + else if (tux->previous_base.y <= tux->base.y) { - tux.collision(*i, CO_TRAMPOLINE); - (*i)->collision(&tux, CO_PLAYER, COLLISION_NORMAL); + tux->collision(*i, CO_TRAMPOLINE); + (*i)->collision(tux, CO_PLAYER, COLLISION_NORMAL); } } } @@ -557,21 +560,21 @@ void World::add_bullet(float x, float y, float xm, Direction dir) { - if(tux.got_power == tux.FIRE_POWER) + if(tux->got_power == Player::FIRE_POWER) { if(bullets.size() > MAX_FIRE_BULLETS-1) return; } - else if(tux.got_power == tux.ICE_POWER) + else if(tux->got_power == Player::ICE_POWER) { if(bullets.size() > MAX_ICE_BULLETS-1) return; } Bullet new_bullet; - if(tux.got_power == tux.FIRE_POWER) + if(tux->got_power == Player::FIRE_POWER) new_bullet.init(x,y,xm,dir, FIRE_BULLET); - else if(tux.got_power == tux.ICE_POWER) + else if(tux->got_power == Player::ICE_POWER) new_bullet.init(x,y,xm,dir, ICE_BULLET); bullets.push_back(new_bullet); @@ -688,7 +691,7 @@ break; case 2: // Add a fire flower upgrade! - if (tux.size == SMALL) /* Tux is small, add mints! */ + if (tux->size == SMALL) /* Tux is small, add mints! */ add_upgrade(posx, posy, col_side, UPGRADE_GROWUP); else /* Tux is big, add a fireflower: */ add_upgrade(posx, posy, col_side, UPGRADE_FIREFLOWER); @@ -696,7 +699,7 @@ break; case 5: // Add an ice flower upgrade! - if (tux.size == SMALL) /* Tux is small, add mints! */ + if (tux->size == SMALL) /* Tux is small, add mints! */ add_upgrade(posx, posy, col_side, UPGRADE_GROWUP); else /* Tux is big, add an iceflower: */ add_upgrade(posx, posy, col_side, UPGRADE_ICEFLOWER); @@ -749,7 +752,7 @@ if ((*i)->base.x >= x - 32 && (*i)->base.x <= x + 32 && (*i)->base.y >= y - 16 && (*i)->base.y <= y + 16) { - (*i)->collision(&tux, CO_PLAYER, COLLISION_BUMP); + (*i)->collision(tux, CO_PLAYER, COLLISION_BUMP); } } @@ -760,7 +763,7 @@ upgrades[i].base.x >= x - 32 && upgrades[i].base.x <= x + 32 && upgrades[i].base.y >= y - 16 && upgrades[i].base.y <= y + 16) { - upgrades[i].collision(&tux, CO_PLAYER, COLLISION_BUMP); + upgrades[i].collision(tux, CO_PLAYER, COLLISION_BUMP); } } } Index: gameobjs.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- gameobjs.h 20 May 2004 12:12:38 -0000 1.19 +++ gameobjs.h 20 May 2004 15:57:26 -0000 1.20 @@ -161,54 +161,6 @@ void load_object_gfx(); - -class ObjectManager -{ - private: - ObjectManager(); - ~ObjectManager(); - - static ObjectManager* instance_; - - // XXX Objects will have to be split up into two categories: - // - Drawn before tux - // - Drawn after tux - // Eventually Player should be a part of ObjectManager - - std::vector<BadGuy*> badguys; - std::vector<Trampoline> trampolines; - std::vector<BouncyDistro> bouncy_distros; - std::vector<BrokenBrick> broken_bricks; - std::vector<BouncyBrick> bouncy_bricks; - //std::vector<Upgrade> upgrades; - //std::vector<Bullet> bullets; - - void load_badguys(std::string filename); - - public: - static ObjectManager* instance() { return instance_ ? instance_ : instance_ = new ObjectManager(); } - static void destroy_instance() { delete instance_; instance_ = 0; } - - void draw_bg(); - void draw_fg(); - void actions(); - -/* Object* get(unsigned int id) { - if(id < badguys.size()) - { - return badguys[id]; - } - else - { - // Never return 0, but return the 0th tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - return badguys[0]; - } - } -*/ -}; - #endif /* Local Variables: */ Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- gameobjs.cpp 20 May 2004 14:55:41 -0000 1.30 +++ gameobjs.cpp 20 May 2004 15:57:26 -0000 1.31 @@ -273,203 +273,3 @@ } -/* Object Manager */ -//--------------------------------------------------------------------------- - -ObjectManager::ObjectManager() -{ - std::string filename = datadir + "/images/tilesets/supertux.stbg"; - load_badguys(filename); -} - -ObjectManager::~ObjectManager() -{ - for(std::vector<BadGuy*>::iterator i = badguys.begin(); i != badguys.end(); ++i) { - delete *i; - } -} - -void ObjectManager::load_badguys(std::string filename) -{ - (void) filename; -/* - lisp_object_t* root_obj = lisp_read_from_file(filename); - - if (!root_obj) - st_abort("Couldn't load file", filename); - - if (strcmp(lisp_symbol(lisp_car(root_obj)), "supertux-badguys") == 0) - { - lisp_object_t* cur = lisp_cdr(root_obj); - - while(!lisp_nil_p(cur)) - { - lisp_object_t* element = lisp_car(cur); - - if (strcmp(lisp_symbol(lisp_car(element)), "badguy") == 0) - { - - - Tile* tile = new Tile; - tile->id = -1; - tile->solid = false; - tile->brick = false; - tile->ice = false; - tile->water = false; - tile->fullbox = false; - tile->distro = false; - tile->goal = false; - tile->data = 0; - tile->next_tile = 0; - tile->anim_speed = 25; - - LispReader reader(lisp_cdr(element)); - assert(reader.read_int("id", &tile->id)); - reader.read_bool("solid", &tile->solid); - reader.read_bool("brick", &tile->brick); - reader.read_bool("ice", &tile->ice); - reader.read_bool("water", &tile->water); - reader.read_bool("fullbox", &tile->fullbox); - reader.read_bool("distro", &tile->distro); - reader.read_bool("goal", &tile->goal); - reader.read_int("data", &tile->data); - reader.read_int("anim-speed", &tile->anim_speed); - reader.read_int("next-tile", &tile->next_tile); - reader.read_string_vector("images", &tile->filenames); - reader.read_string_vector("editor-images", &tile->editor_filenames); - - for(std::vector<std::string>::iterator it = tile-> - filenames.begin(); - it != tile->filenames.end(); - ++it) - { - Surface* cur_image; - tile->images.push_back(cur_image); - tile->images[tile->images.size()-1] = new Surface( - datadir + "/images/tilesets/" + (*it), - USE_ALPHA); - } - for(std::vector<std::string>::iterator it = tile->editor_filenames.begin(); - it != tile->editor_filenames.end(); - ++it) - { - Surface* cur_image; - tile->editor_images.push_back(cur_image); - tile->editor_images[tile->editor_images.size()-1] = new Surface( - datadir + "/images/tilesets/" + (*it), - USE_ALPHA); - } - - if (tile->id + tileset_id >= int(tiles.size()) - ) - tiles.resize(tile->id + tileset_id+1); - - tiles[tile->id + tileset_id] = tile; - } - else if (strcmp(lisp_symbol(lisp_car(element)), "tileset") == 0) - { - LispReader reader(lisp_cdr(element)); - std::string filename; - reader.read_string("file", &filename); - filename = datadir + "/images/tilesets/" + filename; - load_tileset(filename); - } - else if (strcmp(lisp_symbol(lisp_car(element)), "tilegroup") == 0) - { - TileGroup new_; - LispReader reader(lisp_cdr(element)); - reader.read_string("name", &new_.name); - reader.read_int_vector("tiles", &new_.tiles); - if(!tilegroups_) - tilegroups_ = new std::set<TileGroup>; - tilegroups_->insert(new_).first; - } - else if (strcmp(lisp_symbol(lisp_car(element)), "properties") == 0) - { - LispReader reader(lisp_cdr(element)); - reader.read_int("id", &tileset_id); - tileset_id *= 1000; - } - else - { - puts("Unhandled symbol"); - } - - cur = lisp_cdr(cur); - } - } - else - { - assert(0); - } - - lisp_free(root_obj); -*/ -} - -void ObjectManager::draw_bg() -{ -/* - for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) - bouncy_bricks[i]->draw(); - - for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) - (*i)->draw(); - - for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) - (*i)->draw(); -*/ -} - -void ObjectManager::draw_fg() -{ -/* - for (unsigned int i = 0; i < bullets.size(); ++i) - bullets[i].draw(); - - for (unsigned int i = 0; i < floating_scores.size(); ++i) - floating_scores[i]->draw(); - - for (unsigned int i = 0; i < upgrades.size(); ++i) - upgrades[i].draw(); - - for (unsigned int i = 0; i < bouncy_distros.size(); ++i) - bouncy_distros[i]->draw(); - - for (unsigned int i = 0; i < broken_bricks.size(); ++i) - broken_bricks[i]->draw(); -*/ -} - -void ObjectManager::actions() -{ -/* - for (unsigned int i = 0; i < bouncy_distros.size(); i++) - bouncy_distros[i]->action(frame_ratio); - - for (unsigned int i = 0; i < broken_bricks.size(); i++) - broken_bricks[i]->action(frame_ratio); - - // Handle all kinds of game objects - for (unsigned int i = 0; i < bouncy_bricks.size(); i++) - bouncy_bricks[i]->action(frame_ratio); - - for (unsigned int i = 0; i < floating_scores.size(); i++) - floating_scores[i]->action(frame_ratio); - - for (unsigned int i = 0; i < bullets.size(); ++i) - bullets[i].action(frame_ratio); - - for (unsigned int i = 0; i < upgrades.size(); i++) - upgrades[i].action(frame_ratio); - - for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) - (*i)->action(frame_ratio); - - for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) - (*i)->action(frame_ratio); -*/ -} - -/* EOF */ - Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.134 retrieving revision 1.135 diff -u -d -r1.134 -r1.135 --- gameloop.cpp 20 May 2004 12:12:38 -0000 1.134 +++ gameloop.cpp 20 May 2004 15:57:26 -0000 1.135 @@ -65,6 +65,7 @@ global_frame_counter = 0; game_pause = false; + fps_fps = 0; fps_timer.init(true); frame_timer.init(true); @@ -669,7 +670,7 @@ { char str[60]; - sprintf(str, "%d", player_status.score); + snprintf(str, 60, "%d", player_status.score); white_text->draw("SCORE", 0, 0, 1); gold_text->draw(str, 96, 0, 1); |
From: Ricardo C. <rm...@us...> - 2004-05-20 15:10:12
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29716/src Modified Files: tilemap.cpp Log Message: Just added a missing header. Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- tilemap.cpp 20 May 2004 14:55:41 -0000 1.1 +++ tilemap.cpp 20 May 2004 15:09:58 -0000 1.2 @@ -1,3 +1,5 @@ +#include <assert.h> + #include "tilemap.h" #include "display_manager.h" #include "level.h" |
From: Matze B. <mat...@us...> - 2004-05-20 14:56:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27235 Added Files: background.cpp background.h Log Message: forgot to add some files --- NEW FILE: background.h --- #ifndef __BACKGROUND_H__ #define __BACKGROUND_H__ #include "texture.h" #include "game_object.h" #include "drawable.h" enum { BACKGROUND_GRADIENT, BACKGROUND_IMAGE }; class DisplayManager; class Background : public _GameObject, public Drawable { public: Background(DisplayManager& displaymanager); virtual ~Background(); void set_image(Surface* image, float bkgd_speed); void set_gradient(Color top, Color bottom); virtual std::string type() const { return "Background"; } virtual void action(float elapsed_time); virtual void draw(ViewPort& viewport, int layer); private: int bgtype; float speed; Surface* image; Color gradient_top, gradient_bottom; }; #endif --- NEW FILE: background.cpp --- #include "background.h" #include "globals.h" #include "viewport.h" #include "display_manager.h" Background::Background(DisplayManager& displaymanager) { displaymanager.add_drawable(this, LAYER_BACKGROUND0); } Background::~Background() { } void Background::action(float) { } void Background::set_image(Surface* image, float speed) { bgtype = BACKGROUND_IMAGE; this->image = image; this->speed = speed; } void Background::set_gradient(Color top, Color bottom) { bgtype = BACKGROUND_GRADIENT; gradient_top = top; gradient_bottom = bottom; } void Background::draw(ViewPort& viewport, int ) { if(bgtype == BACKGROUND_GRADIENT) { drawgradient(gradient_top, gradient_bottom); } else if(bgtype == BACKGROUND_IMAGE) { int sx = int(-viewport.get_translation().x * float(speed/100.)) % image->w - image->w; int sy = int(-viewport.get_translation().y * float(speed/100.)) % image->h - image->h; for(int x = sx; x < screen->w; x += image->w) for(int y = sy; y < screen->h; y += image->h) image->draw(x, y); } } |
From: Matze B. <mat...@us...> - 2004-05-20 14:55:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27079 Modified Files: Makefile.am display_manager.h gameobjs.cpp world.cpp Added Files: tilemap.cpp tilemap.h Log Message: fixed score display and converted tilemap to a gameobject Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- Makefile.am 20 May 2004 12:12:37 -0000 1.22 +++ Makefile.am 20 May 2004 14:55:41 -0000 1.23 @@ -82,6 +82,8 @@ display_manager.h \ display_manager.cpp \ background.h \ -background.cpp +background.cpp \ +tilemap.h \ +tilemap.cpp # EOF # Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- gameobjs.cpp 20 May 2004 12:12:38 -0000 1.29 +++ gameobjs.cpp 20 May 2004 14:55:41 -0000 1.30 @@ -119,10 +119,10 @@ const Vector& pos, int score) : position(pos) { - displaymanager.add_drawable(this, LAYER_OBJECTS+1); + displaymanager.add_drawable(this, LAYER_OBJECTS); timer.start(1000); snprintf(str, 10, "%d", score); - position.x += - strlen(str) * 8; + position.x -= strlen(str) * 8; } void Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.100 retrieving revision 1.101 diff -u -d -r1.100 -r1.101 --- world.cpp 20 May 2004 12:12:38 -0000 1.100 +++ world.cpp 20 May 2004 14:55:41 -0000 1.101 @@ -36,6 +36,7 @@ #include "viewport.h" #include "display_manager.h" #include "background.h" +#include "tilemap.h" Surface* img_distro[4]; @@ -63,6 +64,9 @@ bg->set_gradient(level->bkgd_top, level->bkgd_bottom); } gameobjects.push_back(bg); + + // add tilemap + gameobjects.push_back(new TileMap(displaymanager, get_level())); activate_objects(); get_level()->load_song(); @@ -93,6 +97,8 @@ bg->set_gradient(level->bkgd_top, level->bkgd_bottom); } gameobjects.push_back(bg); + // add tilemap + gameobjects.push_back(new TileMap(displaymanager, get_level())); get_level()->load_song(); apply_bonuses(); @@ -198,39 +204,10 @@ void World::draw() { - int y,x; - - /* Draw the real background */ -#if 0 - drawgradient(level->bkgd_top, level->bkgd_bottom); - if(level->img_bkgd) - level->draw_bg(); -#endif - - /* Draw particle systems (background) */ + /* Draw objects */ displaymanager.get_viewport().set_translation(Vector(scroll_x, scroll_y)); displaymanager.draw(); - /* Draw background: */ - for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) - { - for (x = 0; x < VISIBLE_TILES_X; ++x) - { - Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32), - level->bg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); - } - } - - /* Draw interactive tiles: */ - for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) - { - for (x = 0; x < VISIBLE_TILES_X; ++x) - { - Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32), - level->ia_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); - } - } - for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) (*i)->draw(); @@ -244,16 +221,6 @@ for (unsigned int i = 0; i < upgrades.size(); ++i) upgrades[i].draw(); - - /* Draw foreground: */ - for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) - { - for (x = 0; x < VISIBLE_TILES_X; ++x) - { - Tile::draw(32*x - fmodf(scroll_x, 32), y * 32 - fmodf(scroll_y, 32), - level->fg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); - } - } } void @@ -275,7 +242,7 @@ for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) (*i)->action(frame_ratio); - /* update particle systems */ + /* update objects */ for(std::vector<_GameObject*>::iterator i = gameobjects.begin(); i != gameobjects.end(); ++i) (*i)->action(frame_ratio); --- NEW FILE: tilemap.cpp --- #include "tilemap.h" #include "display_manager.h" #include "level.h" #include "tile.h" #include "globals.h" TileMap::TileMap(DisplayManager& display_manager, Level* newlevel) : level(newlevel) { display_manager.add_drawable(this, LAYER_BACKGROUNDTILES); display_manager.add_drawable(this, LAYER_TILES); display_manager.add_drawable(this, LAYER_FOREGROUNDTILES); } TileMap::~TileMap() { } void TileMap::action(float ) { } void TileMap::draw(ViewPort& viewport, int layer) { std::vector<std::vector<unsigned int> >* tiles; switch(layer) { case LAYER_BACKGROUNDTILES: tiles = &level->bg_tiles; break; case LAYER_TILES: tiles = &level->ia_tiles; break; case LAYER_FOREGROUNDTILES: tiles = &level->fg_tiles; break; default: assert(!"Wrong layer when drawing tilemap."); } int tsx = int(viewport.get_translation().x / 32); // tilestartindex x int tsy = int(viewport.get_translation().y / 32); // tilestartindex y int sx = - (int(viewport.get_translation().x) % 32); int sy = - (int(viewport.get_translation().y) % 32); for(int x = sx, tx = tsx; x < screen->w && tx < int((*tiles)[0].size()); x += 32, ++tx) { for(int y = sy, ty = tsy; y < screen->h && ty < int(tiles->size()); y += 32, ++ty) { Tile::draw(x, y, (*tiles) [ty][tx]); } } } --- NEW FILE: tilemap.h --- #ifndef __TILEMAP_H__ #define __TILEMAP_H__ #include "game_object.h" #include "drawable.h" class Level; /** * This class is reponsible for drawing the level tiles */ class TileMap : public _GameObject, public Drawable { public: TileMap(DisplayManager& manager, Level* level); virtual ~TileMap(); virtual void action(float elapsed_time); virtual void draw(ViewPort& viewport, int layer); virtual std::string type() const { return "TileMap"; } private: Level* level; }; #endif Index: display_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/display_manager.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- display_manager.h 20 May 2004 12:12:38 -0000 1.1 +++ display_manager.h 20 May 2004 14:55:41 -0000 1.2 @@ -13,8 +13,9 @@ LAYER_BACKGROUNDTILES = -100, LAYER_TILES = 0, LAYER_OBJECTS = 100, - LAYER_FOREGROUND0 = 200, - LAYER_FOREGROUND1 = 300 + LAYER_FOREGROUNDTILES = 200, + LAYER_FOREGROUND0 = 300, + LAYER_FOREGROUND1 = 400 }; /** This class holds a list of all things that should be drawn to screen |
From: Matze B. <mat...@us...> - 2004-05-20 13:33:34
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11431 Modified Files: viewport.h Log Message: oops Index: viewport.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/viewport.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- viewport.h 20 May 2004 12:12:38 -0000 1.1 +++ viewport.h 20 May 2004 13:33:26 -0000 1.2 @@ -2,7 +2,6 @@ #define __VIEWPORT_H__ #include "vector.h" -#include "rectangle.h" class ViewPort { |
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263 Modified Files: Makefile.am badguy.cpp gameloop.cpp gameobjs.cpp gameobjs.h particlesystem.cpp particlesystem.h text.h texture.h tile.h world.cpp world.h Added Files: display_manager.cpp display_manager.h drawable.h game_object.cpp game_object.h vector.h viewport.cpp viewport.h Log Message: -Added new object system and converted some GameObjects to it. Please take a look if you like this new interface and complain as soon as possible :) -Currently you experience some stuff is drawn at the wrong layer, that is because not everything is using the new displaymanager yet. Index: tile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- tile.h 17 May 2004 06:26:41 -0000 1.20 +++ tile.h 20 May 2004 12:12:38 -0000 1.21 @@ -28,6 +28,7 @@ #include "globals.h" #include "lispreader.h" #include "setup.h" +#include "vector.h" /** Tile Class @@ -86,6 +87,11 @@ /** Draw a tile on the screen: */ static void draw(float x, float y, unsigned int c, Uint8 alpha = 255); static void draw_stretched(float x, float y, int w, int h, unsigned int c, Uint8 alpha = 255); + + static void draw(const Vector& pos, unsigned int c, Uint8 alpha = 255) + { + draw(pos.x, pos.y, c, alpha); + } }; struct TileGroup Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- world.h 18 May 2004 16:43:37 -0000 1.41 +++ world.h 20 May 2004 12:12:39 -0000 1.42 @@ -30,6 +30,7 @@ #include "badguy.h" #include "particlesystem.h" #include "gameobjs.h" +#include "display_manager.h" class Level; @@ -54,15 +55,12 @@ static World* current_; public: BadGuys bad_guys; - std::vector<BouncyDistro*> bouncy_distros; - std::vector<BrokenBrick*> broken_bricks; - std::vector<BouncyBrick*> bouncy_bricks; - std::vector<FloatingScore*> floating_scores; std::vector<Upgrade> upgrades; std::vector<Bullet> bullets; - typedef std::vector<ParticleSystem*> ParticleSystems; - ParticleSystems particle_systems; + std::vector<_GameObject*> gameobjects; + + DisplayManager displaymanager; public: static World* current() { return current_; } @@ -95,11 +93,12 @@ void activate_bad_guys(); void activate_objects(); - void add_score(float x, float y, int s); - void add_bouncy_distro(float x, float y); - void add_broken_brick(Tile* tile, float x, float y); - void add_broken_brick_piece(Tile* tile, float x, float y, float xm, float ym); - void add_bouncy_brick(float x, float y); + void add_score(const Vector& pos, int s); + void add_bouncy_distro(const Vector& pos); + void add_broken_brick(const Vector& pos, Tile* tile); + void add_broken_brick_piece(const Vector& pos, + const Vector& movement, Tile* tile); + void add_bouncy_brick(const Vector& pos); BadGuy* add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform = false); template <class T, class U> T* add_object(U data); Index: Makefile.am =================================================================== RCS file: /cvsroot/super-tux/supertux/src/Makefile.am,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- Makefile.am 25 Apr 2004 18:38:03 -0000 1.21 +++ Makefile.am 20 May 2004 12:12:37 -0000 1.22 @@ -74,6 +74,14 @@ music_manager.cpp \ music_manager.h \ musicref.cpp \ -musicref.h +musicref.h \ +viewport.cpp \ +viewport.h \ +game_object.cpp \ +game_object.h \ +display_manager.h \ +display_manager.cpp \ +background.h \ +background.cpp # EOF # Index: particlesystem.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/particlesystem.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- particlesystem.cpp 20 Apr 2004 11:09:34 -0000 1.6 +++ particlesystem.cpp 20 May 2004 12:12:38 -0000 1.7 @@ -25,11 +25,15 @@ #include "world.h" #include "level.h" #include "scene.h" +#include "viewport.h" +#include "display_manager.h" -ParticleSystem::ParticleSystem() +ParticleSystem::ParticleSystem(DisplayManager& displaymanager) { virtual_width = screen->w; virtual_height = screen->h; + + displaymanager.add_drawable(this, LAYER_BACKGROUND1); } ParticleSystem::~ParticleSystem() @@ -40,13 +44,16 @@ } } -void ParticleSystem::draw(float scrollx, float scrolly, int layer) +void ParticleSystem::draw(ViewPort& viewport, int layer) { std::vector<Particle*>::iterator i; for(i = particles.begin(); i != particles.end(); ++i) { Particle* particle = *i; if(particle->layer != layer) continue; + + float scrollx = viewport.get_translation().x; + float scrolly = viewport.get_translation().y; // remap x,y coordinates onto screencoordinates float x = fmodf(particle->x - scrollx, virtual_width); @@ -68,7 +75,8 @@ } } -SnowParticleSystem::SnowParticleSystem() +SnowParticleSystem::SnowParticleSystem(DisplayManager& displaymanager) + : ParticleSystem(displaymanager) { snowimages[0] = new Surface(datadir+"/images/shared/snow0.png", USE_ALPHA); snowimages[1] = new Surface(datadir+"/images/shared/snow1.png", USE_ALPHA); @@ -82,7 +90,7 @@ SnowParticle* particle = new SnowParticle; particle->x = rand() % int(virtual_width); particle->y = rand() % screen->h; - particle->layer = i % 2; + particle->layer = LAYER_BACKGROUND1; int snowsize = rand() % 3; particle->texture = snowimages[snowsize]; do { @@ -100,7 +108,7 @@ delete snowimages[i]; } -void SnowParticleSystem::simulate(float elapsed_time) +void SnowParticleSystem::action(float elapsed_time) { std::vector<Particle*>::iterator i; for(i = particles.begin(); i != particles.end(); ++i) { @@ -113,7 +121,8 @@ } } -CloudParticleSystem::CloudParticleSystem() +CloudParticleSystem::CloudParticleSystem(DisplayManager& displaymanager) + : ParticleSystem(displaymanager) { cloudimage = new Surface(datadir + "/images/shared/cloud.png", USE_ALPHA); @@ -124,7 +133,7 @@ CloudParticle* particle = new CloudParticle; particle->x = rand() % int(virtual_width); particle->y = rand() % int(virtual_height); - particle->layer = 0; + particle->layer = LAYER_BACKGROUND1; particle->texture = cloudimage; particle->speed = -float(250 + rand() % 200) / 1000.0; @@ -137,7 +146,7 @@ delete cloudimage; } -void CloudParticleSystem::simulate(float elapsed_time) +void CloudParticleSystem::action(float elapsed_time) { std::vector<Particle*>::iterator i; for(i = particles.begin(); i != particles.end(); ++i) { --- NEW FILE: viewport.h --- #ifndef __VIEWPORT_H__ #define __VIEWPORT_H__ #include "vector.h" #include "rectangle.h" class ViewPort { public: ViewPort(); ~ViewPort(); Vector world2screen(const Vector& worldpos) const { return worldpos - translation; } /** returns the current translation (=scroll) vector of the viewport */ const Vector& get_translation() const { return translation; } void set_translation(const Vector& translation); private: Vector translation; }; #endif --- NEW FILE: display_manager.cpp --- #include "display_manager.h" #include <algorithm> DisplayManager::DisplayManager() { } DisplayManager::~DisplayManager() { } void DisplayManager::add_drawable(Drawable* drawable, int layer) { DisplayList::iterator i = std::lower_bound(displaylist.begin(), displaylist.end(), layer); if(i == displaylist.end()) displaylist.push_back(DrawingQueueEntry(drawable, layer)); else displaylist.insert(i, DrawingQueueEntry(drawable, layer)); } void DisplayManager::remove_drawable(Drawable* drawable) { for(DisplayList::iterator i = displaylist.begin(); i != displaylist.end(); ) { if(i->object == drawable) i = displaylist.erase(i); else ++i; } } void DisplayManager::draw() { for(DisplayList::iterator i = displaylist.begin(); i != displaylist.end(); ++i) i->object->draw(viewport, i->layer); } --- NEW FILE: game_object.cpp --- #include "game_object.h" _GameObject::_GameObject() : wants_to_die(false) { } _GameObject::~_GameObject() { } Index: gameobjs.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- gameobjs.h 18 May 2004 19:17:33 -0000 1.18 +++ gameobjs.h 20 May 2004 12:12:38 -0000 1.19 @@ -28,6 +28,8 @@ #include "scene.h" #include "physic.h" #include "collision.h" +#include "game_object.h" +#include "drawable.h" enum ObjectType { OBJ_NONE, OBJ_BADGUY, OBJ_TRAMPOLINE }; @@ -52,14 +54,18 @@ #define NO_BOUNCE 0 #define BOUNCE 1 -class BouncyDistro : public GameObject +class BouncyDistro : public _GameObject, public Drawable { - public: - - void init(float x, float y); - void action(double frame_ratio); - void draw(); - std::string type() { return "BouncyDistro"; }; +public: + BouncyDistro(DisplayManager& displaymanager, const Vector& pos); + virtual void action(float elapsed_time); + virtual void draw(ViewPort& viewport, int layer); + virtual std::string type() const + { return "BouncyDistro"; }; + +private: + Vector position; + float ym; }; extern Surface* img_distro[4]; @@ -69,41 +75,56 @@ class Tile; -class BrokenBrick : public GameObject +class BrokenBrick : public _GameObject, public Drawable { - public: +public: + BrokenBrick(DisplayManager& displaymanager, Tile* tile, + const Vector& pos, const Vector& movement); + + virtual void action(float elapsed_time); + virtual void draw(ViewPort& viewport, int layer); + + virtual std::string type() const + { return "BrokenBrick"; }; + +private: Timer timer; Tile* tile; - - void init(Tile* tile, float x, float y, float xm, float ym); - void action(double frame_ratio); - void draw(); - std::string type() { return "BrokenBrick"; }; + Vector position; + Vector movement; }; -class BouncyBrick : public GameObject +class BouncyBrick : public _GameObject, public Drawable { - public: - float offset; - float offset_m; - int shape; +public: + BouncyBrick(DisplayManager& displaymanager, const Vector& pos); + virtual void action(float elapsed_time); + virtual void draw(ViewPort& viewport, int layer); + + virtual std::string type() const + { return "BouncyBrick"; }; - void init(float x, float y); - void action(double frame_ratio); - void draw(); - std::string type() { return "BouncyBrick"; }; +private: + Vector position; + float offset; + float offset_m; + int shape; }; -class FloatingScore : public GameObject +class FloatingScore : public _GameObject, public Drawable { - public: - int value; - Timer timer; +public: + FloatingScore(DisplayManager& displaymanager, const Vector& pos, int s); - void init(float x, float y, int s); - void action(double frame_ratio); - void draw(); - std::string type() { return "FloatingScore"; }; + virtual void action(float elapsed_time); + virtual void draw(ViewPort& viewport, int layer); + virtual std::string type() const + { return "FloatingScore"; }; + +private: + Vector position; + char str[10]; + Timer timer; }; Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.133 retrieving revision 1.134 diff -u -d -r1.133 -r1.134 --- gameloop.cpp 19 May 2004 10:29:39 -0000 1.133 +++ gameloop.cpp 20 May 2004 12:12:38 -0000 1.134 @@ -657,8 +657,8 @@ /* Bounce a brick: */ void bumpbrick(float x, float y) { - World::current()->add_bouncy_brick(((int)(x + 1) / 32) * 32, - (int)(y / 32) * 32); + World::current()->add_bouncy_brick(Vector(((int)(x + 1) / 32) * 32, + (int)(y / 32) * 32)); play_sound(sounds[SND_BRICK], SOUND_CENTER_SPEAKER); } Index: particlesystem.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/particlesystem.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- particlesystem.h 20 Apr 2004 11:09:34 -0000 1.3 +++ particlesystem.h 20 May 2004 12:12:38 -0000 1.4 @@ -22,6 +22,10 @@ #include <vector> #include "texture.h" +#include "drawable.h" +#include "game_object.h" + +class DisplayManager; /** * This is the base class for particle systems. It is responsible for storing a @@ -38,15 +42,13 @@ * initialize particles in the constructor and move them in the simulate * function. */ -class ParticleSystem +class ParticleSystem : public _GameObject, public Drawable { public: - ParticleSystem(); + ParticleSystem(DisplayManager& displaymanager); virtual ~ParticleSystem(); - void draw(float scrollx, float scrolly, int layer); - - virtual void simulate(float elapsed_time) = 0; + virtual void draw(ViewPort& view, int layer); protected: class Particle @@ -67,10 +69,13 @@ class SnowParticleSystem : public ParticleSystem { public: - SnowParticleSystem(); + SnowParticleSystem(DisplayManager& displaymanager); virtual ~SnowParticleSystem(); - virtual void simulate(float elapsed_time); + virtual void action(float elapsed_time); + + std::string type() const + { return "SnowParticleSystem"; } private: class SnowParticle : public Particle @@ -85,10 +90,13 @@ class CloudParticleSystem : public ParticleSystem { public: - CloudParticleSystem(); + CloudParticleSystem(DisplayManager& displaymanager); virtual ~CloudParticleSystem(); - virtual void simulate(float elapsed_time); + virtual void action(float elapsed_time); + + std::string type() const + { return "SnowParticleSystem"; } private: class CloudParticle : public Particle --- NEW FILE: vector.h --- #ifndef __VECTOR_HPP__ #define __VECTOR_HPP__ class Vector { public: Vector(float nx, float ny) : x(nx), y(ny) { } Vector(const Vector& other) : x(other.x), y(other.y) { } Vector() : x(0), y(0) { } bool operator ==(const Vector& other) const { return x == other.x && y == other.y; } const Vector& operator=(const Vector& other) { x = other.x; y = other.y; return *this; } Vector operator+(const Vector& other) const { return Vector(x + other.x, y + other.y); } Vector operator-(const Vector& other) const { return Vector(x - other.x, y - other.y); } Vector operator*(float s) const { return Vector(x * s, y * s); } const Vector& operator +=(const Vector& other) { x += other.x; y += other.y; return *this; } // ... add the other operators as needed, I'm too lazy now ... float x, y; // leave this public, get/set methods just give me headaches // for such simple stuff :) }; #endif --- NEW FILE: display_manager.h --- #ifndef __DISPLAY_MANAGER_H__ #define __DISPLAY_MANAGER_H__ #include <vector> #include "drawable.h" #include "viewport.h" // some constants for predefined layer values enum { LAYER_BACKGROUND0 = -300, LAYER_BACKGROUND1 = -200, LAYER_BACKGROUNDTILES = -100, LAYER_TILES = 0, LAYER_OBJECTS = 100, LAYER_FOREGROUND0 = 200, LAYER_FOREGROUND1 = 300 }; /** This class holds a list of all things that should be drawn to screen */ class DisplayManager { public: DisplayManager(); ~DisplayManager(); /** adds an object to the list of stuff that should be drawn each frame. * The layer argument specifies how early an object is drawn. */ void add_drawable(Drawable* object, int layer); void remove_drawable(Drawable* object); void draw(); ViewPort& get_viewport() { return viewport; } private: class DrawingQueueEntry { public: DrawingQueueEntry(Drawable* newobject, int newlayer) : object(newobject), layer(newlayer) { } bool operator <(int olayer) const { return layer < olayer; } Drawable* object; int layer; }; typedef std::vector<DrawingQueueEntry> DisplayList; DisplayList displaylist; ViewPort viewport; }; #endif --- NEW FILE: viewport.cpp --- #include "viewport.h" ViewPort::ViewPort() { } ViewPort::~ViewPort() { } void ViewPort::set_translation(const Vector& newtranslation) { translation = newtranslation; } Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- badguy.cpp 18 May 2004 18:12:16 -0000 1.80 +++ badguy.cpp 20 May 2004 12:12:38 -0000 1.81 @@ -864,8 +864,8 @@ { make_player_jump(player); - World::current()->add_score(base.x, - base.y, 50 * player_status.score_multiplier); + World::current()->add_score(Vector(base.x, base.y), + 50 * player_status.score_multiplier); play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER); player_status.score_multiplier++; @@ -884,7 +884,8 @@ World::current()->add_bad_guy(base.x, base.y, BAD_BOMB); make_player_jump(player); - World::current()->add_score(base.x, base.y, 50 * player_status.score_multiplier); + World::current()->add_score(Vector(base.x, base.y), + 50 * player_status.score_multiplier); play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER); player_status.score_multiplier++; remove_me(); @@ -936,7 +937,8 @@ make_player_jump(player); - World::current()->add_score(base.x, base.y, 25 * player_status.score_multiplier); + World::current()->add_score(Vector(base.x, base.y), + 25 * player_status.score_multiplier); player_status.score_multiplier++; // simply remove the fish... @@ -977,8 +979,8 @@ /* Gain some points: */ if (score != 0) - World::current()->add_score(base.x, base.y, - score * player_status.score_multiplier); + World::current()->add_score(Vector(base.x, base.y), + score * player_status.score_multiplier); /* Play death sound: */ play_sound(sounds[SND_FALL], SOUND_CENTER_SPEAKER); Index: gameobjs.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameobjs.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- gameobjs.cpp 19 May 2004 18:22:48 -0000 1.28 +++ gameobjs.cpp 20 May 2004 12:12:38 -0000 1.29 @@ -27,73 +27,51 @@ #include "sprite_manager.h" #include "resources.h" #include "level.h" +#include "display_manager.h" -void -BouncyDistro::init(float x, float y) +BouncyDistro::BouncyDistro(DisplayManager& displaymanager, const Vector& pos) + : position(pos) { - base.x = x; - base.y = y; - base.ym = -2; + ym = -2; + displaymanager.add_drawable(this, LAYER_OBJECTS); } void -BouncyDistro::action(double frame_ratio) +BouncyDistro::action(float elapsed_time) { - base.y = base.y + base.ym * frame_ratio; - - base.ym += 0.1 * frame_ratio; + position.y += ym * elapsed_time; - if (base.ym >= 0) - { - std::vector<BouncyDistro*>::iterator i - = std::find(World::current()->bouncy_distros.begin(), - World::current()->bouncy_distros.end(), - this); - if (i != World::current()->bouncy_distros.end()) - World::current()->bouncy_distros.erase(i); - } + ym += 0.1 * elapsed_time; // not framerate independent... but who really cares + if(ym >= 0) + remove_me(); } void -BouncyDistro::draw() +BouncyDistro::draw(ViewPort& viewport, int ) { - img_distro[0]->draw(base.x - scroll_x, - base.y - scroll_y); + img_distro[0]->draw(viewport.world2screen(position)); } -void -BrokenBrick::init(Tile* tile_, float x, float y, float xm, float ym) +BrokenBrick::BrokenBrick(DisplayManager& displaymanager, Tile* ntile, + const Vector& pos, const Vector& nmovement) + : tile(ntile), position(pos), movement(nmovement) { - tile = tile_; - base.x = x; - base.y = y; - base.xm = xm; - base.ym = ym; - - timer.init(true); + displaymanager.add_drawable(this, LAYER_OBJECTS); timer.start(200); } void -BrokenBrick::action(double frame_ratio) +BrokenBrick::action(float elapsed_time) { - base.x = base.x + base.xm * frame_ratio; - base.y = base.y + base.ym * frame_ratio; + position += movement * elapsed_time; if (!timer.check()) - { - std::vector<BrokenBrick*>::iterator i - = std::find(World::current()->broken_bricks.begin(), - World::current()->broken_bricks.end(), - this); - if (i != World::current()->broken_bricks.end()) - World::current()->broken_bricks.erase(i); - } + remove_me(); } void -BrokenBrick::draw() +BrokenBrick::draw(ViewPort& viewport, int ) { SDL_Rect src, dest; src.x = rand() % 16; @@ -101,8 +79,8 @@ src.w = 16; src.h = 16; - dest.x = (int)(base.x - scroll_x); - dest.y = (int)(base.y - scroll_y); + dest.x = (int)(position.x - viewport.get_translation().x); + dest.y = (int)(position.y - viewport.get_translation().y); dest.w = 16; dest.h = 16; @@ -110,107 +88,56 @@ tile->images[0]->draw_part(src.x,src.y,dest.x,dest.y,dest.w,dest.h); } -void -BouncyBrick::init(float x, float y) +BouncyBrick::BouncyBrick(DisplayManager& displaymanager, const Vector& pos) + : position(pos), offset(0), offset_m(-BOUNCY_BRICK_SPEED) { - base.x = x; - base.y = y; - offset = 0; - offset_m = -BOUNCY_BRICK_SPEED; - shape = World::current()->get_level()->gettileid(x, y); + displaymanager.add_drawable(this, LAYER_OBJECTS); + shape = World::current()->get_level()->gettileid(pos.x, pos.y); } void -BouncyBrick::action(double frame_ratio) +BouncyBrick::action(float elapsed_time) { - offset = (offset + offset_m * frame_ratio); + offset += offset_m * elapsed_time; /* Go back down? */ if (offset < -BOUNCY_BRICK_MAX_OFFSET) offset_m = BOUNCY_BRICK_SPEED; - /* Stop bouncing? */ if (offset >= 0) - { - std::vector<BouncyBrick*>::iterator i - = std::find(World::current()->bouncy_bricks.begin(), - World::current()->bouncy_bricks.end(), - this); - if (i != World::current()->bouncy_bricks.end()) - World::current()->bouncy_bricks.erase(i); - } + remove_me(); } void -BouncyBrick::draw() +BouncyBrick::draw(ViewPort& viewport, int) { - SDL_Rect dest; - - if (base.x >= scroll_x - 32 && - base.x <= scroll_x + screen->w) - { - dest.x = (int)(base.x - scroll_x); - dest.y = (int)(base.y - scroll_y); - dest.w = 32; - dest.h = 32; - - Level* plevel = World::current()->get_level(); - - // FIXME: overdrawing hack to clean the tile from the screen to - // paint it later at on offseted position - if(plevel->img_bkgd) - { - fillrect(base.x - scroll_x, base.y - scroll_y, - 32,32, - plevel->bkgd_top.red, plevel->bkgd_top.green, plevel->bkgd_top.blue, 0); -// FIXME: doesn't respect the gradient, futhermore is this necessary at all?? - } - else - { - int s = ((int)scroll_x / 2)%640; - plevel->img_bkgd->draw_part(dest.x + s, dest.y, - dest.x, dest.y,dest.w,dest.h); - } - - Tile::draw(base.x - scroll_x, - base.y - scroll_y + offset, - shape); - } + Tile::draw(viewport.world2screen(position + Vector(0, offset)), shape); } -void -FloatingScore::init(float x, float y, int s) +FloatingScore::FloatingScore(DisplayManager& displaymanager, + const Vector& pos, int score) + : position(pos) { - base.x = x; - base.y = y - 16; - timer.init(true); + displaymanager.add_drawable(this, LAYER_OBJECTS+1); timer.start(1000); - value = s; + snprintf(str, 10, "%d", score); + position.x += - strlen(str) * 8; } void -FloatingScore::action(double frame_ratio) +FloatingScore::action(float elapsed_time) { - base.y = base.y - 2 * frame_ratio; + position.y -= 2 * elapsed_time; if(!timer.check()) - { - std::vector<FloatingScore*>::iterator i - = std::find(World::current()->floating_scores.begin(), - World::current()->floating_scores.end(), - this); - if (i != World::current()->floating_scores.end()) - World::current()->floating_scores.erase(i); - } + remove_me(); } void -FloatingScore::draw() +FloatingScore::draw(ViewPort& viewport, int ) { - char str[10]; - sprintf(str, "%d", value); - gold_text->draw(str, (int)base.x + 16 - strlen(str) * 8, (int)base.y, 1); + gold_text->draw(str, viewport.world2screen(position)); } /* Trampoline */ @@ -364,6 +291,7 @@ void ObjectManager::load_badguys(std::string filename) { + (void) filename; /* lisp_object_t* root_obj = lisp_read_from_file(filename); --- NEW FILE: game_object.h --- #ifndef __GAMEOBJECT_HPP__ #define __GAMEOBJECT_HPP__ #include <string> class DisplayManager; /** * Base class for all game objects. This contains functions for: * -querying the actual type of the object * -a flag that indicates if the object wants to be removed. Objects with this * flag will be removed at the end of each frame. This is alot safer than * having some uncontrollable "delete this" in the code. * -an action function that is called once per frame and allows the object to * update it's state. * * Most GameObjects will also implement the DrawableObject interface so that * they can actually be drawn on screen. */ class _GameObject // TODO rename this once the game has been converted { public: _GameObject(); virtual ~_GameObject(); /** returns the name of the objecttype, this is mainly usefull for the editor. * For the coding part you should use C++ RTTI (ie. typeid and dynamic_cast) * instead. */ virtual std::string type() const = 0; /** This function is called once per frame and allows the object to update * it's state. The elapsed_time is the time since the last frame and should be * the base for all timed things. */ virtual void action(float elapsed_time) = 0; /** returns true if the object is not scheduled to be removed yet */ bool is_valid() const { return !wants_to_die; } /** schedules this object to be removed at the end of the frame */ void remove_me() { wants_to_die = true; } private: /** this flag indicates if the object should be removed at the end of the * frame */ bool wants_to_die; }; #endif Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -u -d -r1.99 -r1.100 --- world.cpp 19 May 2004 03:20:50 -0000 1.99 +++ world.cpp 20 May 2004 12:12:38 -0000 1.100 @@ -33,6 +33,9 @@ #include "tile.h" #include "resources.h" #include "gameobjs.h" +#include "viewport.h" +#include "display_manager.h" +#include "background.h" Surface* img_distro[4]; @@ -51,8 +54,16 @@ get_level()->load_gfx(); activate_bad_guys(); - activate_objects(); + // add background activate_particle_systems(); + Background* bg = new Background(displaymanager); + if(level->img_bkgd) { + bg->set_image(level->img_bkgd, level->bkgd_speed); + } else { + bg->set_gradient(level->bkgd_top, level->bkgd_bottom); + } + gameobjects.push_back(bg); + activate_objects(); get_level()->load_song(); apply_bonuses(); @@ -75,6 +86,13 @@ activate_bad_guys(); activate_objects(); activate_particle_systems(); + Background* bg = new Background(displaymanager); + if(level->img_bkgd) { + bg->set_image(level->img_bkgd, level->bkgd_speed); + } else { + bg->set_gradient(level->bkgd_top, level->bkgd_bottom); + } + gameobjects.push_back(bg); get_level()->load_song(); apply_bonuses(); @@ -112,26 +130,14 @@ for (Trampolines::iterator i = trampolines.begin(); i != trampolines.end(); ++i) delete *i; - for (ParticleSystems::iterator i = particle_systems.begin(); - i != particle_systems.end(); ++i) - delete *i; - - for (std::vector<BouncyDistro*>::iterator i = bouncy_distros.begin(); - i != bouncy_distros.end(); ++i) - delete *i; - - for (std::vector<BrokenBrick*>::iterator i = broken_bricks.begin(); - i != broken_bricks.end(); ++i) - delete *i; - - for (std::vector<BouncyBrick*>::iterator i = bouncy_bricks.begin(); - i != bouncy_bricks.end(); ++i) + for (std::vector<_GameObject*>::iterator i = gameobjects.begin(); + i != gameobjects.end(); ++i) { + Drawable* drawable = dynamic_cast<Drawable*> (*i); + if(drawable) + displaymanager.remove_drawable(drawable); delete *i; + } - for (std::vector<FloatingScore*>::iterator i = floating_scores.begin(); - i != floating_scores.end(); ++i) - delete *i; - delete level; } @@ -177,11 +183,11 @@ { if (level->particle_system == "clouds") { - particle_systems.push_back(new CloudParticleSystem); + gameobjects.push_back(new CloudParticleSystem(displaymanager)); } else if (level->particle_system == "snow") { - particle_systems.push_back(new SnowParticleSystem); + gameobjects.push_back(new SnowParticleSystem(displaymanager)); } else if (level->particle_system != "") { @@ -195,18 +201,16 @@ int y,x; /* Draw the real background */ +#if 0 drawgradient(level->bkgd_top, level->bkgd_bottom); if(level->img_bkgd) level->draw_bg(); - +#endif /* Draw particle systems (background) */ - std::vector<ParticleSystem*>::iterator p; - for(p = particle_systems.begin(); p != particle_systems.end(); ++p) - { - (*p)->draw(scroll_x, 0, 0); - } - + displaymanager.get_viewport().set_translation(Vector(scroll_x, scroll_y)); + displaymanager.draw(); + /* Draw background: */ for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) { @@ -227,10 +231,6 @@ } } - /* (Bouncy bricks): */ - for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) - bouncy_bricks[i]->draw(); - for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) (*i)->draw(); @@ -242,18 +242,9 @@ for (unsigned int i = 0; i < bullets.size(); ++i) bullets[i].draw(); - for (unsigned int i = 0; i < floating_scores.size(); ++i) - floating_scores[i]->draw(); - for (unsigned int i = 0; i < upgrades.size(); ++i) upgrades[i].draw(); - for (unsigned int i = 0; i < bouncy_distros.size(); ++i) - bouncy_distros[i]->draw(); - - for (unsigned int i = 0; i < broken_bricks.size(); ++i) - broken_bricks[i]->draw(); - /* Draw foreground: */ for (y = 0; y < VISIBLE_TILES_Y && y < level->height; ++y) { @@ -263,12 +254,6 @@ level->fg_tiles[(int)y + (int)(scroll_y / 32)][(int)x + (int)(scroll_x / 32)]); } } - - /* Draw particle systems (foreground) */ - for(p = particle_systems.begin(); p != particle_systems.end(); ++p) - { - (*p)->draw(scroll_x, 0, 1); - } } void @@ -278,21 +263,6 @@ tux.check_bounds(level->back_scrolling, (bool)level->hor_autoscroll_speed); scrolling(frame_ratio); - /* Handle bouncy distros: */ - for (unsigned int i = 0; i < bouncy_distros.size(); i++) - bouncy_distros[i]->action(frame_ratio); - - /* Handle broken bricks: */ - for (unsigned int i = 0; i < broken_bricks.size(); i++) - broken_bricks[i]->action(frame_ratio); - - // Handle all kinds of game objects - for (unsigned int i = 0; i < bouncy_bricks.size(); i++) - bouncy_bricks[i]->action(frame_ratio); - - for (unsigned int i = 0; i < floating_scores.size(); i++) - floating_scores[i]->action(frame_ratio); - for (unsigned int i = 0; i < bullets.size(); ++i) bullets[i].action(frame_ratio); @@ -306,11 +276,9 @@ (*i)->action(frame_ratio); /* update particle systems */ - std::vector<ParticleSystem*>::iterator p; - for(p = particle_systems.begin(); p != particle_systems.end(); ++p) - { - (*p)->simulate(frame_ratio); - } + for(std::vector<_GameObject*>::iterator i = gameobjects.begin(); + i != gameobjects.end(); ++i) + (*i)->action(frame_ratio); /* Handle all possible collisions. */ collision_handler(); @@ -325,6 +293,20 @@ ++i; } } + + for(std::vector<_GameObject*>::iterator i = gameobjects.begin(); + i != gameobjects.end(); /* nothing */) { + if((*i)->is_valid() == false) { + Drawable* drawable = dynamic_cast<Drawable*> (*i); + if(drawable) + displaymanager.remove_drawable(drawable); + + delete *i; + i = gameobjects.erase(i); + } else { + ++i; + } + } } /* the space that it takes for the screen to start scrolling, regarding */ @@ -541,47 +523,40 @@ } void -World::add_score(float x, float y, int s) +World::add_score(const Vector& pos, int s) { player_status.score += s; - FloatingScore* new_floating_score = new FloatingScore(); - new_floating_score->init(x-scroll_x, y-scroll_y, s); - floating_scores.push_back(new_floating_score); + gameobjects.push_back(new FloatingScore(displaymanager, pos, s)); } void -World::add_bouncy_distro(float x, float y) +World::add_bouncy_distro(const Vector& pos) { - BouncyDistro* new_bouncy_distro = new BouncyDistro(); - new_bouncy_distro->init(x, y); - bouncy_distros.push_back(new_bouncy_distro); + gameobjects.push_back(new BouncyDistro(displaymanager, pos)); } void -World::add_broken_brick(Tile* tile, float x, float y) +World::add_broken_brick(const Vector& pos, Tile* tile) { - add_broken_brick_piece(tile, x, y, -1, -4); - add_broken_brick_piece(tile, x, y + 16, -1.5, -3); + add_broken_brick_piece(pos, Vector(-1, -4), tile); + add_broken_brick_piece(pos + Vector(0, 16), Vector(-1.5, -3), tile); - add_broken_brick_piece(tile, x + 16, y, 1, -4); - add_broken_brick_piece(tile, x + 16, y + 16, 1.5, -3); + add_broken_brick_piece(pos + Vector(16, 0), Vector(1, -4), tile); + add_broken_brick_piece(pos + Vector(16, 16), Vector(1.5, -3), tile); } void -World::add_broken_brick_piece(Tile* tile, float x, float y, float xm, float ym) +World::add_broken_brick_piece(const Vector& pos, const Vector& movement, + Tile* tile) { - BrokenBrick* new_broken_brick = new BrokenBrick(); - new_broken_brick->init(tile, x, y, xm, ym); - broken_bricks.push_back(new_broken_brick); + gameobjects.push_back(new BrokenBrick(displaymanager, tile, pos, movement)); } void -World::add_bouncy_brick(float x, float y) +World::add_bouncy_brick(const Vector& pos) { - BouncyBrick* new_bouncy_brick = new BouncyBrick(); - new_bouncy_brick->init(x,y); - bouncy_bricks.push_back(new_bouncy_brick); + gameobjects.push_back(new BouncyBrick(displaymanager, pos)); } BadGuy* @@ -674,8 +649,8 @@ if (tile->data > 0) { /* Get a distro from it: */ - add_bouncy_distro(((int)(x + 1) / 32) * 32, - (int)(y / 32) * 32); + add_bouncy_distro( + Vector(((int)(x + 1) / 32) * 32, (int)(y / 32) * 32)); // TODO: don't handle this in a global way but per-tile... if (!counting_distros) @@ -705,9 +680,9 @@ plevel->change(x, y, TM_IA, tile->next_tile); /* Replace it with broken bits: */ - add_broken_brick(tile, + add_broken_brick(Vector( ((int)(x + 1) / 32) * 32, - (int)(y / 32) * 32); + (int)(y / 32) * 32), tile); /* Get some score: */ play_sound(sounds[SND_BRICK], SOUND_CENTER_SPEAKER); @@ -739,7 +714,7 @@ switch(tile->data) { case 1: // Box with a distro! - add_bouncy_distro(posx, posy); + add_bouncy_distro(Vector(posx, posy)); play_sound(sounds[SND_DISTRO], SOUND_CENTER_SPEAKER); player_status.score = player_status.score + SCORE_DISTRO; player_status.distros++; @@ -788,8 +763,8 @@ if (bounciness == BOUNCE) { - add_bouncy_distro(((int)(x + 1) / 32) * 32, - (int)(y / 32) * 32); + add_bouncy_distro(Vector(((int)(x + 1) / 32) * 32, + (int)(y / 32) * 32)); } player_status.score = player_status.score + SCORE_DISTRO; --- NEW FILE: drawable.h --- #ifndef __DRAWABLE_H__ #define __DRAWABLE_H__ class ViewPort; /** interface for all game objects that can be drawn on screen. */ class Drawable { public: /** This function draws the object on screen. */ virtual void draw(ViewPort& viewport, int layer) = 0; }; #endif Index: texture.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/texture.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- texture.h 9 May 2004 18:08:02 -0000 1.23 +++ texture.h 20 May 2004 12:12:38 -0000 1.24 @@ -29,6 +29,7 @@ #include <list> #include "screen.h" +#include "vector.h" SDL_Surface* sdl_surface_from_sdl_surface(SDL_Surface* sdl_surf, int use_alpha); @@ -92,6 +93,12 @@ void draw_part(float sx, float sy, float x, float y, float w, float h, Uint8 alpha = 255, bool update = false); void draw_stretched(float x, float y, int w, int h, Uint8 alpha, bool update = false); void resize(int w_, int h_); + + /// conveniance function + void draw(const Vector& pos, Uint8 alpha = 255, bool update = false) + { + draw(pos.x, pos.y, alpha, update); + } }; /** Surface implementation, all implementation have to inherit from Index: text.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/text.h,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- text.h 28 Apr 2004 14:58:24 -0000 1.15 +++ text.h 20 May 2004 12:12:38 -0000 1.16 @@ -23,6 +23,7 @@ #include <string> #include "texture.h" +#include "vector.h" void display_text_file(const std::string& file, const std::string& surface, float scroll_speed); void display_text_file(const std::string& file, Surface* surface, float scroll_speed); @@ -64,6 +65,13 @@ void draw_align(const char* text, int x, int y, TextHAlign halign, TextVAlign valign, int shadowsize = 1, int update = NO_UPDATE); void erasetext(const char * text, int x, int y, Surface* surf, int update, int shadowsize); void erasecenteredtext(const char * text, int y, Surface* surf, int update, int shadowsize); + + /// conveniance function + void draw(const char* text, const Vector& pos, int shadowsize = 1, int update + = NO_UPDATE) + { + draw(text, int(pos.x), int(pos.y), shadowsize, update); + } }; #endif /*SUPERTUX_TEXT_H*/ |
From: Ricardo C. <rm...@us...> - 2004-05-19 23:58:47
|
Update of /cvsroot/super-tux/htdocs/development In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2450/development Modified Files: map.xml Log Message: Added Ratchet worlds. This was just to check if my xalan is working... It isn't :( Index: map.xml =================================================================== RCS file: /cvsroot/super-tux/htdocs/development/map.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- map.xml 4 May 2004 11:39:09 -0000 1.3 +++ map.xml 19 May 2004 23:58:37 -0000 1.4 @@ -63,6 +63,32 @@ </p> </section> + <section title="Worlds"> + <p> + The worlds proposal by Ratchet with respective bosses:<br/><br/> + + world 1 - Icy Island (of course) - Big Snowman<br/> + world 2 - Forest/Grasslands - Big Tree Badguy<br/> + world 3 - Jungle - Primate or Chief Penguin Tribesman<br/> + world 4 - Underwater Caves - Octopus-like creature<br/> + world 5 - Desert - Dust Devil (Whirlwind)<br/> + world 6 - Island world - Big Island-type Penguin<br/> + world 7 - Industrial World - Big Robot<br/> + world 8 - Illusion Island - Rainbow Creature<br/> + world 9 Outer Walls - Nolok-type creature<br/> + world 10 - Nolok's Office - A bad computer<br/> + world 11 - Nolok's Kitchens - Chef<br/> + world 12 - Nolok's Dining Room - Giant Fork<br/> + world 13 - Nolok's Lab - Giant Amoeba<br/> + world 14 - Tower Tops - must jump aboard Helicopter<br/> + world 15 - Space Station - Nolok<br/> + world 16 - The Dungeon - Dungeon Creature<br/> + world 17 - Rescuing Penny - Something that has Penny<br/> + world 18 - Antarctica Again - No Boss, Celebration with Penny<br/> + </p> + </section> + + <section title="Game ideas"> <p> Here goes a few unsorted images contributed by people, in order |