super-tux-commit Mailing List for Super Tux (Page 29)
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: Ryan F. <sik...@us...> - 2004-10-09 07:04:14
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24654 Modified Files: font.cpp Log Message: - rest of 64bit fix.. missed some vars Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- font.cpp 8 Oct 2004 17:45:07 -0000 1.9 +++ font.cpp 9 Oct 2004 07:04:04 -0000 1.10 @@ -128,8 +128,7 @@ Feel free to replace this hack with a more elegant solution */ char temp[1024]; - std::string::size_type l; - unsigned int i, y; + std::string::size_type l, i, y; i = y = 0; while(true) |
From: Marek M. <wa...@us...> - 2004-10-08 23:16:21
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4680/src Modified Files: player.cpp Log Message: found some values for tux' flapping speed that feel okay when running (still a little too fast, maybe). Problem is, it's pure coincidence that they fit, since they don't depend on any other speed setting. However, this formula might serve as a basis on which the optimum flapping speed could be calculated. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.186 retrieving revision 1.187 diff -u -d -r1.186 -r1.187 --- player.cpp 8 Oct 2004 15:56:19 -0000 1.186 +++ player.cpp 8 Oct 2004 23:16:06 -0000 1.187 @@ -593,18 +593,20 @@ jumping = true; flapping = true; float iv = physic.get_velocity_x(); //flapping speed depends on initial velocity - float fv = 1.2; //fixed velocity that is reached when flapping is done + //float fv = 1.2; //fixed velocity that is reached when flapping is done float cv = 0; //current velocity - if (iv < 0) {fv *= (-1);} //make fv negative or positive depending on direction of iv + //if (iv < 0) {fv *= (-1);} //make fv negative or positive depending on direction of iv if (flapping_timer.get_gone() <= TUX_FLAPPING_TIME) { - //TODO: Tux currently slows down too fast; fix that. + //TODO: Values okay when running, but that's pure coincidence; they don't depend on iv anymore. if (iv == 0) {cv = 0;} - else {cv = (iv-((iv-fv)*(float)flapping_timer.get_gone()/TUX_FLAPPING_TIME));} + //else {cv = (iv-((iv-fv)*(float)flapping_timer.get_gone()/TUX_FLAPPING_TIME));} + else {cv = (sqrt(1000-(float)flapping_timer.get_gone()))/10;} //Handle change of direction while flapping if (((dir == LEFT) && (cv > 0)) || (dir == RIGHT) && (cv < 0)) {cv *= (-1);} + //std::cout << cv << std::endl; physic.set_velocity_x(cv); - physic.set_velocity_y((float)flapping_timer.get_gone()/700); + physic.set_velocity_y((float)flapping_timer.get_gone()/800); } } |
From: Ricardo C. <rm...@us...> - 2004-10-08 21:59:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19162/src Modified Files: leveleditor.cpp Log Message: Fading level's name text. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.153 retrieving revision 1.154 diff -u -d -r1.153 -r1.154 --- leveleditor.cpp 8 Oct 2004 12:19:05 -0000 1.153 +++ leveleditor.cpp 8 Oct 2004 21:59:25 -0000 1.154 @@ -545,6 +545,8 @@ } } +#define FADING_TIME 600 + void LevelEditor::draw(DrawingContext& context) { context.draw_text(white_text, _("Level Editor"), Vector(10, 5), LEFT_ALLIGN, LAYER_GUI); @@ -555,6 +557,12 @@ if(level_name_timer.check()) { + if(level_name_timer.get_left() < FADING_TIME) + { + context.push_transform(); + context.set_alpha(level_name_timer.get_left() * 255 / FADING_TIME); + } + context.draw_text(gold_text, level.name, Vector(screen->w/2, 30), CENTER_ALLIGN, LAYER_GUI); if(level_nb != -1) { @@ -562,6 +570,9 @@ sprintf(str, "%i/%i", level_nb+1, level_subset.get_num_levels()); context.draw_text(gold_text, str, Vector(screen->w/2, 50), CENTER_ALLIGN, LAYER_GUI); } + + if(level_name_timer.get_left() < FADING_TIME) + context.pop_transform(); } if(sector) context.draw_text(white_small_text, _("F1 for help"), Vector(5, 510), LEFT_ALLIGN, LAYER_GUI-10); |
From: Ryan F. <sik...@us...> - 2004-10-08 17:45:22
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28657/lib/video Modified Files: font.cpp Log Message: - fixed blackscreen on amd64 (and likely other 64bit archs), thanks to bug hunting done by cibomahto Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- font.cpp 16 Sep 2004 15:04:16 -0000 1.8 +++ font.cpp 8 Oct 2004 17:45:07 -0000 1.9 @@ -74,12 +74,12 @@ Font::get_text_width(const std::string& text) const { /** Let's calculate the size of the biggest paragraph */ - int l, hl; + std::string::size_type l, hl; hl = 0; l = -1; while(true) { l = text.find("\n", l+1); - if(l == (int)std::string::npos) + if(l == std::string::npos) break; if(hl < l) hl = l; @@ -94,7 +94,7 @@ Font::get_text_height(const std::string& text) const { /** Let's calculate height of the text */ - int l, hh; + std::string::size_type l, hh; hh = h; l = -1; while(true) { @@ -128,7 +128,8 @@ Feel free to replace this hack with a more elegant solution */ char temp[1024]; - unsigned int i, l, y; + std::string::size_type l; + unsigned int i, y; i = y = 0; while(true) |
From: Marek M. <wa...@us...> - 2004-10-08 15:56:36
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv512/src Modified Files: player.cpp Log Message: changing directions while flapping now works added some comments Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.185 retrieving revision 1.186 diff -u -d -r1.185 -r1.186 --- player.cpp 8 Oct 2004 15:33:54 -0000 1.185 +++ player.cpp 8 Oct 2004 15:56:19 -0000 1.186 @@ -592,15 +592,17 @@ } jumping = true; flapping = true; - float iv = physic.get_velocity_x(); - float fv = 1.2; - float cv = 0; - if (iv < 0) {fv *= (-1);} + float iv = physic.get_velocity_x(); //flapping speed depends on initial velocity + float fv = 1.2; //fixed velocity that is reached when flapping is done + float cv = 0; //current velocity + if (iv < 0) {fv *= (-1);} //make fv negative or positive depending on direction of iv if (flapping_timer.get_gone() <= TUX_FLAPPING_TIME) { - //FIXME: Changing directions while flapping doesn't work yet + //TODO: Tux currently slows down too fast; fix that. if (iv == 0) {cv = 0;} else {cv = (iv-((iv-fv)*(float)flapping_timer.get_gone()/TUX_FLAPPING_TIME));} + //Handle change of direction while flapping + if (((dir == LEFT) && (cv > 0)) || (dir == RIGHT) && (cv < 0)) {cv *= (-1);} physic.set_velocity_x(cv); physic.set_velocity_y((float)flapping_timer.get_gone()/700); } |
From: Marek M. <wa...@us...> - 2004-10-08 15:34:10
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28047/src Modified Files: player.cpp Log Message: when flapping, Tux' x-velocity decreases slowly now values still need some adjustment, and changing directions while flapping doesn't work yet. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.184 retrieving revision 1.185 diff -u -d -r1.184 -r1.185 --- player.cpp 8 Oct 2004 14:28:42 -0000 1.184 +++ player.cpp 8 Oct 2004 15:33:54 -0000 1.185 @@ -590,14 +590,18 @@ can_flap = false; falling_from_flap = true; } - //TODO: The slowing down of Tux should be handled... - if (physic.get_velocity_x() > 0) {physic.set_velocity_x(WALK_SPEED);} - else if (physic.get_velocity_x() < 0) {physic.set_velocity_x(WALK_SPEED * (-1));} jumping = true; flapping = true; + float iv = physic.get_velocity_x(); + float fv = 1.2; + float cv = 0; + if (iv < 0) {fv *= (-1);} if (flapping_timer.get_gone() <= TUX_FLAPPING_TIME) { - //TODO: ...here, using get_gone to slow him down at an increasing rate + //FIXME: Changing directions while flapping doesn't work yet + if (iv == 0) {cv = 0;} + else {cv = (iv-((iv-fv)*(float)flapping_timer.get_gone()/TUX_FLAPPING_TIME));} + physic.set_velocity_x(cv); physic.set_velocity_y((float)flapping_timer.get_gone()/700); } } |
From: Benjamin P. J. <lit...@us...> - 2004-10-08 14:37:26
|
Update of /cvsroot/super-tux/supertux/data In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14514/data Modified Files: supertux.desktop Log Message: Minor changes and additions to comply with the desktop entry standard. Index: supertux.desktop =================================================================== RCS file: /cvsroot/super-tux/supertux/data/supertux.desktop,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- supertux.desktop 4 Sep 2004 13:53:44 -0000 1.2 +++ supertux.desktop 8 Oct 2004 14:37:15 -0000 1.3 @@ -1,11 +1,18 @@ [Desktop Entry] +Type=Application +Version=1.0 Encoding=UTF-8 -Name=SuperTux Platform Game -Name[de]=SuperTux Jump&Run Spiel +Name=SuperTux +Name[en]=SuperTux +Name[de]=SuperTux +GenericName=A Platform Game +GenericName[en]=A Platform Game +GenericName[de]=Ein Jump&Run Spiel Comment=A Super Mario inspired penguin platform game +Comment[en]=A Super Mario inspired penguin platform game Comment[de]=Ein von Super Mario inspiriertes Pinguin Jump&Run Spiel +Icon=supertux.png Exec=supertux Terminal=false -Type=Application -Categories=Application;Game;ArcadeGame -Icon=supertux.png \ No newline at end of file +StartupNotify=false +Categories=Application;Game;ArcadeGame \ No newline at end of file |
From: Marek M. <wa...@us...> - 2004-10-08 14:28:52
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11750/src Modified Files: player.cpp Log Message: put both Ryan's and my flapping code into player.cpp with mine currently activated. I'm trying to find a way to slowly decrease Tux' x-velocity when flapping, rather than instantly setting it to walk-speed. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.183 retrieving revision 1.184 diff -u -d -r1.183 -r1.184 --- player.cpp 7 Oct 2004 23:03:07 -0000 1.183 +++ player.cpp 8 Oct 2004 14:28:42 -0000 1.184 @@ -577,7 +577,32 @@ } } - // Flapping + + // Flapping, Marek's version + if (input.jump == DOWN && can_flap) + { + if (!flapping_timer.started()) + { + flapping_timer.start(TUX_FLAPPING_TIME); + } + if (!flapping_timer.check()) + { + can_flap = false; + falling_from_flap = true; + } + //TODO: The slowing down of Tux should be handled... + if (physic.get_velocity_x() > 0) {physic.set_velocity_x(WALK_SPEED);} + else if (physic.get_velocity_x() < 0) {physic.set_velocity_x(WALK_SPEED * (-1));} + jumping = true; + flapping = true; + if (flapping_timer.get_gone() <= TUX_FLAPPING_TIME) + { + //TODO: ...here, using get_gone to slow him down at an increasing rate + physic.set_velocity_y((float)flapping_timer.get_gone()/700); + } + } + + /* // Flapping, Ryan's version if (input.jump == DOWN && can_flap) { if (!flapping_timer.started()) @@ -589,8 +614,6 @@ can_flap = false; falling_from_flap = true; } - //if (physic.get_velocity_x() > 0) {physic.set_velocity_x(WALK_SPEED);} - //else if (physic.get_velocity_x() < 0) {physic.set_velocity_x(WALK_SPEED * (-1));} jumping = true; flapping = true; if (flapping && flapping_timer.get_gone() <= TUX_FLAPPING_TIME @@ -599,8 +622,6 @@ float gravity = Sector::current()->gravity; float xr = (fabsf(physic.get_velocity_x()) / MAX_RUN_XM); - //physic.set_velocity_y((float)flapping_timer.get_gone()/700); - // XXX: magic numbers. should be a percent of gravity // gravity is (by default) -0.1f physic.set_acceleration_y(.12 + .01f*xr); @@ -621,6 +642,7 @@ { physic.set_acceleration_y(0); } + */ // Hover //(disabled by default, use cheat code "hover" to toggle on/off) |
From: Benjamin P. J. <lit...@us...> - 2004-10-08 14:28:03
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12333 Modified Files: .cvsignore Log Message: Added two lines in .cvsignore to make people (that are as dumb as me) using Eclipse for CVS operations happy: .project and .cdtproject files are now ignored from cvs commits. Index: .cvsignore =================================================================== RCS file: /cvsroot/super-tux/supertux/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- .cvsignore 18 Aug 2004 00:11:22 -0000 1.3 +++ .cvsignore 8 Oct 2004 14:27:51 -0000 1.4 @@ -13,3 +13,5 @@ Makefile autom4te.cache libtool +.project +.cdtproject \ No newline at end of file |
From: Ricardo C. <rm...@us...> - 2004-10-08 12:19:18
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14781/src Modified Files: leveleditor.cpp Log Message: Bugfix: don't show weird number when level editing a level feed from the command line. Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.152 retrieving revision 1.153 diff -u -d -r1.152 -r1.153 --- leveleditor.cpp 8 Oct 2004 11:07:38 -0000 1.152 +++ leveleditor.cpp 8 Oct 2004 12:19:05 -0000 1.153 @@ -215,7 +215,10 @@ DrawingContext context; if(!filename.empty()) + { + level_nb = -1; load_level(filename); + } else Menu::set_current(main_menu); @@ -553,9 +556,12 @@ if(level_name_timer.check()) { context.draw_text(gold_text, level.name, Vector(screen->w/2, 30), CENTER_ALLIGN, LAYER_GUI); - char str[128]; - sprintf(str, "%i/%i", level_nb+1, level_subset.get_num_levels()); - context.draw_text(gold_text, str, Vector(screen->w/2, 50), CENTER_ALLIGN, LAYER_GUI); + if(level_nb != -1) + { + char str[128]; + sprintf(str, "%i/%i", level_nb+1, level_subset.get_num_levels()); + context.draw_text(gold_text, str, Vector(screen->w/2, 50), CENTER_ALLIGN, LAYER_GUI); + } } if(sector) context.draw_text(white_small_text, _("F1 for help"), Vector(5, 510), LEFT_ALLIGN, LAYER_GUI-10); |
From: Ricardo C. <rm...@us...> - 2004-10-08 11:08:18
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30608/src Modified Files: leveleditor.h leveleditor.cpp Log Message: Fixed following bug from level editor: - impossibility to add bad guys from a certain range. - while mouse was pressed, tiles change was happening all the time. - it's possible to make enemies out of tiles squares now. Zoom is still broken on change() and on selection. It should also be supported on tilemap. Index: leveleditor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.h,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- leveleditor.h 24 Sep 2004 15:10:10 -0000 1.19 +++ leveleditor.h 8 Oct 2004 11:07:38 -0000 1.20 @@ -121,7 +121,7 @@ Menu* create_subset_menu; Menu* settings_menu; - bool left_button, middle_button; + bool left_button, middle_button, mouse_moved; bool done; bool show_grid; Index: leveleditor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/leveleditor.cpp,v retrieving revision 1.151 retrieving revision 1.152 diff -u -d -r1.151 -r1.152 --- leveleditor.cpp 24 Sep 2004 15:10:10 -0000 1.151 +++ leveleditor.cpp 8 Oct 2004 11:07:38 -0000 1.152 @@ -37,6 +37,7 @@ #include "badguy.h" #include "gameobjs.h" #include "door.h" +#include "camera.h" LevelEditor::LevelEditor() { @@ -47,8 +48,7 @@ frame_timer.init(true); level_name_timer.init(true); selection_end = selection_ini = Vector(0,0); -left_button = false; -middle_button = false; +left_button = middle_button = mouse_moved = false; cur_layer = LAYER_TILES; level_changed = false; @@ -236,6 +236,8 @@ void LevelEditor::events() { +mouse_moved = false; + while(SDL_PollEvent(&event)) { Menu* menu = Menu::current(); @@ -373,6 +375,7 @@ switch(event.type) { case SDL_MOUSEMOTION: + mouse_moved = true; if(SDL_GetMouseState(NULL, NULL)&SDL_BUTTON(SDL_BUTTON_RIGHT)) { // movement like in strategy games scroll.x += -1 * event.motion.xrel; @@ -381,6 +384,7 @@ break; case SDL_MOUSEBUTTONDOWN: + mouse_moved = true; if(event.button.button == SDL_BUTTON_LEFT) left_button = true; else if(event.button.button == SDL_BUTTON_MIDDLE) @@ -391,6 +395,7 @@ break; case SDL_MOUSEBUTTONUP: + mouse_moved = true; if(event.button.button == SDL_BUTTON_LEFT) left_button = false; else if(event.button.button == SDL_BUTTON_MIDDLE) @@ -525,11 +530,14 @@ if(scroll.y > height - screen->h/2) scroll.y = height - screen->h/2; - if(left_button) + // set camera translation, since BadGuys like it + sector->camera->set_scrolling((int)scroll.x, (int)scroll.y); + + if(left_button && mouse_moved) for(unsigned int x = 0; x < selection.size(); x++) for(unsigned int y = 0; y < selection[x].size(); y++) - change((int)((scroll.x + event.button.x)/(32*zoom)) + x, - (int)((scroll.y + event.button.y)/(32*zoom)) + y, selection[x][y], + change((int)(scroll.x + event.button.x) + (x*32), + (int)(scroll.y + event.button.y) + (y*32), selection[x][y], cur_layer); } } @@ -804,57 +812,66 @@ void LevelEditor::change(int x, int y, int newtile, int layer) { // find the tilemap of the current layer, and then change the tile -if(x < 0 || (unsigned int)x > sector->solids->get_width() || - y < 0 || (unsigned int)y > sector->solids->get_height()) +if(x < 0 || (unsigned int)x > sector->solids->get_width()*32 || + y < 0 || (unsigned int)y > sector->solids->get_height()*32) return; level_changed = true; +if(zoom != 1) + { // no need to do this for normal view (no zoom) + x = (int)(x * (zoom*32) / 32); + y = (int)(y * (zoom*32) / 32); + } + if(newtile < 0) // add object { // remove an active tile or object that might be there change(x, y, 0, LAYER_TILES); if(newtile == OBJ_TRAMPOLINE) - sector->add_object(new Trampoline(x*32, y*32)); + sector->add_object(new Trampoline(x, y)); else if(newtile == OBJ_FLYING_PLATFORM) - sector->add_object(new FlyingPlatform(x*32, y*32)); + sector->add_object(new FlyingPlatform(x, y)); else if(newtile == OBJ_DOOR) - sector->add_object(new Door(x*32, y*32)); + sector->add_object(new Door(x, y)); else - sector->add_object(new BadGuy(BadGuyKind((-newtile)-1), x*32, y*32)); + sector->add_object(new BadGuy(BadGuyKind((-newtile)-1), x, y)); sector->update_game_objects(); } else if(cur_layer == LAYER_FOREGROUNDTILES) - foregrounds->change(x, y, newtile); + foregrounds->change(x/32, y/32, newtile); else if(cur_layer == LAYER_TILES) { // remove a bad guy if it's there + // we /32 in order to round numbers for(Sector::GameObjects::iterator i = sector->gameobjects.begin(); i < sector->gameobjects.end(); i++) { BadGuy* badguy = dynamic_cast<BadGuy*> (*i); if(badguy) - if(badguy->base.x == x*32 && badguy->base.y == y*32) + if((int)badguy->base.x/32 == x/32 && (int)badguy->base.y/32 == y/32) sector->gameobjects.erase(i); Trampoline* trampoline = dynamic_cast<Trampoline*> (*i); if(trampoline) - if(trampoline->base.x == x*32 && trampoline->base.y == y*32) + { + if((int)trampoline->base.x/32 == x/32 && (int)trampoline->base.y/32 == y/32) sector->gameobjects.erase(i); + } FlyingPlatform* flying_platform = dynamic_cast<FlyingPlatform*> (*i); if(flying_platform) - if(flying_platform->base.x == x*32 && flying_platform->base.y == y*32) + if((int)flying_platform->base.x/32 == x/32 && (int)flying_platform->base.y/32 == y/32) sector->gameobjects.erase(i); Door* door = dynamic_cast<Door*> (*i); if(door) - if(door->get_area().x == x*32 && door->get_area().y == y*32) + if((int)door->get_area().x/32 == x/32 && (int)door->get_area().y/32 == y/32) sector->gameobjects.erase(i); } sector->update_game_objects(); - solids->change(x, y, newtile); + solids->change(x/32, y/32, newtile); } else if(cur_layer == LAYER_BACKGROUNDTILES) - backgrounds->change(x, y, newtile); + backgrounds->change(x/32, y/32, newtile); } void LevelEditor::show_help() |
From: Ryan F. <sik...@us...> - 2004-10-07 23:03:29
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27162/src Modified Files: player.cpp Log Message: - [sort of] reverted flapping to it's old form Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.182 retrieving revision 1.183 diff -u -d -r1.182 -r1.183 --- player.cpp 7 Oct 2004 17:50:21 -0000 1.182 +++ player.cpp 7 Oct 2004 23:03:07 -0000 1.183 @@ -603,14 +603,25 @@ // XXX: magic numbers. should be a percent of gravity // gravity is (by default) -0.1f - physic.set_acceleration_y(.05 + .06f*xr); + physic.set_acceleration_y(.12 + .01f*xr); + +#if 0 + // To slow down x-vel when flapping (not working) + if (fabsf(physic.get_velocity_x()) > MAX_WALK_XM) + { + if (physic.get_velocity_x() < 0) + physic.set_acceleration_x(1.0f); + else if (physic.get_velocity_x() > 0) + physic.set_acceleration_x(-1.0f); + } +#endif } } else { physic.set_acceleration_y(0); } - + // Hover //(disabled by default, use cheat code "hover" to toggle on/off) //TODO: needs some tweaking, especially when used together with double jump and jumping off badguys |
From: Ricardo C. <rm...@us...> - 2004-10-07 17:50:48
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11643/src Modified Files: misc.cpp player.h player.cpp gameloop.cpp Log Message: Sometime ago I asked what keys ppl would prefer, made the changes now to reflect that. Please, test this on a joystick. TODO: add Up and Down level viewing. Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.181 retrieving revision 1.182 diff -u -d -r1.181 -r1.182 --- player.cpp 6 Oct 2004 05:20:07 -0000 1.181 +++ player.cpp 7 Oct 2004 17:50:21 -0000 1.182 @@ -67,23 +67,25 @@ PlayerKeymap::PlayerKeymap() { - keymap.jump = SDLK_SPACE; - keymap.activate = SDLK_UP; - keymap.duck = SDLK_DOWN; + keymap.up = SDLK_UP; + keymap.down = SDLK_DOWN; keymap.left = SDLK_LEFT; keymap.right = SDLK_RIGHT; - keymap.fire = SDLK_LCTRL; + + keymap.power = SDLK_LCTRL; + keymap.jump = SDLK_LALT; } void player_input_init(player_input_type* pplayer_input) { + pplayer_input->up = UP; pplayer_input->down = UP; pplayer_input->fire = UP; pplayer_input->left = UP; pplayer_input->old_fire = UP; pplayer_input->right = UP; - pplayer_input->up = UP; - pplayer_input->old_up = UP; + pplayer_input->jump = UP; + pplayer_input->old_jump = UP; pplayer_input->activate = UP; } @@ -199,38 +201,44 @@ input.left = state; return true; } - else if(key == keymap.jump) + else if(key == keymap.up) { input.up = state; + + /* Up key also opens activates stuff */ + input.activate = state; + + if(state == DOWN) { + /** check for interactive objects */ + for(Sector::InteractiveObjects::iterator i + = Sector::current()->interactive_objects.begin(); + i != Sector::current()->interactive_objects.end(); ++i) { + if(rectcollision(base, (*i)->get_area())) { + (*i)->interaction(INTERACTION_ACTIVATE); + } + } + } + return true; } - else if(key == keymap.duck) + else if(key == keymap.down) { input.down = state; return true; } - else if(key == keymap.fire) + else if(key == keymap.power) { if (state == UP) input.old_fire = UP; input.fire = state; + return true; } - else if(key == keymap.activate) + else if(key == keymap.jump) { - input.activate = state; - - if(state == DOWN) { - /** check for interactive objects */ - for(Sector::InteractiveObjects::iterator i - = Sector::current()->interactive_objects.begin(); - i != Sector::current()->interactive_objects.end(); ++i) { - if(rectcollision(base, (*i)->get_area())) { - (*i)->interaction(INTERACTION_ACTIVATE); - } - } - } - + if (state == UP) + input.old_jump = UP; + input.jump = state; return true; } else @@ -533,7 +541,7 @@ } // Press jump key - if(input.up == DOWN && can_jump && on_ground()) + if(input.jump == DOWN && can_jump && on_ground()) { if(duck) { // only jump a little bit when in duck mode { physic.set_velocity_y(3); @@ -556,7 +564,7 @@ SoundManager::get()->play_sound(IDToSound(SND_BIGJUMP)); } // Let go of jump key - else if(input.up == UP) + else if(input.jump == UP) { if (!flapping && !duck && !falling_from_flap && !on_ground()) { @@ -570,7 +578,7 @@ } // Flapping - if (input.up == DOWN && can_flap) + if (input.jump == DOWN && can_flap) { if (!flapping_timer.started()) { @@ -606,7 +614,7 @@ // Hover //(disabled by default, use cheat code "hover" to toggle on/off) //TODO: needs some tweaking, especially when used together with double jump and jumping off badguys - if (enable_hover && input.up == DOWN && !jumping && !butt_jump && physic.get_velocity_y() <= 0) + if (enable_hover && input.jump == DOWN && !jumping && !butt_jump && physic.get_velocity_y() <= 0) { physic.set_velocity_y(-1); } @@ -670,8 +678,8 @@ issolid(base.x + base.width - 1, base.y + base.height + 64)) && jumping == false && can_jump == false - && input.up == DOWN - && input.old_up == UP) + && input.jump == DOWN + && input.old_jump == UP) { can_jump = true; } @@ -686,7 +694,7 @@ physic.set_acceleration_y(0); //for flapping } - input.old_up = input.up; + input.old_jump = input.jump; } void @@ -697,7 +705,7 @@ /* Jump/jumping? */ - if (on_ground() && input.up == UP) + if (on_ground() && input.jump == UP) can_jump = true; handle_vertical_input(); @@ -1205,7 +1213,7 @@ Sector::current()->add_floating_text(base, str); } - if (input.up) + if (input.jump) physic.set_velocity_y(5.2); else physic.set_velocity_y(2); Index: player.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.h,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- player.h 17 Sep 2004 23:14:23 -0000 1.88 +++ player.h 7 Oct 2004 17:50:21 -0000 1.89 @@ -63,11 +63,11 @@ { public: int jump; - int activate; - int duck; + int up; + int down; int left; int right; - int fire; + int power; PlayerKeymap(); }; @@ -79,11 +79,12 @@ int right; int left; int up; - int old_up; int down; int fire; int old_fire; int activate; + int jump; + int old_jump; }; void player_input_init(player_input_type* pplayer_input); Index: misc.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/misc.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- misc.cpp 11 Aug 2004 15:32:21 -0000 1.6 +++ misc.cpp 7 Oct 2004 17:50:21 -0000 1.7 @@ -19,22 +19,21 @@ void MyConfig::customload(LispReader& reader) { - reader.read_int ("keyboard-jump", keymap.jump); - reader.read_int ("keyboard-activate", keymap.activate); - reader.read_int ("keyboard-duck", keymap.duck); + reader.read_int ("keyboard-up", keymap.up); + reader.read_int ("keyboard-down", keymap.down); reader.read_int ("keyboard-left", keymap.left); reader.read_int ("keyboard-right", keymap.right); - reader.read_int ("keyboard-fire", keymap.fire); + reader.read_int ("keyboard-jump", keymap.jump); + reader.read_int ("keyboard-power", keymap.power); } void MyConfig::customsave(FILE * config) { - fprintf(config, "\t(keyboard-jump %d)\n", keymap.jump); - fprintf(config, "\t(keyboard-duck %d)\n", keymap.duck); + fprintf(config, "\t(keyboard-up %d)\n", keymap.up); + fprintf(config, "\t(keyboard-down %d)\n", keymap.down); fprintf(config, "\t(keyboard-left %d)\n", keymap.left); fprintf(config, "\t(keyboard-right %d)\n", keymap.right); - fprintf(config, "\t(keyboard-fire %d)\n", keymap.fire); - fprintf(config, "\t(keyboard-activate %d)\n", keymap.activate); - + fprintf(config, "\t(keyboard-jump %d)\n", keymap.jump); + fprintf(config, "\t(keyboard-power %d)\n", keymap.power); } void process_options_menu(void) @@ -129,11 +128,10 @@ options_keys_menu->additem(MN_HL,"",0,0); options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Left move"), 0,0, 0,&keymap.left); options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Right move"), 0,0, 0,&keymap.right); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Up/Activate"), 0,0, 0,&keymap.up); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Down/Duck"), 0,0, 0,&keymap.down); options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Jump"), 0,0, 0,&keymap.jump); - options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Duck"), 0,0, 0,&keymap.duck); - options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Activate"), 0, 0, 0, - &keymap.activate); - options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Power/Run"), 0,0, 0,&keymap.fire); + options_keys_menu->additem(MN_CONTROLFIELD_KB,_("Power/Run"), 0,0, 0,&keymap.power); options_keys_menu->additem(MN_HL,"",0,0); options_keys_menu->additem(MN_BACK,_("Back"),0,0); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.188 retrieving revision 1.189 diff -u -d -r1.188 -r1.189 --- gameloop.cpp 6 Oct 2004 21:37:51 -0000 1.188 +++ gameloop.cpp 7 Oct 2004 17:50:21 -0000 1.189 @@ -248,11 +248,12 @@ it could have nasty bugs, like going allways to the right or whatever that key does */ Player& tux = *(currentsector->player); - tux.key_event((SDLKey)keymap.jump, UP); - tux.key_event((SDLKey)keymap.duck, UP); + tux.key_event((SDLKey)keymap.up, UP); + tux.key_event((SDLKey)keymap.down, UP); tux.key_event((SDLKey)keymap.left, UP); tux.key_event((SDLKey)keymap.right, UP); - tux.key_event((SDLKey)keymap.fire, UP); + tux.key_event((SDLKey)keymap.jump, UP); + tux.key_event((SDLKey)keymap.power, UP); Menu::set_current(game_menu); Ticks::pause_start(); @@ -500,11 +501,20 @@ else if (event.jaxis.axis == joystick_keymap.y_axis) { if (event.jaxis.value > joystick_keymap.dead_zone) - tux.input.down = DOWN; - else if (event.jaxis.value < -joystick_keymap.dead_zone) + { + tux.input.up = DOWN; tux.input.down = UP; + } + else if (event.jaxis.value < -joystick_keymap.dead_zone) + { + tux.input.up = UP; + tux.input.down = DOWN; + } else - tux.input.down = UP; + { + tux.input.up = DOWN; + tux.input.down = DOWN; + } } break; @@ -531,7 +541,7 @@ case SDL_JOYBUTTONDOWN: if (event.jbutton.button == joystick_keymap.a_button) - tux.input.up = DOWN; + tux.input.jump = DOWN; else if (event.jbutton.button == joystick_keymap.b_button) tux.input.fire = DOWN; else if (event.jbutton.button == joystick_keymap.start_button) @@ -539,7 +549,7 @@ break; case SDL_JOYBUTTONUP: if (event.jbutton.button == joystick_keymap.a_button) - tux.input.up = UP; + tux.input.jump = UP; else if (event.jbutton.button == joystick_keymap.b_button) tux.input.fire = UP; break; |
From: Ricardo C. <rm...@us...> - 2004-10-07 17:10:41
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv876/src Modified Files: tile_manager.cpp tilemap.cpp Log Message: Two leveleditor related bug fixes: - don't show empty tiles on tiles board; - don't show weird tiles when viewing stuff outside the level margins. Index: tile_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tile_manager.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- tile_manager.cpp 6 Aug 2004 17:37:56 -0000 1.6 +++ tile_manager.cpp 7 Oct 2004 17:10:20 -0000 1.7 @@ -152,16 +152,8 @@ TileManager::get(unsigned int id) { Tiles::iterator i = tiles.find(id); - if(i == tiles.end()) - { - std::cerr << "Warning: Asked for a non-existing tile id. Ignoring.\n"; - // Never return 0, but return the first tile instead so that - // user code doesn't have to check for NULL pointers all over - // the place - i = tiles.begin(); - return i->second; - } + return 0; return i->second; } Index: tilemap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/tilemap.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- tilemap.cpp 5 Aug 2004 18:58:08 -0000 1.18 +++ tilemap.cpp 7 Oct 2004 17:10:28 -0000 1.19 @@ -155,6 +155,8 @@ int tx, ty; for(pos.x = start_x, tx = tsx; pos.x < end_x; pos.x += 32, ++tx) { for(pos.y = start_y, ty = tsy; pos.y < end_y; pos.y += 32, ++ty) { + if(tx < 0 || tx > width || ty < 0 || ty > height) + continue; // outside tilemap if (!tiles[ty*width + tx].hidden) tilemanager->draw_tile(context, tiles[ty*width + tx].id, pos, layer); } @@ -186,6 +188,8 @@ int tx, ty; for(pos.x = start_x, tx = tsx; pos.x < end_x; pos.x += 32, ++tx) { for(pos.y = start_y, ty = tsy; pos.y < end_y; pos.y += 32, ++ty) { + if(tx < 0 || tx > width || ty < 0 || ty > height) + continue; // outside tilemap if (!tiles[ty*width + tx].hidden) tilemanager->draw_tile(context, tiles[ty*width + tx].id, pos, layer); } |
From: Ricardo C. <rm...@us...> - 2004-10-06 21:39:06
|
Update of /cvsroot/super-tux/supertux/data/levels/worldmap In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19779/data/levels/worldmap Modified Files: bonusisland1.stwm icyisland.stwm Log Message: Updated worldmaps to reflext changes on worldmap format. Index: bonusisland1.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/worldmap/bonusisland1.stwm,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- bonusisland1.stwm 26 Aug 2004 23:04:12 -0000 1.5 +++ bonusisland1.stwm 6 Oct 2004 21:38:54 -0000 1.6 @@ -61,71 +61,71 @@ )) (special-tiles - (special-tile (level "bonus1/bonus-level1.stl") + (level (name "bonus1/bonus-level1.stl") (x 35) (y 4)) - (special-tile (level "bonus1/bonus-level2.stl") + (level (name "bonus1/bonus-level2.stl") (x 32) (y 41)) - (special-tile (level "bonus1/bonus-level3.stl") + (level (name "bonus1/bonus-level3.stl") (x 30) (y 39)) - (special-tile (level "bonus1/bonus-level4.stl") + (level (name "bonus1/bonus-level4.stl") (extro-filelevel "extro-bonus.txt") (x 32) (y 46)) - (special-tile (level "bonus1/bonus-level5.stl") + (level (name "bonus1/bonus-level5.stl") (x 44) (y 39)) - (special-tile (level "bonus1/abednego-level1.stl") + (level (name "bonus1/abednego-level1.stl") (x 12) (y 33)) - (special-tile (level "bonus1/abednego-level2.stl") + (level (name "bonus1/abednego-level2.stl") (x 15) (y 35)) - (special-tile (level "bonus1/abednego-level3.stl") + (level (name "bonus1/abednego-level3.stl") (x 18) (y 36)) - (special-tile (level "bonus1/abednego-level4.stl") + (level (name "bonus1/abednego-level4.stl") (x 16) (y 40)) - (special-tile (level "bonus1/matr1x-level1.stl") + (level (name "bonus1/matr1x-level1.stl") (x 21) (y 17)) - (special-tile (level "bonus1/matr1x-level2.stl") + (level (name "bonus1/matr1x-level2.stl") (x 25) (y 18)) - (special-tile (level "bonus1/matr1x-level3.stl") + (level (name "bonus1/matr1x-level3.stl") (x 20) (y 20)) - (special-tile (level "bonus1/thompson-level1.stl") + (level (name "bonus1/thompson-level1.stl") (x 35) (y 20)) - (special-tile (level "bonus1/thompson-level2.stl") + (level (name "bonus1/thompson-level2.stl") (x 37) (y 22)) - (special-tile (level "bonus1/torfi-level1.stl") + (level (name "bonus1/torfi-level1.stl") (x 58) (y 34)) - (special-tile (level "bonus1/torfi-level2.stl") + (level (name "bonus1/torfi-level2.stl") (x 57) (y 38)) - (special-tile (level "bonus1/torfi-level3.stl") + (level (name "bonus1/torfi-level3.stl") (x 59) (y 40)) - (special-tile (level "bonus1/wansti-level1.stl") + (level (name "bonus1/wansti-level1.stl") (x 51) (y 14)) - (special-tile (level "bonus1/wansti-level2.stl") + (level (name "bonus1/wansti-level2.stl") (x 53) (y 16)) - (special-tile (level "bonus1/wansti-level3.stl") + (level (name "bonus1/wansti-level3.stl") (x 52) (y 20)) - (special-tile (level "bonus1/wansti-level4.stl") + (level (name "bonus1/wansti-level4.stl") (x 47) (y 18)) - (special-tile (level "bonus1/wansti-level5.stl") + (level (name "bonus1/wansti-level5.stl") (x 50) (y 22)) Index: icyisland.stwm =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/worldmap/icyisland.stwm,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- icyisland.stwm 26 Aug 2004 23:04:12 -0000 1.9 +++ icyisland.stwm 6 Oct 2004 21:38:54 -0000 1.10 @@ -46,114 +46,114 @@ (special-tiles - (special-tile + (level (x 4) (y 6) - (level "world1/level1.stl")) - (special-tile + (name "world1/level1.stl")) + (level (x 4) (y 8) - (level "world1/level2.stl")) - (special-tile + (name "world1/level2.stl")) + (level (x 5) (y 11) - (level "world1/level3.stl")) - (special-tile + (name "world1/level3.stl")) + (level (x 7) (y 11) - (level "world1/level4.stl")) - (special-tile + (name "world1/level4.stl")) + (level (x 7) (y 8) - (level "world1/level5.stl")) - (special-tile + (name "world1/level5.stl")) + (level (x 11) (y 9) - (level "world1/level6.stl")) - (special-tile + (name "world1/level6.stl")) + (level (x 11) (y 9) - (level "world1/level7.stl")) - (special-tile + (name "world1/level7.stl")) + (level (x 17) (y 6) - (level "world1/level8.stl")) - (special-tile + (name "world1/level8.stl")) + (level (x 14) (y 6) - (level "world1/level9.stl")) - (special-tile + (name "world1/level9.stl")) + (level (x 21) (y 8) - (level "world1/level10.stl")) - (special-tile + (name "world1/level10.stl")) + (level (x 26) (y 7) - (level "world1/level11.stl")) - (special-tile + (name "world1/level11.stl")) + (level (x 28) (y 9) - (level "world1/level12.stl")) - (special-tile + (name "world1/level12.stl")) + (level (x 31) (y 9) - (level "world1/level13.stl")) - (special-tile + (name "world1/level13.stl")) + (level (x 34) (y 11) - (level "world1/level14.stl")) - (special-tile + (name "world1/level14.stl")) + (level (x 29) (y 11) - (level "world1/level15.stl")) - (special-tile + (name "world1/level15.stl")) + (level (x 28) (y 13) - (level "world1/level16.stl")) - (special-tile + (name "world1/level16.stl")) + (level (x 29) (y 16) - (level "world1/level17.stl")) - (special-tile + (name "world1/level17.stl")) + (level (x 27) (y 19) - (level "world1/level18.stl")) - (special-tile + (name "world1/level18.stl")) + (level (x 23) (y 22) - (level "world1/level19.stl")) - (special-tile + (name "world1/level19.stl")) + (level (x 20) (y 25) - (level "world1/level20.stl")) - (special-tile + (name "world1/level20.stl")) + (level (x 18) (y 23) - (level "world1/level21.stl")) - (special-tile + (name "world1/level21.stl")) + (level (x 19) (y 20) - (level "world1/level22.stl")) - (special-tile + (name "world1/level22.stl")) + (level (x 14) (y 24) - (level "world1/level23.stl")) - (special-tile + (name "world1/level23.stl")) + (level (x 14) (y 20) - (level "world1/level24.stl")) - (special-tile + (name "world1/level24.stl")) + (level (x 10) (y 22) - (level "world1/level25.stl")) - (special-tile + (name "world1/level25.stl")) + (level (x 7) (y 20) (extro-filename "extro.txt") - (level "world1/level26.stl") - (exit-game #t)) + (name "world1/level26.stl") + (quit-worldmap #t)) ; In the future, do this to go to another world: -; (goto-world "forest.stwt) +; (next-worldmap "forest.stwt) ) |
From: Ricardo C. <rm...@us...> - 2004-10-06 21:38:30
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19681 Modified Files: WORLDMAPDESIGN Log Message: Updated documentation with new syntax. Index: WORLDMAPDESIGN =================================================================== RCS file: /cvsroot/super-tux/supertux/WORLDMAPDESIGN,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- WORLDMAPDESIGN 4 Sep 2004 14:00:56 -0000 1.2 +++ WORLDMAPDESIGN 6 Oct 2004 21:38:20 -0000 1.3 @@ -11,27 +11,54 @@ To edit a World Map, please use FlexLay. Thought it might have problems with the editing of level and special tiles, since it isn't sync with CVS. -= AVAILABLE SPECIAL TILES = += INTRODUCTION = -These are the available special tiles (even if 0_1_1 branch has some of them, -they will most likely have different names or used in another way): +These things are always changing, so if even 0.1.x has something like something +described here, it might have a different name or be used in a different way. -; This is a comment! +Stuff prefixed by a ';' are comments. + +; This is a comment! :) + += MAKING THE HOLE FOR A LEVEL = + +; Opening level group +(level -(special-tile ; X and Y position [NECESSARY] (x 10) (y 14) -; If this is a level: - (level "file_name.stl") +; Filename of the level [NECESSARY] + (name "file_name.stl") -; Flip the level vertically [NEEDS: level] - default: false +; Flip the level vertically - default: false (vertical-flip #t) -; Stop auto-walking - default: false +; Show this text file after completing this level + (extro-filename "filename") + +; Go to this world after completing this level + (next-worldmap "worldmap.stwt) + +; Exit world map after completing this level + (quit-worldmap #t) + +; Disable auto walking after completing the level - default: false (auto-path #f) +) ; end of level group + + += AVAILABLE SPECIAL TILES = + +; Opening special-tile group +(special-tile + +; X and Y position [NECESSARY] + (x 10) + (y 14) + ; Add a message tile. You can also use this together with a teleporter. (map-message "Hello World!" @@ -48,18 +75,10 @@ (teleport-to-x 20) (teleport-to-y 13) -; Don't show this tile [WORKS FOR: level, teleporter, map-message] +; Don't show this tile [WORKS FOR: teleporter, map-message] (invisible-tile #t) -; Show this text file after completing this level [NEEDS: level] - (extro-filename "filename") - -; Go to this world after completing this level [NEEDS: level] - (next-world "worldmap.stwt) - -; Exit world map after completing this level [NEEDS: level] - (exit-game #t) +) ; end of special-tile group -) ; end of special-tile - SuperTux developers |
From: Ricardo C. <rm...@us...> - 2004-10-06 21:38:01
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19521/src Modified Files: worldmap.h title.cpp worldmap.cpp gameloop.cpp Log Message: Splited out level stuff from SpecialTile to a Level struct (similar to old one). Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.121 retrieving revision 1.122 diff -u -d -r1.121 -r1.122 --- title.cpp 4 Oct 2004 21:11:24 -0000 1.121 +++ title.cpp 6 Oct 2004 21:37:50 -0000 1.122 @@ -391,8 +391,8 @@ if(event.key.keysym.sym == SDLK_DELETE) { int slot = menu->get_active_item_id(); - std::stringstream stream; - stream << slot; + std::stringstream stream; + stream << slot; std::string str = _("Are you sure you want to delete slot") + stream.str() + "?"; if(confirm_dialog(bkg_title, str.c_str())) Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.123 retrieving revision 1.124 diff -u -d -r1.123 -r1.124 --- worldmap.cpp 4 Oct 2004 21:11:24 -0000 1.123 +++ worldmap.cpp 6 Oct 2004 21:37:50 -0000 1.124 @@ -309,11 +309,11 @@ { if (input_direction != D_NONE) { - WorldMap::SpecialTile* special_tile = worldmap->at_special_tile(); + WorldMap::Level* level = worldmap->at_level(); // We got a new direction, so lets start walking when possible Vector next_tile; - if ((!special_tile || special_tile->solved || special_tile->level_name.empty()) + if ((!level || level->solved) && worldmap->path_ok(input_direction, tile_pos, &next_tile)) { tile_pos = next_tile; @@ -353,8 +353,9 @@ } } - if (worldmap->at(tile_pos)->stop || (special_tile && - !special_tile->passive_message)) + if (worldmap->at(tile_pos)->stop || + (special_tile && !special_tile->passive_message) || + worldmap->at_level()) { if(special_tile && !special_tile->map_message.empty() && !special_tile->passive_message) @@ -453,7 +454,6 @@ size_t frame = ((global_frame_counter*25) / anim_speed) % images.size(); -std::cerr << "frame: " << frame << std::endl; context.draw_surface(images[frame], pos, LAYER_TILES); } else if (images.size() == 1) @@ -474,6 +474,8 @@ start_x = 4; start_y = 5; + + tux = new Tux(this); leveldot_green = new Surface(datadir + "/images/worldmap/leveldot_green.png", true); leveldot_red = new Surface(datadir + "/images/worldmap/leveldot_red.png", true); @@ -546,28 +548,18 @@ { SpecialTile special_tile; LispReader reader(lisp_cdr(element)); - special_tile.solved = false; - special_tile.north = true; - special_tile.east = true; - special_tile.south = true; - special_tile.west = true; - - reader.read_int("x", special_tile.x); - reader.read_int("y", special_tile.y); - reader.read_string("level", special_tile.level_name, false); - - special_tile.vertical_flip = false; - reader.read_bool("vertical-flip", special_tile.vertical_flip); + reader.read_float("x", special_tile.pos.x); + reader.read_float("y", special_tile.pos.y); special_tile.map_message.erase(); reader.read_string("map-message", special_tile.map_message); special_tile.passive_message = false; reader.read_bool("passive-message", special_tile.passive_message); - special_tile.teleport_dest_x = special_tile.teleport_dest_y = -1; - reader.read_int("teleport-to-x", special_tile.teleport_dest_x); - reader.read_int("teleport-to-y", special_tile.teleport_dest_y); + special_tile.teleport_dest = Vector(-1,-1); + reader.read_float("teleport-to-x", special_tile.teleport_dest.x); + reader.read_float("teleport-to-y", special_tile.teleport_dest.y); special_tile.invisible = false; reader.read_bool("invisible-tile", special_tile.invisible); @@ -575,6 +567,7 @@ special_tile.apply_action_north = special_tile.apply_action_south = special_tile.apply_action_east = special_tile.apply_action_west = true; + std::string apply_direction; reader.read_string("apply-to-direction", apply_direction); if(!apply_direction.empty()) @@ -592,46 +585,37 @@ special_tile.apply_action_west = true; } - reader.read_string("extro-filename", special_tile.extro_filename); - reader.read_string("next-world", special_tile.next_worldmap); - special_tile.quit_worldmap = false; - reader.read_bool("exit-game", special_tile.quit_worldmap); - - special_tile.auto_path = true; - reader.read_bool("auto-path", special_tile.auto_path); - special_tiles.push_back(special_tile); } - /* Kept for backward compability */ else if (strcmp(lisp_symbol(lisp_car(element)), "level") == 0) { - SpecialTile special_tile; + Level level; LispReader reader(lisp_cdr(element)); - special_tile.solved = false; + level.solved = false; - special_tile.north = true; - special_tile.east = true; - special_tile.south = true; - special_tile.west = true; + level.north = true; + level.east = true; + level.south = true; + level.west = true; - special_tile.invisible = false; + reader.read_string("extro-filename", level.extro_filename); + reader.read_string("next-worldmap", level.next_worldmap); - special_tile.apply_action_north = special_tile.apply_action_south = - special_tile.apply_action_east = special_tile.apply_action_west = - true; - special_tile.vertical_flip = false; - special_tile.teleport_dest_x = special_tile.teleport_dest_y = -1; + level.quit_worldmap = false; + reader.read_bool("quit-worldmap", level.quit_worldmap); - reader.read_string("extro-filename", special_tile.extro_filename); - if(!special_tile.extro_filename.empty()) - special_tile.quit_worldmap = true; - reader.read_string("name", special_tile.level_name, true); - reader.read_int("x", special_tile.x); - reader.read_int("y", special_tile.y); + reader.read_string("name", level.name, true); + reader.read_float("x", level.pos.x); + reader.read_float("y", level.pos.y); + level.auto_path = true; + reader.read_bool("auto-path", level.auto_path); - special_tiles.push_back(special_tile); + level.vertical_flip = false; + reader.read_bool("vertical-flip", level.vertical_flip); + + levels.push_back(level); } cur = lisp_cdr(cur); @@ -647,31 +631,30 @@ } lisp_free(root_obj); - tux = new Tux(this); } -void WorldMap::get_level_title(SpecialTile& special_tile) +void WorldMap::get_level_title(Level& level) { /** get special_tile's title */ - special_tile.title = "<no title>"; + level.title = "<no title>"; - LispReader* reader = LispReader::load(datadir + "/levels/" + special_tile.level_name, "supertux-level"); + LispReader* reader = LispReader::load(datadir + "/levels/" + level.name, "supertux-level"); if(!reader) { std::cerr << "Error: Could not open level file. Ignoring...\n"; return; } - reader->read_string("name", special_tile.title, true); + reader->read_string("name", level.title, true); delete reader; } void WorldMap::calculate_total_stats() { total_stats.reset(); - for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) { - if (!i->level_name.empty() && i->solved) + if (i->solved) { total_stats += i->statistics; } @@ -860,41 +843,53 @@ if (enter_level && !tux->is_moving()) { - bool level_finished = true; + /* Check special tile action */ SpecialTile* special_tile = at_special_tile(); - if (!special_tile) + if(special_tile) { - std::cout << "Nothing to enter at: " + if (special_tile->teleport_dest != Vector(-1,-1)) + { + // TODO: an animation, camera scrolling or a fading would be a nice touch + SoundManager::get()->play_sound(IDToSound(SND_WARP)); + tux->back_direction = D_NONE; + tux->set_tile_pos(special_tile->teleport_dest); + SDL_Delay(1000); + } + } + + /* Check level action */ + bool level_finished = true; + Level* level = at_level(); + if (!level) + { + std::cout << "No level to enter at: " << tux->get_tile_pos().x << ", " << tux->get_tile_pos().y << std::endl; return; } - if(!special_tile->level_name.empty()) - { - if (special_tile->x == tux->get_tile_pos().x && - special_tile->y == tux->get_tile_pos().y) + if (level->pos == tux->get_tile_pos()) { PlayerStatus old_player_status = player_status; - std::cout << "Enter the current level: " << special_tile->level_name << std::endl; - // do a shriking fade to the special_tile - shrink_fade(Vector((special_tile->x*32 + 16 + offset.x),(special_tile->y*32 + 16 + std::cout << "Enter the current level: " << level->name << std::endl; + // do a shriking fade to the level + shrink_fade(Vector((level->pos.x*32 + 16 + offset.x),(level->pos.y*32 + 16 + offset.y)), 500); - GameSession session(datadir + "/levels/" + special_tile->level_name, - ST_GL_LOAD_LEVEL_FILE, special_tile->vertical_flip, - &special_tile->statistics); + GameSession session(datadir + "/levels/" + level->name, + ST_GL_LOAD_LEVEL_FILE, level->vertical_flip, + &level->statistics); switch (session.run()) { case GameSession::ES_LEVEL_FINISHED: { level_finished = true; - bool old_level_state = special_tile->solved; - special_tile->solved = true; + bool old_level_state = level->solved; + level->solved = true; // deal with statistics - special_tile->statistics.merge(global_stats); + level->statistics.merge(global_stats); calculate_total_stats(); if (session.get_current_sector()->player->got_power != @@ -905,7 +900,7 @@ else player_status.bonus = PlayerStatus::NO_BONUS; - if (old_level_state != special_tile->solved && special_tile->auto_path) + if (old_level_state != level->solved && level->auto_path) { // Try to detect the next direction to which we should walk // FIXME: Mostly a hack Direction dir = D_NONE; @@ -934,7 +929,7 @@ break; case GameSession::ES_LEVEL_ABORT: level_finished = false; - /* In case the player's abort the special_tile, keep it using the old + /* In case the player's abort the level, keep it using the old status. But the minimum lives and no bonus. */ player_status.distros = old_player_status.distros; player_status.lives = std::min(old_player_status.lives, player_status.lives); @@ -983,30 +978,22 @@ if (!savegame_file.empty()) savegame(savegame_file); } - } /* The porpose of the next checking is that if the player lost - the special_tile (in case there is one), don't show anything */ + the level (in case there is one), don't show anything */ if(level_finished) { - if (!special_tile->extro_filename.empty()) + if (!level->extro_filename.empty()) { // Display a text file - display_text_file(special_tile->extro_filename, SCROLL_SPEED_MESSAGE, white_big_text , white_text, white_small_text, blue_text ); - } - if (special_tile->teleport_dest_x != -1 && special_tile->teleport_dest_y != -1) - { - // TODO: an animation, camera scrolling or a fading would be a nice touch - SoundManager::get()->play_sound(IDToSound(SND_WARP)); - tux->back_direction = D_NONE; - tux->set_tile_pos(Vector(special_tile->teleport_dest_x, special_tile->teleport_dest_y)); - SDL_Delay(1000); + display_text_file(level->extro_filename, SCROLL_SPEED_MESSAGE, white_big_text , white_text, white_small_text, blue_text ); } - if (!special_tile->next_worldmap.empty()) + + if (!level->next_worldmap.empty()) { // Load given worldmap - loadmap(special_tile->next_worldmap); + loadmap(level->next_worldmap); } - if (special_tile->quit_worldmap) + if (level->quit_worldmap) quit = true; } } @@ -1052,13 +1039,24 @@ return tile_manager->get(tilemap[width * y + x]); } +WorldMap::Level* +WorldMap::at_level() +{ + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) + { + if (i->pos == tux->get_tile_pos()) + return &*i; + } + + return 0; +} + WorldMap::SpecialTile* WorldMap::at_special_tile() { for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) { - if (i->x == tux->get_tile_pos().x && - i->y == tux->get_tile_pos().y) + if (i->pos == tux->get_tile_pos()) return &*i; } @@ -1075,30 +1073,29 @@ Tile* tile = at(Vector(x, y)); tile->draw(context, Vector(x*32 + offset.x, y*32 + offset.y)); } - + + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) + { + if (i->solved) + context.draw_surface(leveldot_green, + Vector(i->pos.x*32 + offset.x, i->pos.y*32 + offset.y), LAYER_TILES+1); + else + context.draw_surface(leveldot_red, + Vector(i->pos.x*32 + offset.x, i->pos.y*32 + offset.y), LAYER_TILES+1); + } + for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) { if(i->invisible) continue; - if(i->level_name.empty()) - { - if (i->teleport_dest_x != -1 && i->teleport_dest_y != -1) - context.draw_surface(teleporterdot, - Vector(i->x*32 + offset.x, i->y*32 + offset.y), LAYER_TILES+1); - - else if (!i->map_message.empty() && !i->passive_message) - context.draw_surface(messagedot, - Vector(i->x*32 + offset.x, i->y*32 + offset.y), LAYER_TILES+1); - continue; - } + if (i->teleport_dest != Vector(-1, -1)) + context.draw_surface(teleporterdot, + Vector(i->pos.x*32 + offset.x, i->pos.y*32 + offset.y), LAYER_TILES+1); - if (i->solved) - context.draw_surface(leveldot_green, - Vector(i->x*32 + offset.x, i->y*32 + offset.y), LAYER_TILES+1); - else - context.draw_surface(leveldot_red, - Vector(i->x*32 + offset.x, i->y*32 + offset.y), LAYER_TILES+1); + else if (!i->map_message.empty() && !i->passive_message) + context.draw_surface(messagedot, + Vector(i->pos.x*32 + offset.x, i->pos.y*32 + offset.y), LAYER_TILES+1); } tux->draw(context, offset); @@ -1142,13 +1139,10 @@ if (!tux->is_moving()) { - for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) { - if (i->x == tux->get_tile_pos().x && - i->y == tux->get_tile_pos().y) + if (i->pos == tux->get_tile_pos()) { - if(!i->level_name.empty()) - { if(i->title == "") get_level_title(*i); @@ -1158,8 +1152,13 @@ i->statistics.draw_worldmap_info(context); } - - /* Display an in-map message in the map, if any as been selected */ + break; + } + for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) + { + if (i->pos == tux->get_tile_pos()) + { + /* Display an in-map message in the map, if any as been selected */ if(!i->map_message.empty() && !i->passive_message) context.draw_text(gold_text, i->map_message, Vector(screen->w/2, screen->h - white_text->get_height() - 60), @@ -1243,10 +1242,9 @@ LispWriter* writer = new LispWriter(file); int nb_solved_levels = 0, total_levels = 0; - for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) { - if(!i->level_name.empty()) - ++total_levels; + ++total_levels; if (i->solved) ++nb_solved_levels; } @@ -1275,13 +1273,13 @@ writer->start_list("levels"); - for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) { - if (i->solved && !i->level_name.empty()) + if (i->solved) { writer->start_list("level"); - writer->write_string("name", i->level_name); + writer->write_string("name", i->name); writer->write_bool("solved", true); i->statistics.write(*writer); @@ -1328,10 +1326,10 @@ cur = lisp_cdr(cur); LispReader reader(cur); - /* Get the Map filename and then load it before setting special_tile settings */ + /* Get the Map filename and then load it before setting level settings */ std::string cur_map_filename = map_filename; reader.read_string("map", map_filename); - if(cur_map_filename != map_filename) +// if(cur_map_filename != map_filename) load_map(); reader.read_int("lives", player_status.lives); @@ -1375,9 +1373,9 @@ level_reader.read_string("name", name); level_reader.read_bool("solved", solved); - for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) + for(Levels::iterator i = levels.begin(); i != levels.end(); ++i) { - if (name == i->level_name) + if (name == i->name) { i->solved = solved; i->statistics.parse(level_reader); Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.187 retrieving revision 1.188 diff -u -d -r1.187 -r1.188 --- gameloop.cpp 4 Oct 2004 21:11:24 -0000 1.187 +++ gameloop.cpp 6 Oct 2004 21:37:51 -0000 1.188 @@ -443,6 +443,11 @@ player_status.lives--; last_keys.clear(); } + if(compare_last(last_keys, "grease")) + { + tux.physic.set_velocity_x(tux.physic.get_velocity_x()*3); + last_keys.clear(); + } if(compare_last(last_keys, "invincible")) { // be invincle for the rest of the level tux.invincible_timer.start(time_left.get_left()); Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- worldmap.h 4 Oct 2004 21:11:23 -0000 1.47 +++ worldmap.h 6 Oct 2004 21:37:50 -0000 1.48 @@ -158,9 +158,32 @@ public: struct SpecialTile { - int x; - int y; - std::string level_name; + Vector pos; + + /** Optional flags: */ + + /** Position to swap to player */ + Vector teleport_dest; + + /** Message to show in the Map */ + std::string map_message; + bool passive_message; + + /** Hide special tile */ + bool invisible; + + /** Only applies actions (ie. passive messages) when going to that direction */ + bool apply_action_north; + bool apply_action_east; + bool apply_action_south; + bool apply_action_west; + }; + + struct Level + { + Vector pos; + + std::string name; std::string title; bool solved; @@ -176,16 +199,6 @@ successfully completed */ std::string extro_filename; - /** Position to swap to player */ - int teleport_dest_x, teleport_dest_y; - - /** Message to show in the Map */ - std::string map_message; - bool passive_message; - - /** Hide special tile */ - bool invisible; - /** Go to this world */ std::string next_worldmap; @@ -200,12 +213,6 @@ bool east; bool south; bool west; - - /** Only applies actions (ie. passive messages) when going to that direction */ - bool apply_action_north; - bool apply_action_east; - bool apply_action_south; - bool apply_action_west; }; /** Variables to deal with the passive map messages */ @@ -218,6 +225,9 @@ typedef std::vector<SpecialTile> SpecialTiles; SpecialTiles special_tiles; + typedef std::vector<Level> Levels; + Levels levels; + MusicRef song; bool enter_level; @@ -225,7 +235,7 @@ Vector offset; std::string savegame_file; - void get_level_title(SpecialTile& special_tile); + void get_level_title(Level& level); void draw_status(DrawingContext& context); @@ -255,6 +265,8 @@ Vector get_next_tile(Vector pos, Direction direction); Tile* at(Vector pos); + + WorldMap::Level* at_level(); WorldMap::SpecialTile* at_special_tile(); /** Check if it is possible to walk from \a pos into \a direction, |
From: Ricardo C. <rm...@us...> - 2004-10-06 21:37:01
|
Update of /cvsroot/super-tux/supertux/lib/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19284/lib/math Modified Files: vector.h Log Message: Added a != operator. Index: vector.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/math/vector.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- vector.h 5 Aug 2004 20:11:30 -0000 1.5 +++ vector.h 6 Oct 2004 21:36:51 -0000 1.6 @@ -48,6 +48,11 @@ return x == other.x && y == other.y; } + bool operator !=(const Vector& other) const + { + return !(x == other.x && y == other.y); + } + const Vector& operator=(const Vector& other) { x = other.x; |
From: Ryan F. <sik...@us...> - 2004-10-06 05:20:24
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17899/src Modified Files: player.cpp Log Message: - tweaked flapping a bit, let me know what you think - it currently sets y accel to 0.5 + 0.6*xr to float - 0.5 is the minimum acceleration upwards (vs gravity) - 0.6 is how much more you can achieve with maximum x velocity - xr is a ratio of x-vel/max-x-vel - default gravity is -0.1, so at max speed with flapping you slowly gain a little height Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.180 retrieving revision 1.181 diff -u -d -r1.180 -r1.181 --- player.cpp 4 Oct 2004 21:13:16 -0000 1.180 +++ player.cpp 6 Oct 2004 05:20:07 -0000 1.181 @@ -581,15 +581,27 @@ can_flap = false; falling_from_flap = true; } - if (physic.get_velocity_x() > 0) {physic.set_velocity_x(WALK_SPEED);} - else if (physic.get_velocity_x() < 0) {physic.set_velocity_x(WALK_SPEED * (-1));} + //if (physic.get_velocity_x() > 0) {physic.set_velocity_x(WALK_SPEED);} + //else if (physic.get_velocity_x() < 0) {physic.set_velocity_x(WALK_SPEED * (-1));} jumping = true; flapping = true; - if (flapping_timer.get_gone() <= TUX_FLAPPING_TIME) + if (flapping && flapping_timer.get_gone() <= TUX_FLAPPING_TIME + && physic.get_velocity_y() < 0) { - physic.set_velocity_y((float)flapping_timer.get_gone()/700); + float gravity = Sector::current()->gravity; + float xr = (fabsf(physic.get_velocity_x()) / MAX_RUN_XM); + + //physic.set_velocity_y((float)flapping_timer.get_gone()/700); + + // XXX: magic numbers. should be a percent of gravity + // gravity is (by default) -0.1f + physic.set_acceleration_y(.05 + .06f*xr); } } + else + { + physic.set_acceleration_y(0); + } // Hover //(disabled by default, use cheat code "hover" to toggle on/off) @@ -670,6 +682,8 @@ flapping = false; falling_from_flap = false; if (flapping_timer.started()) {flapping_timer.stop();} + + physic.set_acceleration_y(0); //for flapping } input.old_up = input.up; |
From: Marek M. <wa...@us...> - 2004-10-05 22:47:20
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3149/data/levels/test Removed Files: level15.stl Log Message: removed one of the flapping levels since it doesn't work anymore --- level15.stl DELETED --- |
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14507/data/images/tilesets Modified Files: supertux.stgt Added Files: grey_jungle.png liane1.png liane2.png liane3.png liane4.png liane5.png liane6.png liane7.png liane8.png plant1.png stone1_1.png stone1_2.png stone1_3.png stone1_4.png stone2_1.png stone2_2.png stone2_3.png stone2_4.png tree_branch1.png tree_branch2.png tree_left.png tree_left_top.png tree_right.png tree_right_top.png Log Message: added some tiles created by David Kamphausen created a new forest-themed test level --- NEW FILE: stone1_2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone1_3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone2_1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone2_3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane6.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: plant1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane4.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane3.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane7.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tree_right_top.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone2_4.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone1_1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane8.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone1_4.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: stone2_2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tree_left_top.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane5.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: grey_jungle.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tree_right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: liane1.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tree_branch2.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tree_branch1.png --- (This appears to be a binary file; contents omitted.) Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.48 retrieving revision 1.49 diff -u -d -r1.48 -r1.49 --- supertux.stgt 5 Oct 2004 12:21:02 -0000 1.48 +++ supertux.stgt 5 Oct 2004 14:38:52 -0000 1.49 @@ -527,12 +527,16 @@ ;; Grasslands (tile (id 145) + (solid #t) (images "grasslands1.png")) (tile (id 146) + (solid #t) (images "grasslands2.png")) (tile (id 147) + (solid #t) (images "grasslands3.png")) (tile (id 148) + (solid #t) (images "grasslands4.png")) ;;(tile (id 149) @@ -908,6 +912,64 @@ "jungle12-3.png" "jungle12-2.png")) +; More Jungle Stuff + + (tile (id 313) + (images "stone1_1.png")) + (tile (id 314) + (images "stone1_2.png")) + (tile (id 315) + (solid #t) + (images "stone1_3.png")) + (tile (id 316) + (solid #t) + (images "stone1_4.png")) + (tile (id 317) + (images "stone2_1.png")) + (tile (id 318) + (images "stone2_2.png")) + (tile (id 319) + (solid #t) + (images "stone2_3.png")) + (tile (id 320) + (solid #t) + (images "stone2_4.png")) + (tile (id 321) + (solid #t) + (images "grey_jungle.png")) + (tile (id 322) + (images "plant1.png")) + (tile (id 323) + (images "liane1.png")) + (tile (id 324) + (images "liane2.png")) + (tile (id 325) + (images "liane3.png")) + (tile (id 326) + (images "liane4.png")) + (tile (id 327) + (images "liane5.png")) + (tile (id 328) + (images "liane6.png")) + (tile (id 329) + (images "liane7.png")) + (tile (id 330) + (images "liane8.png")) + (tile (id 331) + (images "tree_left.png")) + (tile (id 332) + (images "tree_left_top.png")) + (tile (id 333) + (images "tree_right.png")) + (tile (id 334) + (images "tree_right_top.png")) + (tile (id 335) + (solid #t) + (images "tree_branch1.png")) + (tile (id 336) + (images "tree_branch2.png")) + + ; Slopes (tile (id 400) --- NEW FILE: tree_left.png --- (This appears to be a binary file; contents omitted.) |
From: Marek M. <wa...@us...> - 2004-10-05 12:21:13
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13704/data/images/tilesets Modified Files: supertux.stgt Added Files: spike_down.png spike_left.png spike_right.png spike_up.png Removed Files: spike.png Log Message: added spikes that point in different directions out-commented para-background-tiles from supertux.stgt because they crash flexlay --- NEW FILE: spike_up.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spike_down.png --- (This appears to be a binary file; contents omitted.) Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.47 retrieving revision 1.48 diff -u -d -r1.47 -r1.48 --- supertux.stgt 18 Aug 2004 11:04:06 -0000 1.47 +++ supertux.stgt 5 Oct 2004 12:21:02 -0000 1.48 @@ -12,7 +12,7 @@ (tilegroup (name "Classic-Bg") (tiles 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101)) (tilegroup (name "Points") (tiles 132 133)) (tilegroup (name "Bonus") (tiles 44 83 84 102 140 103 104 105 112 128)) - (tilegroup (name "Misc") (tiles 75 76 200 201 79 80 126 127 129 130 134 135 81 300 173 174)) + (tilegroup (name "Misc") (tiles 75 76 200 201 79 80 126 127 129 130 134 135 81 295 296 297 298 173 174)) (tilegroup (name "Pipe") (tiles 53 54 55 56 57 58 59 60)) (tilegroup (name "Grey") (tiles 64 65 66 67 68 69)) (tilegroup (name "Signs") (tiles 136 137 138 139 141 142 143 144)) @@ -535,62 +535,62 @@ (tile (id 148) (images "grasslands4.png")) - (tile (id 149) - (images (region "snow-para-1.png" 0 0 32 32))) - (tile (id 150) - (images (region "snow-para-1.png" 32 0 32 32))) - (tile (id 151) - (images (region "snow-para-1.png" 64 0 32 32))) - - (tile (id 152) - (images (region "snow-para-1.png" 0 32 32 32))) - (tile (id 153) - (images (region "snow-para-1.png" 32 32 32 32))) - (tile (id 154) - (images (region "snow-para-1.png" 64 32 32 32))) - - (tile (id 155) - (images (region "snow-para-1.png" 0 64 32 32))) - (tile (id 156) - (images (region "snow-para-1.png" 32 64 32 32))) - (tile (id 157) - (images (region "snow-para-1.png" 64 64 32 32))) - - (tile (id 158) - (images (region "snow-para-1.png" 96 0 32 32))) - (tile (id 159) - (images (region "snow-para-1.png" 96 32 32 32))) - (tile (id 160) - (images (region "snow-para-1.png" 96 64 32 32))) - - - (tile (id 161) - (images (region "snow-para-2.png" 0 0 32 32))) - (tile (id 162) - (images (region "snow-para-2.png" 32 0 32 32))) - (tile (id 163) - (images (region "snow-para-2.png" 64 0 32 32))) - - (tile (id 164) - (images (region "snow-para-2.png" 0 32 32 32))) - (tile (id 165) - (images (region "snow-para-2.png" 32 32 32 32))) - (tile (id 166) - (images (region "snow-para-2.png" 64 32 32 32))) + ;;(tile (id 149) + ;; (images (region "snow-para-1.png" 0 0 32 32))) + ;;(tile (id 150) + ;;(images (region "snow-para-1.png" 32 0 32 32))) + ;;(tile (id 151) +;; (images (region "snow-para-1.png" 64 0 32 32))) +;; + ;;(tile (id 152) + ;;(images (region "snow-para-1.png" 0 32 32 32))) + ;;(tile (id 153) + ;;(images (region "snow-para-1.png" 32 32 32 32))) + ;;(tile (id 154) + ;;(images (region "snow-para-1.png" 64 32 32 32))) +;; + ;;(tile (id 155) + ;;(images (region "snow-para-1.png" 0 64 32 32))) + ;;(tile (id 156) + ;;(images (region "snow-para-1.png" 32 64 32 32))) + ;;(tile (id 157) + ;;(images (region "snow-para-1.png" 64 64 32 32))) +;; + ;;(tile (id 158) + ;;(images (region "snow-para-1.png" 96 0 32 32))) + ;;(tile (id 159) + ;;(images (region "snow-para-1.png" 96 32 32 32))) + ;;(tile (id 160) + ;;(images (region "snow-para-1.png" 96 64 32 32))) - (tile (id 167) - (images (region "snow-para-2.png" 0 64 32 32))) - (tile (id 168) - (images (region "snow-para-2.png" 32 64 32 32))) - (tile (id 169) - (images (region "snow-para-2.png" 64 64 32 32))) - (tile (id 170) - (images (region "snow-para-2.png" 96 0 32 32))) - (tile (id 171) - (images (region "snow-para-2.png" 96 32 32 32))) - (tile (id 172) - (images (region "snow-para-2.png" 96 64 32 32))) + ;;(tile (id 161) + ;;(images (region "snow-para-2.png" 0 0 32 32))) + ;;(tile (id 162) + ;;(images (region "snow-para-2.png" 32 0 32 32))) + ;;(tile (id 163) + ;;(images (region "snow-para-2.png" 64 0 32 32))) +;; + ;;(tile (id 164) + ;;(images (region "snow-para-2.png" 0 32 32 32))) + ;;(tile (id 165) + ;;(images (region "snow-para-2.png" 32 32 32 32))) + ;;(tile (id 166) + ;;(images (region "snow-para-2.png" 64 32 32 32))) +;; + ;;(tile (id 167) + ;;(images (region "snow-para-2.png" 0 64 32 32))) + ;;(tile (id 168) + ;;(images (region "snow-para-2.png" 32 64 32 32))) + ;;(tile (id 169) + ;;(images (region "snow-para-2.png" 64 64 32 32))) +;; + ;;(tile (id 170) + ;;(images (region "snow-para-2.png" 96 0 32 32))) + ;;(tile (id 171) + ;;(images (region "snow-para-2.png" 96 32 32 32))) + ;;(tile (id 172) + ;;(images (region "snow-para-2.png" 96 64 32 32))) ;; Lava @@ -841,11 +841,20 @@ (anim-speed 45)) - ;; Spike + ;; Spikes - (tile (id 300) + (tile (id 295) (spike #t) - (images "spike.png")) + (images "spike_up.png")) + (tile (id 296) + (spike #t) + (images "spike_right.png")) + (tile (id 297) + (spike #t) + (images "spike_down.png")) + (tile (id 298) + (spike #t) + (images "spike_left.png")) ;; Jungle --- spike.png DELETED --- --- NEW FILE: spike_right.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: spike_left.png --- (This appears to be a binary file; contents omitted.) |
From: Ricardo C. <rm...@us...> - 2004-10-04 21:13:33
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3863/src Modified Files: player.cpp Log Message: Only show combo messages after 5 combos, as suggested by guys from IRC. I don't particularly like this, but it's better than the current. I'd prefer to keep combos messages being shown after combos been made... Also, messages could be improved. Suggestions? Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.179 retrieving revision 1.180 diff -u -d -r1.179 -r1.180 --- player.cpp 3 Oct 2004 10:58:04 -0000 1.179 +++ player.cpp 4 Oct 2004 21:13:16 -0000 1.180 @@ -1172,18 +1172,25 @@ flapping = false; falling_from_flap = false; - if(player_status.score_multiplier > 1) - { // show a message + if(player_status.score_multiplier >= 5) + { // show a message char str[124]; - if (player_status.score_multiplier <= 4) {sprintf(str, _("Combo x%d"), player_status.score_multiplier);} - else if (player_status.score_multiplier == 5) {sprintf(str, _("Good! x%d"), player_status.score_multiplier);} - else if (player_status.score_multiplier == 6) {sprintf(str, _("Great! x%d"), player_status.score_multiplier);} - else if (player_status.score_multiplier == 7) {sprintf(str, _("Awesome! x%d"), player_status.score_multiplier);} - else if (player_status.score_multiplier == 8) {sprintf(str, _("Incredible! x%d"), player_status.score_multiplier);} - else if (player_status.score_multiplier == 9) {sprintf(str, _("Godlike! ;-) x%d"), player_status.score_multiplier);} - else {sprintf(str, _("Unbelievable!! x%d"), player_status.score_multiplier);} +// if (player_status.score_multiplier <= 4) {sprintf(str, _("Combo x%d"), player_status.score_multiplier);} + if (player_status.score_multiplier == 5) + sprintf(str, _("Good! x%d"), player_status.score_multiplier); + else if (player_status.score_multiplier == 6) + sprintf(str, _("Great! x%d"), player_status.score_multiplier); + else if (player_status.score_multiplier == 7) + sprintf(str, _("Awesome! x%d"), player_status.score_multiplier); + else if (player_status.score_multiplier == 8) + sprintf(str, _("Incredible! x%d"), player_status.score_multiplier); + else if (player_status.score_multiplier == 9) + sprintf(str, _("Godlike! ;-) x%d"), player_status.score_multiplier); + else + sprintf(str, _("Unbelievable!! x%d"), player_status.score_multiplier); Sector::current()->add_floating_text(base, str); - } + } + if (input.up) physic.set_velocity_y(5.2); else |
From: Ricardo C. <rm...@us...> - 2004-10-04 21:11:43
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3420/src Modified Files: worldmap.h title.cpp worldmap.cpp gameloop.cpp Log Message: Added support for tile animation on worldmap. Index: title.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/title.cpp,v retrieving revision 1.120 retrieving revision 1.121 diff -u -d -r1.120 -r1.121 --- title.cpp 24 Sep 2004 15:10:10 -0000 1.120 +++ title.cpp 4 Oct 2004 21:11:24 -0000 1.121 @@ -192,7 +192,7 @@ std::string map_filename = *it; - worldmap.loadmap(map_filename); + worldmap.set_map_filename(map_filename); // hack to erase the extension unsigned int ext_pos = it->find_last_of("."); Index: worldmap.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.cpp,v retrieving revision 1.122 retrieving revision 1.123 diff -u -d -r1.122 -r1.123 --- worldmap.cpp 22 Sep 2004 17:04:22 -0000 1.122 +++ worldmap.cpp 4 Oct 2004 21:11:24 -0000 1.123 @@ -115,13 +115,12 @@ if (strcmp(lisp_symbol(lisp_car(element)), "tile") == 0) { int id = 0; - std::string filename = "<invalid>"; Tile* tile = new Tile; tile->north = tile->east = tile->south = tile->west = true; tile->stop = true; tile->auto_walk = false; - + LispReader reader(lisp_cdr(element)); reader.read_int("id", id); @@ -148,7 +147,6 @@ reader.read_bool("stop", tile->stop); reader.read_bool("auto-walk", tile->auto_walk); - reader.read_string("image", filename); reader.read_string("one-way", temp); tile->one_way = BOTH_WAYS; @@ -164,9 +162,23 @@ tile->one_way = WEST_EAST_WAY; } - tile->sprite = new Surface( - datadir + "/images/worldmap/" + filename, - true); + std::vector<std::string> filenames; + reader.read_string_vector("image", filenames); + + if(filenames.size() == 0) + std::cerr << "Warning: no image specified for tile " << id + << ".\nIgnoring...\n" << std::endl; + + for(int i = 0; i < filenames.size(); i++) + { + Surface* image = new Surface( + datadir + "/images/worldmap/" + filenames[i], true); + tile->images.push_back(image); + } + + tile->anim_speed = 25; + reader.read_int("anim-speed", tile->anim_speed); + if (id >= int(tiles.size())) tiles.resize(id+1); @@ -423,7 +435,31 @@ Tile::~Tile() { - delete sprite; + for(std::vector<Surface*>::iterator i = images.begin(); i != images.end(); i++) + delete *i; +} + + +void +Tile::draw(DrawingContext& context, Vector pos) +{ + // same code as from tile_manager.cpp draw_tile() + + if(!images.size()) + return; + + if(images.size() > 1) + { + size_t frame + = ((global_frame_counter*25) / anim_speed) % images.size(); + +std::cerr << "frame: " << frame << std::endl; + context.draw_surface(images[frame], pos, LAYER_TILES); + } + else if (images.size() == 1) + { + context.draw_surface(images[0], pos, LAYER_TILES); + } } //--------------------------------------------------------------------------- @@ -449,6 +485,9 @@ name = "<no title>"; music = "SALCON.MOD"; + global_frame_counter = 0; + frame_timer.init(true); + total_stats.reset(); } @@ -463,6 +502,7 @@ delete teleporterdot; } +// Don't forget to set map_filename before calling this void WorldMap::load_map() { @@ -812,6 +852,12 @@ void WorldMap::update(float delta) { + if(!frame_timer.check()) + { + frame_timer.start(25); + global_frame_counter++; + } + if (enter_level && !tux->is_moving()) { bool level_finished = true; @@ -1027,8 +1073,7 @@ for(int x = 0; x < width; ++x) { Tile* tile = at(Vector(x, y)); - context.draw_surface(tile->sprite, - Vector(x*32 + offset.x, y*32 + offset.y), LAYER_TILES); + tile->draw(context, Vector(x*32 + offset.x, y*32 + offset.y)); } for(SpecialTiles::iterator i = special_tiles.begin(); i != special_tiles.end(); ++i) Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.186 retrieving revision 1.187 diff -u -d -r1.186 -r1.187 --- gameloop.cpp 20 Sep 2004 19:02:46 -0000 1.186 +++ gameloop.cpp 4 Oct 2004 21:11:24 -0000 1.187 @@ -191,8 +191,10 @@ DrawingContext context; currentsector->background->draw(context); - context.draw_text(gold_text, level->get_name(), Vector(screen->w/2, 160), - CENTER_ALLIGN, LAYER_FOREGROUND1); +// context.draw_text(gold_text, level->get_name(), Vector(screen->w/2, 160), +// CENTER_ALLIGN, LAYER_FOREGROUND1); + context.draw_center_text(gold_text, level->get_name(), Vector(0, 160), + LAYER_FOREGROUND1); sprintf(str, "TUX x %d", player_status.lives); context.draw_text(white_text, str, Vector(screen->w/2, 210), @@ -966,6 +968,7 @@ WorldMapNS::WorldMap worldmap; + worldmap.set_map_filename("icyisland.stwm"); // Load the game or at least set the savegame_file variable worldmap.loadgame(slotfile); Index: worldmap.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/worldmap.h,v retrieving revision 1.46 retrieving revision 1.47 diff -u -d -r1.46 -r1.47 --- worldmap.h 14 Sep 2004 22:26:23 -0000 1.46 +++ worldmap.h 4 Oct 2004 21:11:23 -0000 1.47 @@ -27,6 +27,7 @@ #include "audio/musicref.h" #include "video/screen.h" #include "statistics.h" +#include "special/timer.h" extern Menu* worldmap_menu; @@ -51,8 +52,11 @@ public: Tile(); ~Tile(); - - Surface* sprite; + + void draw(DrawingContext& context, Vector pos); + + std::vector<Surface*> images; + int anim_speed; // Directions in which Tux is allowed to walk from this tile bool north; @@ -230,6 +234,8 @@ Statistics total_stats; void calculate_total_stats(); + Timer frame_timer; + public: WorldMap(); ~WorldMap(); @@ -257,7 +263,8 @@ /* Save map to slot */ void savegame(const std::string& filename); - /* Load map from slot */ + /* Load map from slot + You should call set_map_filename() before this */ void loadgame(const std::string& filename); /* Load map directly from file */ void loadmap(const std::string& filename); @@ -271,6 +278,9 @@ const int& get_start_y() const { return start_y; } + void set_map_filename(std::string filename) + { map_filename = filename; } + private: void on_escape_press(); }; |
From: Benjamin P. J. <lit...@us...> - 2004-10-04 12:20:52
|
Update of /cvsroot/super-tux/supertux/data/images/shared/bigtux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8055/data/images/shared/bigtux Added Files: __bigtux.xcf Log Message: Added the source XCF of the big tux's body parts. --- NEW FILE: __bigtux.xcf --- (This appears to be a binary file; contents omitted.) |