super-tux-commit Mailing List for Super Tux (Page 90)
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: Ingo R. <gr...@us...> - 2004-04-23 12:41:26
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29495/data Modified Files: supertux.strf Log Message: - 'animated' explosion a bit Index: supertux.strf =================================================================== RCS file: /cvsroot/super-tux/supertux/data/supertux.strf,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- supertux.strf 23 Apr 2004 11:24:37 -0000 1.16 +++ supertux.strf 23 Apr 2004 12:41:10 -0000 1.17 @@ -101,9 +101,11 @@ "shared/mrbombx-right-1.png")) (sprite (name "mrbomb-explosion") + (fps 15.0) (x-hotspot 32) (y-hotspot 32) - (images "shared/mrbomb-explosion.png")) + (images "shared/mrbomb-explosion.png" + "shared/mrbomb-explosion-1.png")) (sprite (name "stalactite") (x-hotspot 0) |
From: Ingo R. <gr...@us...> - 2004-04-23 12:41:20
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29495/data/images/shared Added Files: mrbomb-explosion-1.png Log Message: - 'animated' explosion a bit --- NEW FILE: mrbomb-explosion-1.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-23 11:42:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18310/src Modified Files: setup.cpp Log Message: Just removed spaces from key and joystick setup entries... What were does doing there anyway? Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- setup.cpp 23 Apr 2004 11:12:43 -0000 1.50 +++ setup.cpp 23 Apr 2004 11:42:18 -0000 1.51 @@ -402,9 +402,9 @@ options_menu->additem(MN_DEACTIVE,"Music ",use_music,0); } options_menu->additem(MN_TOGGLE,"Show FPS ",show_fps,0); - options_menu->additem(MN_GOTO,"Key Setup ",0,options_keys_menu); + options_menu->additem(MN_GOTO,"Key Setup",0,options_keys_menu); if(use_joystick) - options_menu->additem(MN_GOTO,"Joystick Setup ",0,options_joystick_menu); + options_menu->additem(MN_GOTO,"Joystick Setup",0,options_joystick_menu); options_menu->additem(MN_HL,"",0,0); options_menu->additem(MN_BACK,"Back",0,0); |
From: Ricardo C. <rm...@us...> - 2004-04-23 11:24:45
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14963/data Modified Files: supertux.strf Log Message: Added laptop entry back, that is used by Mr. IceBlock, as reported by Ryan. (had to remove comment laptop falling) The BSOD is not also necessary, is it? Index: supertux.strf =================================================================== RCS file: /cvsroot/super-tux/supertux/data/supertux.strf,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- supertux.strf 22 Apr 2004 20:58:05 -0000 1.15 +++ supertux.strf 23 Apr 2004 11:24:37 -0000 1.16 @@ -12,6 +12,38 @@ "shared/smalltux-right-7.png" "shared/smalltux-right-8.png")) + (sprite (name "laptop-left") + (x-hotspot 2) + (y-hotspot 3) + (images "shared/mriceblock-left-0.png" + "shared/mriceblock-left-1.png" + "shared/mriceblock-left-2.png" + "shared/mriceblock-left-1.png")) + + (sprite (name "laptop-right") + (x-hotspot 2) + (y-hotspot 3) + (images "shared/mriceblock-right-0.png" + "shared/mriceblock-right-1.png" + "shared/mriceblock-right-2.png" + "shared/mriceblock-right-1.png")) + + (sprite (name "laptop-flat-left") + (x-hotspot 2) + (y-hotspot 3) + (images "shared/mriceblock-flat-left.png")) + + (sprite (name "laptop-flat-right") + (x-hotspot 2) + (y-hotspot 3) + (images "shared/mriceblock-flat-right.png")) + +; (sprite (name "laptop-falling-left") +; (images "shared/laptop-falling-left.png")) + +; (sprite (name "laptop-falling-right") +; (images "shared/laptop-falling-right.png")) + (sprite (name "snowball-squished-left") (x-hotspot 1) (y-hotspot -19) |
From: Ricardo C. <rm...@us...> - 2004-04-23 11:12:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12905/src Modified Files: menu.cpp menu.h setup.cpp Log Message: Added a joystick control dialog. I don't have a joystick, so please test and improve this thing. Thx. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- menu.cpp 22 Apr 2004 20:44:11 -0000 1.50 +++ menu.cpp 23 Apr 2004 11:12:43 -0000 1.51 @@ -48,7 +48,8 @@ Menu* game_menu = 0; Menu* worldmap_menu = 0; Menu* options_menu = 0; -Menu* options_controls_menu = 0; +Menu* options_keys_menu = 0; +Menu* options_joystick_menu = 0; Menu* highscore_menu = 0; Menu* load_game_menu = 0; Menu* save_game_menu = 0; Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- setup.cpp 22 Apr 2004 20:45:22 -0000 1.49 +++ setup.cpp 23 Apr 2004 11:12:43 -0000 1.50 @@ -365,7 +365,8 @@ { main_menu = new Menu(); options_menu = new Menu(); - options_controls_menu = new Menu(); + options_keys_menu = new Menu(); + options_joystick_menu = new Menu(); load_game_menu = new Menu(); save_game_menu = new Menu(); game_menu = new Menu(); @@ -401,20 +402,36 @@ options_menu->additem(MN_DEACTIVE,"Music ",use_music,0); } options_menu->additem(MN_TOGGLE,"Show FPS ",show_fps,0); - options_menu->additem(MN_GOTO,"Controls ",0,options_controls_menu); + options_menu->additem(MN_GOTO,"Key Setup ",0,options_keys_menu); + if(use_joystick) + options_menu->additem(MN_GOTO,"Joystick Setup ",0,options_joystick_menu); options_menu->additem(MN_HL,"",0,0); options_menu->additem(MN_BACK,"Back",0,0); - options_controls_menu->additem(MN_LABEL,"Controls",0,0); - options_controls_menu->additem(MN_HL,"",0,0); - options_controls_menu->additem(MN_CONTROLFIELD,"Left move", 0,0, &keymap.left); - options_controls_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); - options_controls_menu->additem(MN_CONTROLFIELD,"Jump", 0,0, &keymap.jump); - options_controls_menu->additem(MN_CONTROLFIELD,"Duck", 0,0, &keymap.duck); - options_controls_menu->additem(MN_CONTROLFIELD,"Power", 0,0, &keymap.fire); - options_controls_menu->additem(MN_HL,"",0,0); - options_controls_menu->additem(MN_BACK,"Back",0,0); + options_keys_menu->additem(MN_LABEL,"Key Setup",0,0); + options_keys_menu->additem(MN_HL,"",0,0); + options_keys_menu->additem(MN_CONTROLFIELD,"Left move", 0,0, &keymap.left); + options_keys_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); + options_keys_menu->additem(MN_CONTROLFIELD,"Jump", 0,0, &keymap.jump); + options_keys_menu->additem(MN_CONTROLFIELD,"Duck", 0,0, &keymap.duck); + options_keys_menu->additem(MN_CONTROLFIELD,"Power", 0,0, &keymap.fire); + options_keys_menu->additem(MN_HL,"",0,0); + options_keys_menu->additem(MN_BACK,"Back",0,0); + if(use_joystick) + { + options_joystick_menu->additem(MN_LABEL,"Joystick Setup",0,0); + options_joystick_menu->additem(MN_HL,"",0,0); + options_joystick_menu->additem(MN_CONTROLFIELD,"X axis", 0,0, &joystick_keymap.x_axis); + options_joystick_menu->additem(MN_CONTROLFIELD,"Y axis", 0,0, &joystick_keymap.y_axis); + options_joystick_menu->additem(MN_CONTROLFIELD,"A button", 0,0, &joystick_keymap.a_button); + options_joystick_menu->additem(MN_CONTROLFIELD,"B button", 0,0, &joystick_keymap.b_button); + options_joystick_menu->additem(MN_CONTROLFIELD,"Start", 0,0, &joystick_keymap.start_button); + options_joystick_menu->additem(MN_CONTROLFIELD,"DeadZone", 0,0, &joystick_keymap.dead_zone); + options_joystick_menu->additem(MN_HL,"",0,0); + options_joystick_menu->additem(MN_BACK,"Back",0,0); + } + load_game_menu->additem(MN_LABEL,"Start Game",0,0); load_game_menu->additem(MN_HL,"",0,0); load_game_menu->additem(MN_DEACTIVE,"Slot 1",0,0); Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- menu.h 22 Apr 2004 18:39:52 -0000 1.43 +++ menu.h 23 Apr 2004 11:12:43 -0000 1.44 @@ -155,7 +155,8 @@ extern Menu* game_menu; extern Menu* worldmap_menu; extern Menu* options_menu; -extern Menu* options_controls_menu; +extern Menu* options_keys_menu; +extern Menu* options_joystick_menu; extern Menu* highscore_menu; extern Menu* load_game_menu; extern Menu* save_game_menu; |
From: Ricardo C. <rm...@us...> - 2004-04-23 02:32:32
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25281/src Modified Files: menu.cpp menu.h Log Message: Controls menu wasn't showing the keys until they were changed (fixed). Also made a few internal changes regarding this. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- menu.cpp 22 Apr 2004 17:51:03 -0000 1.48 +++ menu.cpp 22 Apr 2004 18:39:52 -0000 1.49 @@ -150,54 +150,50 @@ } /* Set ControlField a key */ -void MenuItem::set_controlfield_key(SDLKey key, char ch[]) +void Menu::get_controlfield_key_into_input(MenuItem *item) { -*int_p = key; -if(ch[0] != '\0') - strcpy(input, ch); -else - switch(key) - { - case SDLK_UP: - strcpy(input, "Up cursor"); - break; - case SDLK_DOWN: - strcpy(input, "Down cursor"); - break; - case SDLK_LEFT: - strcpy(input, "Left cursor"); - break; - case SDLK_RIGHT: - strcpy(input, "Right cursor"); - break; - case SDLK_RETURN: - strcpy(input, "Return"); - break; - case SDLK_SPACE: - strcpy(input, "Space"); - break; - case SDLK_RSHIFT: - strcpy(input, "Right Shift"); - break; - case SDLK_LSHIFT: - strcpy(input, "Left Shift"); - break; - case SDLK_RCTRL: - strcpy(input, "Right Control"); - break; - case SDLK_LCTRL: - strcpy(input, "Left Control"); - break; - case SDLK_RALT: - strcpy(input, "Right Alt"); - break; - case SDLK_LALT: - strcpy(input, "Left Alt"); - break; - default: - strcpy(input, "?"); - break; - } +switch(*item->int_p) + { + case SDLK_UP: + strcpy(item->input, "Up cursor"); + break; + case SDLK_DOWN: + strcpy(item->input, "Down cursor"); + break; + case SDLK_LEFT: + strcpy(item->input, "Left cursor"); + break; + case SDLK_RIGHT: + strcpy(item->input, "Right cursor"); + break; + case SDLK_RETURN: + strcpy(item->input, "Return"); + break; + case SDLK_SPACE: + strcpy(item->input, "Space"); + break; + case SDLK_RSHIFT: + strcpy(item->input, "Right Shift"); + break; + case SDLK_LSHIFT: + strcpy(item->input, "Left Shift"); + break; + case SDLK_RCTRL: + strcpy(item->input, "Right Control"); + break; + case SDLK_LCTRL: + strcpy(item->input, "Left Control"); + break; + case SDLK_RALT: + strcpy(item->input, "Right Alt"); + break; + case SDLK_LALT: + strcpy(item->input, "Left Alt"); + break; + default: + strcpy(item->input, (char*)item->int_p); + break; + } } /* Free a menu and all its items */ @@ -430,7 +426,7 @@ int menu_width, int menu_height) { - const MenuItem& pitem = item[index]; + MenuItem& pitem = item[index]; int font_width = 16; int effect_offset = 0; @@ -504,6 +500,9 @@ input_width + font_width, 18, 0,0,0,128); + if(pitem.kind == MN_CONTROLFIELD) + get_controlfield_key_into_input(&pitem); + gold_text->draw_align(pitem.input, x_pos + text_pos, y_pos, A_HMIDDLE, A_VMIDDLE, 2); @@ -642,7 +641,7 @@ if(item[active_item].kind == MN_CONTROLFIELD) { - item[active_item].set_controlfield_key(key, ch); + *item[active_item].int_p = key; menuaction = MENU_ACTION_DOWN; return; } Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.h,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- menu.h 22 Apr 2004 14:11:57 -0000 1.42 +++ menu.h 22 Apr 2004 18:39:52 -0000 1.43 @@ -59,8 +59,6 @@ void change_input(const char *text); static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu, int* int_p); - - void set_controlfield_key(SDLKey key, char ch[]); }; class Menu @@ -132,6 +130,8 @@ MenuItem& get_item(int index) { return item[index]; } + void Menu::get_controlfield_key_into_input(MenuItem *item); + void draw (); void draw_item(int index, int menu_width, int menu_height); void set_pos(int x, int y, float rw = 0, float rh = 0); |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:51:27
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5864/src Modified Files: badguy.cpp sound.cpp sound.h Log Message: Implemented explosion sound when Mr.Bomb explodes. It uses the current stereo system that is kinda of primitive. We should base it on player's coordinates and calculate it according it. Instead, it bases the screen, besides it is not even calculated, just use some constants. Index: sound.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- sound.cpp 22 Apr 2004 11:17:34 -0000 1.11 +++ sound.cpp 22 Apr 2004 21:51:19 -0000 1.12 @@ -47,7 +47,8 @@ "/sounds/shoot.wav", "/sounds/lifeup.wav", "/sounds/stomp.wav", - "/sounds/kick.wav" + "/sounds/kick.wav", + "/sounds/explode.wav" }; Index: sound.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sound.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- sound.h 21 Apr 2004 23:38:05 -0000 1.24 +++ sound.h 22 Apr 2004 21:51:19 -0000 1.25 @@ -67,6 +67,7 @@ SND_LIFEUP, SND_STOMP, SND_KICK, + SND_EXPLODE, NUM_SOUNDS }; Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- badguy.cpp 22 Apr 2004 19:53:17 -0000 1.48 +++ badguy.cpp 22 Apr 2004 21:51:19 -0000 1.49 @@ -481,6 +481,15 @@ set_sprite(img_mrbomb_explosion, img_mrbomb_explosion); dying = DYING_NOT; // now the bomb hurts timer.start(EXPLODETIME); + + /* 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); + else if (base.x > scroll_x + screen->w/2 + 10) + play_sound(sounds[SND_EXPLODE], SOUND_RIGHT_SPEAKER); + else + play_sound(sounds[SND_EXPLODE], SOUND_CENTER_SPEAKER); + } else if(mode == BOMB_EXPLODE) { remove_me(); return; |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:30:07
|
Update of /cvsroot/super-tux/supertux/data/sounds In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1280/data/sounds Added Files: explode.wav Log Message: Added an explotion sound file to repository. To be used by Mr Bomb, until someone replaces it by a better one ;) --- NEW FILE: explode.wav --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:27:46
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv799/data/images/shared Added Files: distro-0.png distro-1.png distro-2.png distro-3.png Log Message: Distros old images seems to be necessary by this BouncyDistro class in gameobjs.* ... Weird, what does that thing do anyway? --- NEW FILE: distro-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: distro-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: distro-3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: distro-2.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:26:40
|
Update of /cvsroot/super-tux/supertux/data/images/shared/old In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv577/data/images/shared/old Removed Files: distro-0-2.png distro-1-2.png distro-2-2.png distro-3-2.png Log Message: Distros old images seems to be necessary by this BouncyDistro class in gameobjs.* ... Weird, what does that thing do anyway? --- distro-3-2.png DELETED --- --- distro-0-2.png DELETED --- --- distro-2-2.png DELETED --- --- distro-1-2.png DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:24:43
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32651/src Modified Files: resources.cpp resources.h Log Message: Removed box_full and box_empty from this. They are now implemented as tiles. Index: resources.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- resources.h 20 Apr 2004 11:09:34 -0000 1.6 +++ resources.h 22 Apr 2004 21:24:31 -0000 1.7 @@ -29,8 +29,6 @@ extern Surface* img_flag[2]; extern Surface* img_cloud[2][4]; -extern Surface* img_box_full; -extern Surface* img_box_empty; extern Surface* img_super_bkgd; extern Surface* img_red_glow; Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- resources.cpp 22 Apr 2004 19:40:41 -0000 1.17 +++ resources.cpp 22 Apr 2004 21:24:29 -0000 1.18 @@ -34,8 +34,6 @@ Surface* img_flag[2]; Surface* img_cloud[2][4]; -Surface* img_box_full; -Surface* img_box_empty; Surface* img_red_glow; SpriteManager* sprite_manager = 0; @@ -184,14 +182,6 @@ USE_ALPHA); - /* Boxes: */ - - img_box_full = new Surface(datadir + "/images/shared/box-full.png", - IGNORE_ALPHA); - img_box_empty = new Surface(datadir + "/images/shared/box-empty.png", - IGNORE_ALPHA); - - /* Water: */ @@ -334,9 +324,6 @@ free_badguy_gfx(); - delete img_box_full; - delete img_box_empty; - delete img_water; for (i = 0; i < 3; i++) delete img_waves[i]; |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:07:11
|
Update of /cvsroot/super-tux/supertux/data/images/shared/old In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28663/data/images/shared/old Added Files: box-empty.png box-full2.png distro-0-2.png distro-1-2.png distro-2-2.png distro-3-2.png Log Message: Moving a few not used images to old dir. --- NEW FILE: distro-3-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: box-empty.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: distro-1-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: box-full2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: distro-0-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: distro-2-2.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-22 21:05:37
|
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28340/data/images/shared Removed Files: box-empty.png box-full.png distro-0.png distro-1.png distro-2.png distro-3.png Log Message: Moving not used images to old dir. --- box-full.png DELETED --- --- box-empty.png DELETED --- --- distro-1.png DELETED --- --- distro-0.png DELETED --- --- distro-3.png DELETED --- --- distro-2.png DELETED --- |
From: Ricardo C. <rm...@us...> - 2004-04-22 20:58:17
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26758/data Modified Files: supertux.strf Log Message: Removed a few entries from the sprites config file (supertux.strf). Index: supertux.strf =================================================================== RCS file: /cvsroot/super-tux/supertux/data/supertux.strf,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- supertux.strf 22 Apr 2004 20:16:45 -0000 1.14 +++ supertux.strf 22 Apr 2004 20:58:05 -0000 1.15 @@ -11,23 +11,6 @@ "shared/smalltux-right-6.png" "shared/smalltux-right-7.png" "shared/smalltux-right-8.png")) - (sprite (name "bsod-left") - (images "shared/bsod-left-0.png" - "shared/bsod-left-1.png" - "shared/bsod-left-2.png" - "shared/bsod-left-3.png")) - - (sprite (name "bsod-right") - (images "shared/bsod-right-0.png" - "shared/bsod-right-1.png" - "shared/bsod-right-2.png" - "shared/bsod-right-3.png")) - - (sprite (name "bsod-squished-left") - (images "shared/bsod-squished-left.png")) - - (sprite (name "bsod-squished-right") - (images "shared/bsod-squished-right.png")) (sprite (name "snowball-squished-left") (x-hotspot 1) @@ -39,44 +22,6 @@ (y-hotspot -19) (images "shared/snowball-squished-right.png")) - (sprite (name "bsod-falling-left") - (images "shared/bsod-falling-left.png")) - - (sprite (name "bsod-falling-right") - (images "shared/bsod-falling-right.png")) - - (sprite (name "laptop-left") - (x-hotspot 2) - (y-hotspot 3) - (images "shared/mriceblock-left-0.png" - "shared/mriceblock-left-1.png" - "shared/mriceblock-left-2.png" - "shared/mriceblock-left-1.png")) - - (sprite (name "laptop-right") - (x-hotspot 2) - (y-hotspot 3) - (images "shared/mriceblock-right-0.png" - "shared/mriceblock-right-1.png" - "shared/mriceblock-right-2.png" - "shared/mriceblock-right-1.png")) - - (sprite (name "laptop-flat-left") - (x-hotspot 2) - (y-hotspot 3) - (images "shared/mriceblock-flat-left.png")) - - (sprite (name "laptop-flat-right") - (x-hotspot 2) - (y-hotspot 3) - (images "shared/mriceblock-flat-right.png")) - - (sprite (name "laptop-falling-left") - (images "shared/laptop-falling-left.png")) - - (sprite (name "laptop-falling-right") - (images "shared/laptop-falling-right.png")) - (sprite (name "jumpy-left-up") (x-hotspot 7) (y-hotspot 8) |
Update of /cvsroot/super-tux/supertux/data/images/shared In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26544/data/images/shared Removed Files: bag-left-0.png bag-left-1.png bag-right-0.png bag-right-1.png bigtux-left-0.png bigtux-left-1.png bigtux-left-2.png bigtux-left-jump.png bigtux-right-0.png bigtux-right-1.png bigtux-right-2.png bigtux-right-jump.png bsod-falling-left.png bsod-falling-right.png bsod-left-0.png bsod-left-1.png bsod-left-2.png bsod-left-3.png bsod-right-0.png bsod-right-1.png bsod-right-2.png bsod-right-3.png bsod-squished-left.png bsod-squished-right.png golden-herring.png laptop-falling-left.png laptop-falling-right.png laptop-flat-left.png laptop-flat-right.png laptop-left-0.png laptop-left-1.png laptop-left-2.png laptop-right-0.png laptop-right-1.png laptop-right-2.png mints.png skidtux-left.png skidtux-right.png tux-left-0.png tux-left-1.png tux-left-2.png tux-right-0.png tux-right-1.png tux-right-2.png Log Message: Moving a few images that are not used anymore from shared to the old directory. --- bigtux-left-0.png DELETED --- --- laptop-right-0.png DELETED --- --- bsod-squished-left.png DELETED --- --- laptop-falling-left.png DELETED --- --- bag-right-1.png DELETED --- --- bigtux-left-jump.png DELETED --- --- tux-right-0.png DELETED --- --- laptop-left-1.png DELETED --- --- tux-right-2.png DELETED --- --- bsod-left-1.png DELETED --- --- laptop-flat-left.png DELETED --- --- laptop-flat-right.png DELETED --- --- bigtux-right-2.png DELETED --- --- laptop-right-2.png DELETED --- --- bigtux-left-2.png DELETED --- --- golden-herring.png DELETED --- --- skidtux-left.png DELETED --- --- bag-right-0.png DELETED --- --- tux-left-1.png DELETED --- --- tux-left-2.png DELETED --- --- bsod-squished-right.png DELETED --- --- bigtux-right-1.png DELETED --- --- laptop-falling-right.png DELETED --- --- bsod-right-1.png DELETED --- --- bsod-right-0.png DELETED --- --- bsod-right-3.png DELETED --- --- bigtux-right-0.png DELETED --- --- tux-right-1.png DELETED --- --- bigtux-right-jump.png DELETED --- --- mints.png DELETED --- --- tux-left-0.png DELETED --- --- bag-left-0.png DELETED --- --- bag-left-1.png DELETED --- --- bsod-left-0.png DELETED --- --- bsod-left-2.png DELETED --- --- bigtux-left-1.png DELETED --- --- laptop-right-1.png DELETED --- --- bsod-right-2.png DELETED --- --- bsod-falling-right.png DELETED --- --- bsod-falling-left.png DELETED --- --- skidtux-right.png DELETED --- --- laptop-left-2.png DELETED --- --- laptop-left-0.png DELETED --- --- bsod-left-3.png DELETED --- |
Update of /cvsroot/super-tux/supertux/data/images/shared/old In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26169/data/images/shared/old Added Files: bag-left-0.png bag-left-1.png bag-right-0.png bag-right-1.png bigtux-left-0.png bigtux-left-1.png bigtux-left-2.png bigtux-left-jump.png bigtux-right-0.png bigtux-right-1.png bigtux-right-2.png bigtux-right-jump.png bsod-falling-left.png bsod-falling-right.png bsod-left-0.png bsod-left-1.png bsod-left-2.png bsod-left-3.png bsod-right-0.png bsod-right-1.png bsod-right-2.png bsod-right-3.png bsod-squished-left.png bsod-squished-right.png golden-herring.png laptop-falling-left.png laptop-falling-right.png laptop-flat-left.png laptop-flat-right.png laptop-left-0.png laptop-left-1.png laptop-left-2.png laptop-right-0.png laptop-right-1.png laptop-right-2.png skidtux-left.png skidtux-right.png tux-left-0.png tux-left-1.png tux-left-2.png tux-right-0.png tux-right-1.png tux-right-2.png Log Message: Moving a few images that are not used anymore from shared to the old directory. --- NEW FILE: bigtux-left-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-right-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-squished-left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-falling-left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bag-right-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-left-jump.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tux-right-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-left-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tux-right-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-left-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-flat-left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-flat-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-right-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-right-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-left-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: golden-herring.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: skidtux-left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bag-right-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tux-left-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tux-left-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-squished-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-right-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-falling-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-right-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-right-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-right-3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-right-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tux-right-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-right-jump.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tux-left-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bag-left-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bag-left-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-left-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-left-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bigtux-left-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-right-1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-right-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-falling-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-falling-left.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: skidtux-right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-left-2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: laptop-left-0.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: bsod-left-3.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-04-22 20:45:31
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23902/src Modified Files: setup.cpp Log Message: Just moved the Right with the Left entry in Controls. I'm so used to define the Left key firstly... :) Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/setup.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- setup.cpp 22 Apr 2004 11:26:39 -0000 1.48 +++ setup.cpp 22 Apr 2004 20:45:22 -0000 1.49 @@ -407,8 +407,8 @@ options_controls_menu->additem(MN_LABEL,"Controls",0,0); options_controls_menu->additem(MN_HL,"",0,0); - options_controls_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); options_controls_menu->additem(MN_CONTROLFIELD,"Left move", 0,0, &keymap.left); + options_controls_menu->additem(MN_CONTROLFIELD,"Right move", 0,0, &keymap.right); options_controls_menu->additem(MN_CONTROLFIELD,"Jump", 0,0, &keymap.jump); options_controls_menu->additem(MN_CONTROLFIELD,"Duck", 0,0, &keymap.duck); options_controls_menu->additem(MN_CONTROLFIELD,"Power", 0,0, &keymap.fire); |
From: Ricardo C. <rm...@us...> - 2004-04-22 20:44:20
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23617/src Modified Files: menu.cpp Log Message: If you press Esc in the control menu, it quits from there. Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/menu.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -u -d -r1.49 -r1.50 --- menu.cpp 22 Apr 2004 18:39:52 -0000 1.49 +++ menu.cpp 22 Apr 2004 20:44:11 -0000 1.50 @@ -641,6 +641,11 @@ if(item[active_item].kind == MN_CONTROLFIELD) { + if(key == SDLK_ESCAPE) + { + Menu::pop_current(); + return; + } *item[active_item].int_p = key; menuaction = MENU_ACTION_DOWN; return; |
From: Ricardo C. <rm...@us...> - 2004-04-22 20:41:50
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22872/src Modified Files: defines.h scene.cpp worldmap.cpp Log Message: Made a START_LIVES definition (in defines.h) that has the lives that the players start with. i have made them to be 4, since the worldmap is so hard... Index: scene.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/scene.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- scene.cpp 21 Apr 2004 23:38:03 -0000 1.23 +++ scene.cpp 22 Apr 2004 20:41:40 -0000 1.24 @@ -19,13 +19,14 @@ #include <stdlib.h> #include "scene.h" +#include "defines.h" PlayerStatus player_status; PlayerStatus::PlayerStatus() : score(0), distros(0), - lives(3), + lives(START_LIVES), score_multiplier(1) { } Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- defines.h 22 Apr 2004 20:14:33 -0000 1.22 +++ defines.h 22 Apr 2004 20:41:39 -0000 1.23 @@ -65,6 +65,10 @@ #define RUN_SPEED 1.5 #define JUMP_SPEED 1.2 +/* gameplay related defines */ + +#define START_LIVES 4 + #define MAX_BULLETS 1 #define GRAVITY 1.0 Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- worldmap.cpp 22 Apr 2004 11:17:34 -0000 1.43 +++ worldmap.cpp 22 Apr 2004 20:41:40 -0000 1.44 @@ -820,7 +820,7 @@ reader.read_int("distros", &player_status.distros); if (player_status.lives < 0) - player_status.lives = 3; + player_status.lives = START_LIVES; lisp_object_t* tux_cur = 0; if (reader.read_lisp("tux", &tux_cur)) |
From: Ingo R. <gr...@us...> - 2004-04-22 20:16:54
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16668 Modified Files: supertux.strf Log Message: fixed squish sprite Index: supertux.strf =================================================================== RCS file: /cvsroot/super-tux/supertux/data/supertux.strf,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- supertux.strf 22 Apr 2004 16:45:15 -0000 1.13 +++ supertux.strf 22 Apr 2004 20:16:45 -0000 1.14 @@ -176,7 +176,7 @@ (sprite (name "bouncingsnowball-squished") (x-hotspot 1) (y-hotspot -19) - (images "shared/bsod-squished-left.png")) + (images "shared/snowball-squished-left.png")) (sprite (name "flyingsnowball") (x-hotspot 4) |
From: Ingo R. <gr...@us...> - 2004-04-22 20:14:58
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16213 Modified Files: defines.h gameloop.cpp player.cpp player.h special.cpp Log Message: - made shrink behaviour more mariobros3 like, ie. firetux will go to largetux to smalltux, removed small-firetux Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- player.cpp 22 Apr 2004 19:15:22 -0000 1.55 +++ player.cpp 22 Apr 2004 20:14:49 -0000 1.56 @@ -527,55 +527,39 @@ cape_left[global_frame_counter % 2]->draw(base.x- scroll_x, base.y); } - if (!got_coffee) + if (!skidding_timer.started()) { - if (!skidding_timer.started()) + if (physic.get_velocity_y() != 0) { - if (physic.get_velocity_y() != 0) + if (dir == RIGHT) + smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); + else + smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); + } + else + { + if (fabsf(physic.get_velocity_x()) < 1.0f) // standing { if (dir == RIGHT) - smalltux_jump_right->draw( base.x - scroll_x, base.y - 10); + smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); else - smalltux_jump_left->draw( base.x - scroll_x, base.y - 10); + smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); } - else + else // moving { - if (fabsf(physic.get_velocity_x()) < 1.0f) // standing - { - if (dir == RIGHT) - smalltux_stand_right->draw( base.x - scroll_x, base.y - 9); - else - smalltux_stand_left->draw( base.x - scroll_x, base.y - 9); - } - else // moving - { - if (dir == RIGHT) - tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9); - else - tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9); - } + if (dir == RIGHT) + tux_right[(global_frame_counter/2) % tux_right.size()]->draw(base.x - scroll_x, base.y - 9); + else + tux_left[(global_frame_counter/2) % tux_left.size()]->draw(base.x - scroll_x, base.y - 9); } } - else - { - if (dir == RIGHT) - smalltux_skid_right->draw(base.x - scroll_x, base.y); - else - smalltux_skid_left->draw(base.x - scroll_x, base.y); - } } else { - /* Tux got coffee! */ - if (dir == RIGHT) - { - firetux_right[frame_]->draw( base.x- scroll_x, base.y); - } + smalltux_skid_right->draw(base.x - scroll_x, base.y); else - { - firetux_left[frame_]->draw( base.x- scroll_x, base.y); - } + smalltux_skid_left->draw(base.x - scroll_x, base.y); } } else // Large Tux @@ -749,7 +733,7 @@ /* Kill Player! */ void -Player::kill(int mode) +Player::kill(HurtMode mode) { play_sound(sounds[SND_HURT], SOUND_CENTER_SPEAKER); @@ -758,12 +742,15 @@ if (mode == SHRINK && size == BIG) { if (got_coffee) - got_coffee = false; - - size = SMALL; - base.height = 32; - duck = false; - + { + got_coffee = false; + } + else + { + size = SMALL; + base.height = 32; + duck = false; + } safe_timer.start(TUX_SAFE_TIME); } else Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- player.h 22 Apr 2004 16:25:32 -0000 1.35 +++ player.h 22 Apr 2004 20:14:49 -0000 1.36 @@ -112,6 +112,8 @@ class Player { public: + enum HurtMode { KILL, SHRINK }; + player_input_type input; bool got_coffee; int size; @@ -142,7 +144,7 @@ void grabdistros(); void draw(); void collision(void* p_c_object, int c_object); - void kill(int mode); + void kill(HurtMode mode); void is_dying(); bool is_dead(); void player_remove_powerups(); Index: defines.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/defines.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- defines.h 22 Apr 2004 17:38:56 -0000 1.21 +++ defines.h 22 Apr 2004 20:14:33 -0000 1.22 @@ -48,11 +48,6 @@ DYING_FALLING = 2 }; -/* Hurt modes: */ - -#define KILL 0 -#define SHRINK 1 - /* Sizes: */ #define SMALL 0 Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.94 retrieving revision 1.95 diff -u -d -r1.94 -r1.95 --- gameloop.cpp 22 Apr 2004 11:17:34 -0000 1.94 +++ gameloop.cpp 22 Apr 2004 20:14:33 -0000 1.95 @@ -555,7 +555,7 @@ /* Handle time: */ if (!time_left.check() && world->get_tux()->dying == DYING_NOT) - world->get_tux()->kill(KILL); + world->get_tux()->kill(Player::KILL); /* Handle music: */ if(world->get_tux()->invincible_timer.check()) Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- special.cpp 22 Apr 2004 19:15:22 -0000 1.25 +++ special.cpp 22 Apr 2004 20:14:49 -0000 1.26 @@ -306,6 +306,15 @@ { play_sound(sounds[SND_COFFEE], SOUND_CENTER_SPEAKER); pplayer->got_coffee = true; + pplayer->size = BIG; + pplayer->base.height = 64; + pplayer->base.y -= 32; + if(collision_object_map(pplayer->base)) + { + pplayer->base.height = 32; + pplayer->base.y += 32; + pplayer->duck = true; + } } else if (kind == UPGRADE_HERRING) { |
From: Ingo R. <gr...@us...> - 2004-04-22 19:53:26
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10486 Modified Files: badguy.cpp Log Message: - changed bouncing snowball speed back to normal Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- badguy.cpp 22 Apr 2004 19:15:21 -0000 1.47 +++ badguy.cpp 22 Apr 2004 19:53:17 -0000 1.48 @@ -187,7 +187,7 @@ physic.enable_gravity(false); set_sprite(img_flame, img_flame); } else if(kind == BAD_BOUNCINGSNOWBALL) { - physic.set_velocity(-BADGUY_WALK_SPEED, 0); + physic.set_velocity(-1.3, 0); set_sprite(img_bouncingsnowball_left, img_bouncingsnowball_right); } else if(kind == BAD_STALACTITE) { physic.enable_gravity(false); |
From: Ingo R. <gr...@us...> - 2004-04-22 19:40:53
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7127 Modified Files: resources.cpp Log Message: - integrated skid tux Index: resources.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/resources.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- resources.cpp 22 Apr 2004 16:25:32 -0000 1.16 +++ resources.cpp 22 Apr 2004 19:40:41 -0000 1.17 @@ -160,11 +160,11 @@ ducktux_right = sprite_manager->load("largetux-duck-right"); skidtux_right = new Surface(datadir + - "/images/shared/skidtux-right.png", + "/images/shared/largetux-skid-right.png", USE_ALPHA); skidtux_left = new Surface(datadir + - "/images/shared/skidtux-left.png", + "/images/shared/largetux-skid-left.png", USE_ALPHA); duckfiretux_right = new Surface(datadir + |
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1067 Modified Files: badguy.cpp badguy.h collision.cpp collision.h leveleditor.cpp player.cpp special.cpp world.cpp world.h Log Message: - changed way badguy removal is handled (ie. with a flag now) - changed some pointers to const references in collision code Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- world.h 22 Apr 2004 17:53:08 -0000 1.29 +++ world.h 22 Apr 2004 19:15:22 -0000 1.30 @@ -38,7 +38,9 @@ class World { private: - std::vector<BadGuy*> bad_guys; + typedef std::list<BadGuy*> BadGuys; + BadGuys bad_guys; + BadGuys bad_guys_to_add; Level* level; Player tux; @@ -93,7 +95,6 @@ void add_bouncy_brick(float x, float y); BadGuy* add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform = false); - void remove_bad_guy(BadGuy* badguy); void add_upgrade(float x, float y, Direction dir, UpgradeKind kind); void add_bullet(float x, float y, float xm, Direction dir); Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/collision.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- collision.cpp 20 Apr 2004 11:09:33 -0000 1.16 +++ collision.cpp 22 Apr 2004 19:15:22 -0000 1.17 @@ -26,53 +26,53 @@ #include "level.h" #include "tile.h" -bool rectcollision(base_type* one, base_type* two) +bool rectcollision(const base_type& one, const base_type& two) { - return (one->x >= two->x - one->width + 1 && - one->x <= two->x + two->width - 1 && - one->y >= two->y - one->height + 1 && - one->y <= two->y + two->height - 1); + return (one.x >= two.x - one.width + 1 && + one.x <= two.x + two.width - 1 && + one.y >= two.y - one.height + 1 && + one.y <= two.y + two.height - 1); } -bool rectcollision_offset(base_type* one, base_type* two, float off_x, float off_y) +bool rectcollision_offset(const base_type& one, const base_type& two, float off_x, float off_y) { - return (one->x >= two->x - one->width +off_x + 1 && - one->x <= two->x + two->width + off_x - 1 && - one->y >= two->y - one->height + off_y + 1 && - one->y <= two->y + two->height + off_y - 1); + return (one.x >= two.x - one.width + off_x + 1 && + one.x <= two.x + two.width + off_x - 1 && + one.y >= two.y - one.height + off_y + 1 && + one.y <= two.y + two.height + off_y - 1); } -bool collision_object_map(base_type* pbase) +bool collision_object_map(const base_type& pbase) { - int v = (int)pbase->height / 16; - int h = (int)pbase->width / 16; + int v = (int)pbase.height / 16; + int h = (int)pbase.width / 16; - if(issolid(pbase->x + 1, pbase->y + 1) || - issolid(pbase->x + pbase->width -1, pbase->y + 1) || - issolid(pbase->x +1, pbase->y + pbase->height -1) || - issolid(pbase->x + pbase->width -1, pbase->y + pbase->height - 1)) + if(issolid(pbase.x + 1, pbase.y + 1) || + issolid(pbase.x + pbase.width -1, pbase.y + 1) || + issolid(pbase.x +1, pbase.y + pbase.height -1) || + issolid(pbase.x + pbase.width -1, pbase.y + pbase.height - 1)) return true; for(int i = 1; i < h; ++i) { - if(issolid(pbase->x + i*16,pbase->y + 1)) + if(issolid(pbase.x + i*16,pbase.y + 1)) return true; } for(int i = 1; i < h; ++i) { - if( issolid(pbase->x + i*16,pbase->y + pbase->height - 1)) + if( issolid(pbase.x + i*16,pbase.y + pbase.height - 1)) return true; } for(int i = 1; i < v; ++i) { - if( issolid(pbase->x + 1, pbase->y + i*16)) + if( issolid(pbase.x + 1, pbase.y + i*16)) return true; } for(int i = 1; i < v; ++i) { - if( issolid(pbase->x + pbase->width - 1, pbase->y + i*16)) + if( issolid(pbase.x + pbase.width - 1, pbase.y + i*16)) return true; } @@ -155,18 +155,18 @@ steps--; } - if(collision_object_map(old)) + if(collision_object_map(*old)) { switch(h) { case 1: current->y = old->y - yd; - while(collision_object_map(current)) + while(collision_object_map(*current)) current->y -= yd; break; case 2: current->x = old->x - xd; - while(collision_object_map(current)) + while(collision_object_map(*current)) current->x -= xd; break; case 3: @@ -174,7 +174,7 @@ yt = current->y; current->x = old->x - xd; current->y = old->y - yd; - while(collision_object_map(current)) + while(collision_object_map(*current)) { current->x -= xd; current->y -= yd; @@ -182,20 +182,20 @@ temp = current->x; current->x = xt; - if(!collision_object_map(current)) + if(!collision_object_map(*current)) break; current->x = temp; temp = current->y; current->y = yt; - if(!collision_object_map(current)) + if(!collision_object_map(*current)) { break; } else { current->y = temp; - while(!collision_object_map(current)) + while(!collision_object_map(*current)) current->y += yd; current->y -= yd; break; Index: badguy.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.h,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- badguy.h 22 Apr 2004 15:52:47 -0000 1.32 +++ badguy.h 22 Apr 2004 19:15:22 -0000 1.33 @@ -112,6 +112,7 @@ Direction dir; private: + bool removable; bool seen; base_type old_base; Timer timer; @@ -123,7 +124,7 @@ int animation_offset; public: - void init(float x, float y, BadGuyKind kind, bool stay_on_platform); + BadGuy(float x, float y, BadGuyKind kind, bool stay_on_platform); void action(float frame_ratio); void draw(); @@ -135,7 +136,14 @@ * screen. Some badguys like the flame might ignore this. */ void kill_me(); - + + /** remove ourself from the list of badguys. WARNING! This function will + * invalidate all members. So don't do anything else with member after calling + * this. + */ + void remove_me(); + bool is_removable() const { return removable; } + private: void action_bsod(float frame_ratio); void action_laptop(float frame_ratio); @@ -153,13 +161,10 @@ /** handles falling down. disables gravity calculation when we're back on * ground */ void fall(); - /** remove ourself from the list of badguys. WARNING! This function will - * invalidate all members. So don't do anything else with member after calling - * this. - */ - void remove_me(); + /** let the player jump a bit (used when you hit a badguy) */ void make_player_jump(Player* player); + /** check if we're running left or right in a wall and eventually change * direction */ Index: collision.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/collision.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- collision.h 20 Apr 2004 11:09:33 -0000 1.9 +++ collision.h 22 Apr 2004 19:15:22 -0000 1.10 @@ -40,11 +40,11 @@ COLLISION_SQUISH }; -bool rectcollision(base_type* one, base_type* two); -bool rectcollision_offset(base_type* one, base_type* two, float off_x, float off_y); +bool rectcollision(const base_type& one, const base_type& two); +bool rectcollision_offset(const base_type& one, const base_type& two, float off_x, float off_y); void collision_swept_object_map(base_type* old, base_type* current); -bool collision_object_map(base_type* object); +bool collision_object_map(const base_type& object); /** Return a pointer to the tile at the given x/y coordinates */ Tile* gettile(float x, float y); Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- leveleditor.cpp 20 Apr 2004 20:10:49 -0000 1.61 +++ leveleditor.cpp 22 Apr 2004 19:15:22 -0000 1.62 @@ -92,10 +92,7 @@ void add_bad_guy(float x, float y, BadGuyKind kind) { - bad_guys.push_back(BadGuy()); - BadGuy& new_bad_guy = bad_guys.back(); - - new_bad_guy.init(x,y,kind, false /* stay_on_platform */); + bad_guys.push_back(BadGuy(x,y,kind, false /* stay_on_platform */)); } void activate_bad_guys() Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -u -d -r1.54 -r1.55 --- player.cpp 22 Apr 2004 16:25:24 -0000 1.54 +++ player.cpp 22 Apr 2004 19:15:22 -0000 1.55 @@ -203,10 +203,11 @@ // special exception for cases where we're stuck under tiles after // being ducked. In this case we drift out if(!duck && on_ground() && old_base.x == base.x && old_base.y == base.y - && collision_object_map(&base)) { - base.x += frame_ratio * WALK_SPEED * (dir ? 1 : -1); - previous_base = old_base = base; - } + && collision_object_map(base)) + { + base.x += frame_ratio * WALK_SPEED * (dir ? 1 : -1); + previous_base = old_base = base; + } keep_in_bounds(); // Land: Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- badguy.cpp 22 Apr 2004 17:53:08 -0000 1.46 +++ badguy.cpp 22 Apr 2004 19:15:21 -0000 1.47 @@ -145,8 +145,8 @@ } } -void -BadGuy::init(float x, float y, BadGuyKind kind_, bool stay_on_platform_) +BadGuy::BadGuy(float x, float y, BadGuyKind kind_, bool stay_on_platform_) + : removable(false) { base.x = x; base.y = y; @@ -207,9 +207,9 @@ } // if we're in a solid tile at start correct that now - if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(&base)) { + if(kind != BAD_FLAME && kind != BAD_FISH && collision_object_map(base)) { printf("Warning: badguy started in wall!.\n"); - while(collision_object_map(&base)) + while(collision_object_map(base)) --base.y; } } @@ -276,7 +276,7 @@ base.x = tux.base.x - 16; base.y = tux.base.y + tux.base.height/1.5 - base.height; } - if(collision_object_map(&base)) + if(collision_object_map(base)) { base.x = tux.base.x; base.y = tux.base.y + tux.base.height/1.5 - base.height; @@ -408,7 +408,7 @@ void BadGuy::remove_me() { - World::current()->remove_bad_guy(this); + removable = true; } void @@ -856,7 +856,7 @@ World::current()->add_score(base.x - scroll_x, base.y, 50 * player_status.score_multiplier); play_sound(sounds[SND_SQUISH], SOUND_CENTER_SPEAKER); player_status.score_multiplier++; - remove_me(); + remove_me(); return; } else if(kind == BAD_BSOD) { @@ -960,6 +960,7 @@ bump(); return; } + if(type == COLLISION_SQUISH) { Player* player = static_cast<Player*>(p_c_object); squish(player); Index: special.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/special.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- special.cpp 21 Apr 2004 23:38:07 -0000 1.24 +++ special.cpp 22 Apr 2004 19:15:22 -0000 1.25 @@ -295,7 +295,7 @@ pplayer->size = BIG; pplayer->base.height = 64; pplayer->base.y -= 32; - if(collision_object_map(&pplayer->base)) + if(collision_object_map(pplayer->base)) { pplayer->base.height = 32; pplayer->base.y += 32; Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- world.cpp 22 Apr 2004 17:53:08 -0000 1.38 +++ world.cpp 22 Apr 2004 19:15:22 -0000 1.39 @@ -20,6 +20,7 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. +#include <iostream> #include <math.h> #include <stdlib.h> #include <string.h> @@ -72,11 +73,9 @@ World::~World() { - for (unsigned int i = 0; i < bad_guys.size(); ++i) - { - delete bad_guys[i]; - } - + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) + delete *i; + halt_music(); // just to be sure (because levelmusic is freed now) delete level; } @@ -172,8 +171,8 @@ for (unsigned int i = 0; i < bouncy_bricks.size(); ++i) bouncy_bricks[i].draw(); - for (unsigned int i = 0; i < bad_guys.size(); ++i) - bad_guys[i]->draw(); + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) + (*i)->draw(); tux.draw(); @@ -244,8 +243,8 @@ for (unsigned int i = 0; i < upgrades.size(); i++) upgrades[i].action(frame_ratio); - for (unsigned int i = 0; i < bad_guys.size(); i++) - bad_guys[i]->action(frame_ratio); + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) + (*i)->action(frame_ratio); /* update particle systems */ std::vector<ParticleSystem*>::iterator p; @@ -256,26 +255,33 @@ /* Handle all possible collisions. */ collision_handler(); + + { // Cleanup marked badguys + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) + if ((*i)->is_removable()) + delete *i; + bad_guys.remove_if(std::mem_fun(&BadGuy::is_removable)); + } } - void World::collision_handler() { // CO_BULLET & CO_BADGUY check for(unsigned int i = 0; i < bullets.size(); ++i) { - for(unsigned int j = 0; j < bad_guys.size(); ++j) + for (BadGuys::iterator j = bad_guys.begin(); j != bad_guys.end(); ++j) { - if(bad_guys[j]->dying != DYING_NOT) + if((*j)->dying != DYING_NOT) continue; - if(rectcollision(&bullets[i].base, &bad_guys[j]->base)) + + if(rectcollision(bullets[i].base, (*j)->base)) { // We have detected a collision and now call the // collision functions of the collided objects. // collide with bad_guy first, since bullet_collision will // delete the bullet - bad_guys[j]->collision(0, CO_BULLET); + (*j)->collision(0, CO_BULLET); bullets[i].collision(CO_BADGUY); break; // bullet is invalid now, so break } @@ -283,22 +289,24 @@ } /* CO_BADGUY & CO_BADGUY check */ - for(unsigned int i = 0; i < bad_guys.size(); ++i) + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) { - if(bad_guys[i]->dying != DYING_NOT) + if((*i)->dying != DYING_NOT) continue; - for(unsigned int j = i+1; j < bad_guys.size(); ++j) + BadGuys::iterator j = i; + ++j; + for (; j != bad_guys.end(); ++j) { - if(j == i || bad_guys[j]->dying != DYING_NOT) + if(j == i || (*j)->dying != DYING_NOT) continue; - if(rectcollision(&bad_guys[i]->base, &bad_guys[j]->base)) + if(rectcollision((*i)->base, (*j)->base)) { // We have detected a collision and now call the // collision functions of the collided objects. - bad_guys[j]->collision(&bad_guys[i], CO_BADGUY); - bad_guys[i]->collision(&bad_guys[j], CO_BADGUY); + (*j)->collision(*i, CO_BADGUY); + (*i)->collision(*j, CO_BADGUY); } } } @@ -306,25 +314,25 @@ if(tux.dying != DYING_NOT) return; // CO_BADGUY & CO_PLAYER check - for(unsigned int i = 0; i < bad_guys.size(); ++i) + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) { - if(bad_guys[i]->dying != DYING_NOT) + if((*i)->dying != DYING_NOT) continue; - if(rectcollision_offset(&bad_guys[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 - < bad_guys[i]->base.y + bad_guys[i]->base.height/2) + < (*i)->base.y + (*i)->base.height/2) { - bad_guys[i]->collision(&tux, CO_PLAYER, COLLISION_SQUISH); + (*i)->collision(&tux, CO_PLAYER, COLLISION_SQUISH); } else { - tux.collision(&bad_guys[i], CO_BADGUY); - bad_guys[i]->collision(&tux, CO_PLAYER, COLLISION_NORMAL); + tux.collision(*i, CO_BADGUY); + (*i)->collision(&tux, CO_PLAYER, COLLISION_NORMAL); } } } @@ -332,7 +340,7 @@ // 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. @@ -388,26 +396,9 @@ BadGuy* World::add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform) { - bad_guys.push_back(new BadGuy()); - BadGuy* new_bad_guy = bad_guys.back(); - - new_bad_guy->init(x,y,kind, stay_on_platform); - return new_bad_guy; -} - -void -World::remove_bad_guy(BadGuy* badguy) -{ - for(std::vector<BadGuy*>::iterator i = bad_guys.begin(); - i != bad_guys.end(); ++i) - { - if(*i == badguy) - { - World::current()->bad_guys.erase(i); - delete badguy; - return; - } - } + BadGuy* badguy = new BadGuy(x,y,kind, stay_on_platform); + bad_guys.push_back(badguy); + return badguy; } void @@ -576,12 +567,12 @@ World::trybumpbadguy(float x, float y) { // Bad guys: - for (unsigned int i = 0; i < bad_guys.size(); i++) + for (BadGuys::iterator i = bad_guys.begin(); i != bad_guys.end(); ++i) { - if (bad_guys[i]->base.x >= x - 32 && bad_guys[i]->base.x <= x + 32 && - bad_guys[i]->base.y >= y - 16 && bad_guys[i]->base.y <= y + 16) + if ((*i)->base.x >= x - 32 && (*i)->base.x <= x + 32 && + (*i)->base.y >= y - 16 && (*i)->base.y <= y + 16) { - bad_guys[i]->collision(&tux, CO_PLAYER, COLLISION_BUMP); + (*i)->collision(&tux, CO_PLAYER, COLLISION_BUMP); } } |
From: Ingo R. <gr...@us...> - 2004-04-22 17:53:17
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14829 Modified Files: badguy.cpp world.cpp world.h Log Message: - made some arrays private - store badguys in pointers instead of per value Index: world.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.h,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- world.h 21 Apr 2004 23:38:13 -0000 1.28 +++ world.h 22 Apr 2004 17:53:08 -0000 1.29 @@ -37,28 +37,27 @@ bouncy distros, etc) that are needed to run a game. */ class World { - public: +private: + std::vector<BadGuy*> bad_guys; Level* level; - Player tux; - + + int distro_counter; + bool counting_distros; + int currentmusic; + + static World* current_; +public: std::vector<BouncyDistro> bouncy_distros; std::vector<BrokenBrick> broken_bricks; std::vector<BouncyBrick> bouncy_bricks; std::vector<FloatingScore> floating_scores; - std::vector<BadGuy> bad_guys; std::vector<Upgrade> upgrades; std::vector<Bullet> bullets; std::vector<ParticleSystem*> particle_systems; - int distro_counter; - bool counting_distros; - - int currentmusic; - - static World* current_; - public: +public: static World* current() { return current_; } static void set_current(World* w) { current_ = w; } @@ -92,7 +91,10 @@ 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_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform = false); + + BadGuy* add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform = false); + void remove_bad_guy(BadGuy* badguy); + void add_upgrade(float x, float y, Direction dir, UpgradeKind kind); void add_bullet(float x, float y, float xm, Direction dir); Index: world.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/world.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- world.cpp 22 Apr 2004 13:24:15 -0000 1.37 +++ world.cpp 22 Apr 2004 17:53:08 -0000 1.38 @@ -72,6 +72,11 @@ World::~World() { + for (unsigned int i = 0; i < bad_guys.size(); ++i) + { + delete bad_guys[i]; + } + halt_music(); // just to be sure (because levelmusic is freed now) delete level; } @@ -168,7 +173,7 @@ bouncy_bricks[i].draw(); for (unsigned int i = 0; i < bad_guys.size(); ++i) - bad_guys[i].draw(); + bad_guys[i]->draw(); tux.draw(); @@ -240,7 +245,7 @@ upgrades[i].action(frame_ratio); for (unsigned int i = 0; i < bad_guys.size(); i++) - bad_guys[i].action(frame_ratio); + bad_guys[i]->action(frame_ratio); /* update particle systems */ std::vector<ParticleSystem*>::iterator p; @@ -262,15 +267,15 @@ { for(unsigned int j = 0; j < bad_guys.size(); ++j) { - if(bad_guys[j].dying != DYING_NOT) + if(bad_guys[j]->dying != DYING_NOT) continue; - if(rectcollision(&bullets[i].base, &bad_guys[j].base)) + if(rectcollision(&bullets[i].base, &bad_guys[j]->base)) { // We have detected a collision and now call the // collision functions of the collided objects. // collide with bad_guy first, since bullet_collision will // delete the bullet - bad_guys[j].collision(0, CO_BULLET); + bad_guys[j]->collision(0, CO_BULLET); bullets[i].collision(CO_BADGUY); break; // bullet is invalid now, so break } @@ -280,20 +285,20 @@ /* CO_BADGUY & CO_BADGUY check */ for(unsigned int i = 0; i < bad_guys.size(); ++i) { - if(bad_guys[i].dying != DYING_NOT) + if(bad_guys[i]->dying != DYING_NOT) continue; for(unsigned int j = i+1; j < bad_guys.size(); ++j) { - if(j == i || bad_guys[j].dying != DYING_NOT) + if(j == i || bad_guys[j]->dying != DYING_NOT) continue; - if(rectcollision(&bad_guys[i].base, &bad_guys[j].base)) + if(rectcollision(&bad_guys[i]->base, &bad_guys[j]->base)) { // We have detected a collision and now call the // collision functions of the collided objects. - bad_guys[j].collision(&bad_guys[i], CO_BADGUY); - bad_guys[i].collision(&bad_guys[j], CO_BADGUY); + bad_guys[j]->collision(&bad_guys[i], CO_BADGUY); + bad_guys[i]->collision(&bad_guys[j], CO_BADGUY); } } } @@ -303,23 +308,23 @@ // CO_BADGUY & CO_PLAYER check for(unsigned int i = 0; i < bad_guys.size(); ++i) { - if(bad_guys[i].dying != DYING_NOT) + if(bad_guys[i]->dying != DYING_NOT) continue; - if(rectcollision_offset(&bad_guys[i].base,&tux.base,0,0)) + if(rectcollision_offset(&bad_guys[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 - < bad_guys[i].base.y + bad_guys[i].base.height/2) + < bad_guys[i]->base.y + bad_guys[i]->base.height/2) { - bad_guys[i].collision(&tux, CO_PLAYER, COLLISION_SQUISH); + bad_guys[i]->collision(&tux, CO_PLAYER, COLLISION_SQUISH); } else { tux.collision(&bad_guys[i], CO_BADGUY); - bad_guys[i].collision(&tux, CO_PLAYER, COLLISION_NORMAL); + bad_guys[i]->collision(&tux, CO_PLAYER, COLLISION_NORMAL); } } } @@ -380,13 +385,29 @@ bouncy_bricks.push_back(new_bouncy_brick); } -void +BadGuy* World::add_bad_guy(float x, float y, BadGuyKind kind, bool stay_on_platform) { - bad_guys.push_back(BadGuy()); - BadGuy& new_bad_guy = bad_guys.back(); + bad_guys.push_back(new BadGuy()); + BadGuy* new_bad_guy = bad_guys.back(); - new_bad_guy.init(x,y,kind, stay_on_platform); + new_bad_guy->init(x,y,kind, stay_on_platform); + return new_bad_guy; +} + +void +World::remove_bad_guy(BadGuy* badguy) +{ + for(std::vector<BadGuy*>::iterator i = bad_guys.begin(); + i != bad_guys.end(); ++i) + { + if(*i == badguy) + { + World::current()->bad_guys.erase(i); + delete badguy; + return; + } + } } void @@ -557,10 +578,10 @@ // Bad guys: for (unsigned int i = 0; i < bad_guys.size(); i++) { - if (bad_guys[i].base.x >= x - 32 && bad_guys[i].base.x <= x + 32 && - bad_guys[i].base.y >= y - 16 && bad_guys[i].base.y <= y + 16) + if (bad_guys[i]->base.x >= x - 32 && bad_guys[i]->base.x <= x + 32 && + bad_guys[i]->base.y >= y - 16 && bad_guys[i]->base.y <= y + 16) { - bad_guys[i].collision(&tux, CO_PLAYER, COLLISION_BUMP); + bad_guys[i]->collision(&tux, CO_PLAYER, COLLISION_BUMP); } } Index: badguy.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy.cpp,v retrieving revision 1.45 retrieving revision 1.46 diff -u -d -r1.45 -r1.46 --- badguy.cpp 22 Apr 2004 16:52:02 -0000 1.45 +++ badguy.cpp 22 Apr 2004 17:53:08 -0000 1.46 @@ -408,14 +408,7 @@ void BadGuy::remove_me() { - for(std::vector<BadGuy>::iterator i = World::current()->bad_guys.begin(); - i != World::current()->bad_guys.end(); ++i) - { - if( & (*i) == this) { - World::current()->bad_guys.erase(i); - return; - } - } + World::current()->remove_bad_guy(this); } void |