super-tux-commit Mailing List for Super Tux (Page 18)
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: Marek M. <wa...@us...> - 2004-11-24 17:34:03
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1377/src Modified Files: sector.cpp Log Message: added simple enemy dispenser (can only dispense bouncing snowballs so far and looks like a snowball) it's in data/test/bonusblocks.stl, right behind the secret area ;-) fixed typo(?) in mrbomb.cpp Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.44 retrieving revision 1.45 diff -u -d -r1.44 -r1.45 --- sector.cpp 24 Nov 2004 14:10:25 -0000 1.44 +++ sector.cpp 24 Nov 2004 17:33:49 -0000 1.45 @@ -54,6 +54,7 @@ #include "badguy/flame.h" #include "badguy/mriceblock.h" #include "badguy/mrbomb.h" +#include "badguy/dispenser.h" #include "trigger/sequence_trigger.h" #include "trigger/secretarea_trigger.h" @@ -152,6 +153,8 @@ return new MrIceBlock(reader); } else if(name == "mrbomb") { return new MrBomb(reader); + } else if(name == "dispenser") { + return new Dispenser(reader); } #if 0 else if(badguykind_from_string(name) != BAD_INVALID) { |
From: Marek M. <wa...@us...> - 2004-11-24 17:34:03
|
Update of /cvsroot/super-tux/supertux/src/badguy In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1377/src/badguy Modified Files: bouncing_snowball.cpp bouncing_snowball.h mrbomb.cpp Added Files: dispenser.cpp dispenser.h Log Message: added simple enemy dispenser (can only dispense bouncing snowballs so far and looks like a snowball) it's in data/test/bonusblocks.stl, right behind the secret area ;-) fixed typo(?) in mrbomb.cpp --- NEW FILE: dispenser.cpp --- #include <config.h> #include "dispenser.h" #include "badguy/bouncing_snowball.h" #define DISPENSE_TIME 3 Dispenser::Dispenser(LispReader& reader) { reader.read_float("x", start_position.x); reader.read_float("y", start_position.y); reader.read_string("badguy", badguy); bbox.set_size(32, 32); sprite = sprite_manager->create("snowball"); } void Dispenser::write(LispWriter& writer) { writer.start_list("dispenser"); writer.write_float("x", get_pos().x); writer.write_float("y", get_pos().y); writer.write_string("badguy", badguy); writer.end_list("dispenser"); } void Dispenser::activate() { dispense_timer.start(DISPENSE_TIME, true); } bool Dispenser::collision_squished(Player& player) { remove_me(); player.bounce(*this); return true; } void Dispenser::active_action(float elapsed_time) { if (dispense_timer.check()) { Sector::current()->add_object(new BouncingSnowball(get_pos().x, get_pos().y)); } } HitResponse Dispenser::collision_solid(GameObject& , const CollisionHit& hit) { if(fabsf(hit.normal.y) > .5) { // hit floor or roof? physic.set_velocity_y(0); } else { // hit right or left dir = dir == LEFT ? RIGHT : LEFT; sprite->set_action(dir == LEFT ? "left" : "right"); physic.set_velocity_x(-physic.get_velocity_x()); } return CONTINUE; } Index: mrbomb.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/mrbomb.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- mrbomb.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ mrbomb.cpp 24 Nov 2004 17:33:50 -0000 1.3 @@ -16,12 +16,12 @@ void MrBomb::write(LispWriter& writer) { - writer.start_list("snowball"); + writer.start_list("mrbomb"); writer.write_float("x", get_pos().x); writer.write_float("y", get_pos().y); - writer.end_list("snowball"); + writer.end_list("mrbomb"); } void --- NEW FILE: dispenser.h --- #ifndef __DISPENSER_H__ #define __DISPENSER_H__ #include "badguy.h" #include "timer.h" class Dispenser : public BadGuy { public: Dispenser(LispReader& reader); void activate(); void write(LispWriter& writer); HitResponse collision_solid(GameObject& other, const CollisionHit& hit); void active_action(float elapsed_time); protected: bool collision_squished(Player& player); std::string badguy; Timer2 dispense_timer; }; #endif Index: bouncing_snowball.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/bouncing_snowball.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bouncing_snowball.cpp 23 Nov 2004 16:47:26 -0000 1.2 +++ bouncing_snowball.cpp 24 Nov 2004 17:33:49 -0000 1.3 @@ -13,6 +13,14 @@ sprite = sprite_manager->create("bouncingsnowball"); } +BouncingSnowball::BouncingSnowball(float pos_x, float pos_y) +{ + start_position.x = pos_x; + start_position.y = pos_y; + bbox.set_size(32, 32); + sprite = sprite_manager->create("bouncingsnowball"); +} + void BouncingSnowball::write(LispWriter& writer) { Index: bouncing_snowball.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/badguy/bouncing_snowball.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- bouncing_snowball.h 20 Nov 2004 22:14:39 -0000 1.1 +++ bouncing_snowball.h 24 Nov 2004 17:33:49 -0000 1.2 @@ -7,6 +7,7 @@ { public: BouncingSnowball(LispReader& reader); + BouncingSnowball(float pos_x, float pos_y); void activate(); void write(LispWriter& writer); |
From: Matze B. <mat...@us...> - 2004-11-24 16:57:00
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25414 Modified Files: TODO Log Message: TODO update Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.88 retrieving revision 1.89 diff -u -d -r1.88 -r1.89 --- TODO 24 Nov 2004 03:42:56 -0000 1.88 +++ TODO 24 Nov 2004 16:56:32 -0000 1.89 @@ -94,6 +94,7 @@ * do we want multi hit scores again? * tux doesn't stop at igloo anymore * background particle systems are too slow - ok + * buttjump is deactivated --Code Refactoring/Cleanup/Optimisation-- [H] make the title using GameSession instead of reimplementing all the stuff |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:11
|
Update of /cvsroot/super-tux/supertux/lib/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/utils Modified Files: configfile.cpp configfile.h lispreader.cpp lispreader.h lispwriter.cpp Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: lispwriter.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/lispwriter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lispwriter.cpp 20 Nov 2004 22:14:36 -0000 1.4 +++ lispwriter.cpp 24 Nov 2004 14:10:23 -0000 1.5 @@ -21,7 +21,7 @@ #include <iostream> -#include "../utils/lispwriter.h" +#include "lispwriter.h" using namespace SuperTux; Index: configfile.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/configfile.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- configfile.cpp 20 Nov 2004 22:14:36 -0000 1.8 +++ configfile.cpp 24 Nov 2004 14:10:23 -0000 1.9 @@ -22,10 +22,10 @@ #include <cstdlib> #include <string> -#include "../utils/configfile.h" -#include "../app/setup.h" -#include "../app/globals.h" -#include "../audio/sound_manager.h" +#include "configfile.h" +#include "app/setup.h" +#include "app/globals.h" +#include "audio/sound_manager.h" using namespace SuperTux; Index: configfile.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/configfile.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- configfile.h 23 Nov 2004 16:47:23 -0000 1.6 +++ configfile.h 24 Nov 2004 14:10:23 -0000 1.7 @@ -20,7 +20,7 @@ #ifndef SUPERTUX_CONFIGFILE_H #define SUPERTUX_CONFIGFILE_H -#include "../utils/lispreader.h" +#include "lispreader.h" namespace SuperTux { Index: lispreader.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/lispreader.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- lispreader.cpp 21 Nov 2004 08:36:28 -0000 1.6 +++ lispreader.cpp 24 Nov 2004 14:10:23 -0000 1.7 @@ -31,9 +31,9 @@ #include <cstring> #include <cassert> -#include "../app/globals.h" -#include "../app/setup.h" -#include "../utils/lispreader.h" +#include "app/globals.h" +#include "app/setup.h" +#include "lispreader.h" using namespace SuperTux; Index: lispreader.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/utils/lispreader.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- lispreader.h 20 Nov 2004 22:14:36 -0000 1.4 +++ lispreader.h 24 Nov 2004 14:10:23 -0000 1.5 @@ -31,7 +31,7 @@ #include <zlib.h> -#include "../utils/exceptions.h" +#include "utils/exceptions.h" namespace SuperTux { |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:10
|
Update of /cvsroot/super-tux/supertux/lib/video In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/video Modified Files: drawing_context.cpp drawing_context.h font.cpp font.h screen.cpp surface.cpp surface.h Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: font.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- font.cpp 20 Nov 2004 22:14:37 -0000 1.14 +++ font.cpp 24 Nov 2004 14:10:24 -0000 1.15 @@ -23,11 +23,11 @@ #include <cstdlib> #include <cstring> -#include "../app/globals.h" -#include "../video/screen.h" -#include "../video/font.h" -#include "../video/drawing_context.h" -#include "../utils/lispreader.h" +#include "app/globals.h" +#include "screen.h" +#include "font.h" +#include "drawing_context.h" +#include "utils/lispreader.h" using namespace SuperTux; Index: drawing_context.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/drawing_context.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- drawing_context.cpp 23 Nov 2004 16:47:24 -0000 1.12 +++ drawing_context.cpp 24 Nov 2004 14:10:24 -0000 1.13 @@ -22,10 +22,10 @@ #include <cassert> #include <iostream> -#include "../video/drawing_context.h" -#include "../video/surface.h" -#include "../app/globals.h" -#include "../video/font.h" +#include "drawing_context.h" +#include "surface.h" +#include "app/globals.h" +#include "font.h" using namespace SuperTux; Index: drawing_context.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/drawing_context.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- drawing_context.h 23 Nov 2004 02:00:32 -0000 1.11 +++ drawing_context.h 24 Nov 2004 14:10:24 -0000 1.12 @@ -24,9 +24,9 @@ #include "SDL.h" -#include "../math/vector.h" -#include "../video/screen.h" -#include "../video/surface.h" +#include "math/vector.h" +#include "video/screen.h" +#include "video/surface.h" namespace SuperTux { Index: font.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/font.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- font.h 16 Sep 2004 15:04:16 -0000 1.9 +++ font.h 24 Nov 2004 14:10:24 -0000 1.10 @@ -23,8 +23,8 @@ #include <string> -#include "../video/surface.h" -#include "../math/vector.h" +#include "video/surface.h" +#include "math/vector.h" namespace SuperTux { Index: surface.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- surface.cpp 23 Nov 2004 16:47:24 -0000 1.17 +++ surface.cpp 24 Nov 2004 14:10:24 -0000 1.18 @@ -27,10 +27,10 @@ #include "SDL.h" #include "SDL_image.h" -#include "../video/surface.h" -#include "../video/screen.h" -#include "../app/globals.h" -#include "../app/setup.h" +#include "video/surface.h" +#include "video/screen.h" +#include "app/globals.h" +#include "app/setup.h" using namespace SuperTux; Index: surface.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/surface.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- surface.h 23 Nov 2004 16:47:24 -0000 1.9 +++ surface.h 24 Nov 2004 14:10:24 -0000 1.10 @@ -29,8 +29,8 @@ #include "SDL.h" -#include "../math/vector.h" -#include "../video/screen.h" +#include "math/vector.h" +#include "video/screen.h" namespace SuperTux { Index: screen.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/video/screen.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- screen.cpp 20 Nov 2004 22:14:37 -0000 1.6 +++ screen.cpp 24 Nov 2004 14:10:24 -0000 1.7 @@ -35,10 +35,10 @@ #include <ctype.h> #endif -#include "../video/screen.h" -#include "../app/globals.h" -#include "../video/drawing_context.h" -#include "../math/vector.h" +#include "screen.h" +#include "app/globals.h" +#include "video/drawing_context.h" +#include "math/vector.h" using namespace SuperTux; |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:09
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/special Modified Files: collision.cpp collision_hit.h frame_rate.cpp game_object.cpp moving_object.cpp sprite.cpp sprite.h sprite_data.cpp sprite_data.h sprite_manager.h timer.cpp Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: sprite_data.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite_data.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sprite_data.cpp 20 Nov 2004 22:18:32 -0000 1.1 +++ sprite_data.cpp 24 Nov 2004 14:10:23 -0000 1.2 @@ -23,10 +23,10 @@ #include <sstream> #include <stdexcept> -#include "../app/globals.h" -#include "../app/setup.h" -#include "../special/sprite.h" -#include "../video/drawing_context.h" +#include "sprite_data.h" +#include "app/globals.h" +#include "app/setup.h" +#include "video/drawing_context.h" namespace SuperTux { Index: moving_object.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/moving_object.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- moving_object.cpp 20 Nov 2004 22:14:36 -0000 1.4 +++ moving_object.cpp 24 Nov 2004 14:10:23 -0000 1.5 @@ -19,7 +19,7 @@ #include <config.h> -#include "../special/moving_object.h" +#include "moving_object.h" using namespace SuperTux; Index: frame_rate.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/frame_rate.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- frame_rate.cpp 20 Nov 2004 22:14:36 -0000 1.3 +++ frame_rate.cpp 24 Nov 2004 14:10:23 -0000 1.4 @@ -20,8 +20,8 @@ #include "SDL.h" -#include "../special/frame_rate.h" -#include "../special/timer.h" +#include "frame_rate.h" +#include "timer.h" using namespace SuperTux; Index: game_object.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/game_object.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- game_object.cpp 20 Nov 2004 22:14:36 -0000 1.4 +++ game_object.cpp 24 Nov 2004 14:10:23 -0000 1.5 @@ -19,7 +19,7 @@ #include <config.h> -#include "../special/game_object.h" +#include "special/game_object.h" namespace SuperTux { Index: sprite.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- sprite.cpp 22 Nov 2004 23:47:49 -0000 1.31 +++ sprite.cpp 24 Nov 2004 14:10:23 -0000 1.32 @@ -23,10 +23,10 @@ #include <cassert> #include <stdexcept> -#include "../app/globals.h" -#include "../app/setup.h" -#include "../special/sprite.h" -#include "../video/drawing_context.h" +#include "app/globals.h" +#include "app/setup.h" +#include "sprite.h" +#include "video/drawing_context.h" namespace SuperTux { Index: sprite_data.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite_data.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- sprite_data.h 20 Nov 2004 22:14:36 -0000 1.1 +++ sprite_data.h 24 Nov 2004 14:10:23 -0000 1.2 @@ -24,8 +24,8 @@ #include <vector> #include <map> -#include "../utils/lispreader.h" -#include "../video/surface.h" +#include "utils/lispreader.h" +#include "video/surface.h" namespace SuperTux { Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- collision.cpp 24 Nov 2004 03:42:57 -0000 1.2 +++ collision.cpp 24 Nov 2004 14:10:22 -0000 1.3 @@ -26,37 +26,38 @@ if(r1.p2.y < r2.p1.y || r1.p1.y > r2.p2.y) return false; - float xr; if(movement.x > DELTA) { hit.depth = r1.p2.x - r2.p1.x; + hit.time = hit.depth / movement.x; hit.normal.x = -1; hit.normal.y = 0; - xr = hit.depth / movement.x; } else if(movement.x < -DELTA) { hit.depth = r2.p2.x - r1.p1.x; + hit.time = hit.depth / -movement.x; hit.normal.x = 1; hit.normal.y = 0; - xr = hit.depth / -movement.x; } else { - xr = FLT_MAX; if(movement.y > -DELTA && movement.y < DELTA) { return false; } + hit.time = FLT_MAX; } if(movement.y > DELTA) { float ydepth = r1.p2.y - r2.p1.y; - float yr = ydepth / movement.y; - if(yr < xr) { + float yt = ydepth / movement.y; + if(yt < hit.time) { hit.depth = ydepth; + hit.time = yt; hit.normal.x = 0; hit.normal.y = -1; } } else if(movement.y < -DELTA) { float ydepth = r2.p2.y - r1.p1.y; - float yr = ydepth / -movement.y; - if(yr < xr) { + float yt = ydepth / -movement.y; + if(yt < hit.time) { hit.depth = ydepth; + hit.time = yt; hit.normal.x = 0; hit.normal.y = 1; } Index: sprite.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- sprite.h 20 Nov 2004 22:14:36 -0000 1.17 +++ sprite.h 24 Nov 2004 14:10:23 -0000 1.18 @@ -24,9 +24,9 @@ #include <vector> #include <map> -#include "../utils/lispreader.h" -#include "../video/surface.h" -#include "../math/vector.h" +#include "utils/lispreader.h" +#include "video/surface.h" +#include "math/vector.h" #include "sprite_data.h" namespace SuperTux Index: timer.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/timer.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- timer.cpp 20 Nov 2004 22:14:36 -0000 1.5 +++ timer.cpp 24 Nov 2004 14:10:23 -0000 1.6 @@ -21,7 +21,7 @@ #include <config.h> #include "SDL.h" -#include "../special/timer.h" +#include "timer.h" using namespace SuperTux; Index: collision_hit.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision_hit.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- collision_hit.h 20 Nov 2004 22:14:36 -0000 1.1 +++ collision_hit.h 24 Nov 2004 14:10:23 -0000 1.2 @@ -44,7 +44,9 @@ public: /// penetration depth float depth; - // The normal of the side we collided with + /// time of the collision (between 0 and 1 in relation to movement) + float time; + /// The normal of the side we collided with Vector normal; }; Index: sprite_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/sprite_manager.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sprite_manager.h 20 Nov 2004 22:14:36 -0000 1.4 +++ sprite_manager.h 24 Nov 2004 14:10:23 -0000 1.5 @@ -22,7 +22,7 @@ #include <map> -#include "../special/sprite.h" +#include "sprite.h" namespace SuperTux { |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:09
|
Update of /cvsroot/super-tux/supertux/mk/jam In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/mk/jam Modified Files: flags.jam jamcompatibility.jam objects.jam variant.jam Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: objects.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/objects.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- objects.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ objects.jam 24 Nov 2004 14:10:24 -0000 1.2 @@ -75,18 +75,15 @@ # the regexp pattern $(HDRSCAN) and then invokes $(HDRRULE) # with the scanned file as the target and the found headers # as the sources. HDRSEARCH is the value of SEARCH used for - # the found header files. Finally, if jam must deal with - # header files of the same name in different directories, - # they can be distinguished with HDRGRIST. + # the found header files. # $(SEARCH_SOURCE:E) is where cc first looks for #include # "foo.h" files. If the source file is in a distant directory, # look there. Else, look in "" (the current directory). if $(HDRRULE_$(<:S)) { - HDRS on $(<) = [ ConcatDirs $(SUBDIR) $(<:D) ] - $(SEARCH_SOURCE:E) $(HDRS) $(STDHDRS) ; - HDRGRIST on $(<) = $(HDRGRIST) ; + HDRSEARCH on $(<) = $(SEARCH_SOURCE:E) $(HDRSEARCH) $(STDHDRSEARCH) ; + SEARCH_SOURCE on $(<) = $(SEARCH_SOURCE) ; HDRRULE on $(<) = $(HDRRULE_$(<:S)) ; HDRSCAN on $(<) = $(HDRPATTERN_$(<:S)) ; } @@ -125,19 +122,26 @@ # set SEARCH so Jam can find the headers, but then say we don't # care if we can't actually find the headers (they may have been # within ifdefs), - local s = $(>:G=$(HDRGRIST:E)) ; + local HDRSEARCH = [ on $(<) GetVar HDRSEARCH ] ; + local SEARCH_SOURCE = [ on $(<) GetVar SEARCH_SOURCE ] ; + + Includes $(<) : $(>) ; + SEARCH on $(>) = $(HDRSEARCH) $(SEARCH_SOURCE)/$(<:D) ; + NoCare $(>) ; - Includes $(<) : $(s) ; - SEARCH on $(s) = $(HDRS) ; - NoCare $(s) ; - local i ; - for i in $(s) + for i in $(>) { - HDRGRIST on $(s) = $(HDRGRIST) ; - HDRS on $(s) = $(HDRS) ; - HDRRULE on $(s) = [ on $(<) GetVar HDRRULE ] ; - HDRSCAN on $(s) = [ on $(<) GetVar HDRPATTERN ] ; + + SEARCH on $(>) = $(HDRSEARCH) $(SEARCH_SOURCE)/$(<:D) ; + if $(i:D) = "" { + SEARCH_SOURCE on $(i) = $(SEARCH_SOURCE)/$(<:D) ; + } else { + SEARCH_SOURCE on $(i) = $(SEARCH_SOURCE) ; + } + HDRSEARCH on $(>) = $(HDRSEARCH) ; + HDRRULE on $(>) = [ on $(<) GetVar HDRRULE ] ; + HDRSCAN on $(>) = [ on $(<) GetVar HDRPATTERN ] ; } } @@ -148,10 +152,10 @@ rule HeaderRule { - local s = $(>:G=$(HDRGRIST:E)) ; + local s = $(>:G=$(HDRGRIST)) ; Includes $(<) : $(s) ; - SEARCH on $(s) = $(HDRS) ; + SEARCH on $(s) = $(HDRSEARCH) ; NoCare $(s) ; local i ; @@ -160,7 +164,7 @@ if $(HDRRULE_$(i:S)) { HDRGRIST on $(s) = $(HDRGRIST) ; - HDRS on $(s) = $(HDRS) ; + HDRSEARCH on $(s) = $(HDRSEARCH) ; HDRRULE on $(s) = $(HDRRULE_$(i:S)) ; HDRSCAN on $(s) = $(HDRPATTERN_$(i:S)) ; } Index: variant.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/variant.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- variant.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ variant.jam 24 Nov 2004 14:10:24 -0000 1.2 @@ -22,7 +22,7 @@ CCFLAGS += $(COMPILER_CFLAGS) $(COMPILER_CFLAGS_$(VARIANT)) ; C++FLAGS += $(COMPILER_CFLAGS) $(COMPILER_C++FLAGS) $(COMPILER_CFLAGS_$(VARIANT)) $(COMPILER_C++FLAGS_$(VARIANT)) ; -LINKLIBS += $(LDFLAGS) $(COMPILER_LFLAGS) $(COMPILER_LFLAGS_$(VARIANT)) ; +LFLAGS += $(LDFLAGS) $(COMPILER_LFLAGS) $(COMPILER_LFLAGS_$(VARIANT)) ; LOCATE_OBJECTS = $(LOCATE_OBJECTS)/$(SHORTVARIANT) ; ## SubVariant variantname Index: jamcompatibility.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/jamcompatibility.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- jamcompatibility.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ jamcompatibility.jam 24 Nov 2004 14:10:24 -0000 1.2 @@ -220,7 +220,6 @@ # directory should not hold object files, LOCATE_TARGET can # subsequently be redefined. -#echo SS: $(SUBDIR) ; SEARCH_SOURCE = $(SUBDIR) ; LOCATE_SOURCE = $(ALL_LOCATE_TARGET) $(SUBDIR) ; LOCATE_TARGET = $(ALL_LOCATE_TARGET) $(SUBDIR) ; Index: flags.jam =================================================================== RCS file: /cvsroot/super-tux/supertux/mk/jam/flags.jam,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- flags.jam 23 Nov 2004 16:47:25 -0000 1.1 +++ flags.jam 24 Nov 2004 14:10:24 -0000 1.2 @@ -124,7 +124,7 @@ ## sure the dependency scanner is able to locate your header files. The ## directories are relative to the current subdir specified with the SubDir ## rule. -## Implementation: The directories are simply added to the HDRS variable +## Implementation: The directories are simply added to the HDRSEARCH variable ## which is respected by all jam rules. rule IncludeDir { @@ -136,14 +136,14 @@ CppFlags $(<) : [ CreateIncludeFlags $(dir) ] ; # needed for header scanning - HDRS on $($(<)_SOURCES) += $(dir) ; + HDRSEARCH on $($(<)_SOURCES) += $(dir) ; } } else { for i in $(<) { dir = [ ConcatDirs $(SUBDIR) $(i) ] ; CPPFLAGS += [ CreateIncludeFlags $(dir) ] ; # needed for header scanning - HDRS += $(dir) ; + HDRSEARCH += $(dir) ; } } } |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:08
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/gui Modified Files: button.cpp button.h menu.cpp menu.h mousecursor.cpp mousecursor.h Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: mousecursor.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/mousecursor.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mousecursor.h 22 Jul 2004 19:07:50 -0000 1.4 +++ mousecursor.h 24 Nov 2004 14:10:21 -0000 1.5 @@ -22,8 +22,8 @@ #include <string> -#include "../special/timer.h" -#include "../video/surface.h" +#include "special/timer.h" +#include "video/surface.h" namespace SuperTux { Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- menu.cpp 24 Nov 2004 03:42:56 -0000 1.17 +++ menu.cpp 24 Nov 2004 14:10:21 -0000 1.18 @@ -31,13 +31,13 @@ #include <string> #include <cassert> -#include "../app/globals.h" -#include "../gui/menu.h" -#include "../video/screen.h" -#include "../video/drawing_context.h" -#include "../app/setup.h" -#include "../app/gettext.h" -#include "../math/vector.h" +#include "app/globals.h" +#include "menu.h" +#include "video/screen.h" +#include "video/drawing_context.h" +#include "app/setup.h" +#include "app/gettext.h" +#include "math/vector.h" using namespace SuperTux; Index: menu.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- menu.h 18 Nov 2004 15:09:53 -0000 1.7 +++ menu.h 24 Nov 2004 14:10:21 -0000 1.8 @@ -27,10 +27,10 @@ #include "SDL.h" -#include "../video/surface.h" -#include "../video/font.h" -#include "../special/timer.h" -#include "../gui/mousecursor.h" +#include "video/surface.h" +#include "video/font.h" +#include "special/timer.h" +#include "mousecursor.h" namespace SuperTux { Index: mousecursor.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/mousecursor.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- mousecursor.cpp 20 Nov 2004 22:14:35 -0000 1.4 +++ mousecursor.cpp 24 Nov 2004 14:10:21 -0000 1.5 @@ -19,8 +19,8 @@ #include <config.h> -#include "../video/drawing_context.h" -#include "../gui/mousecursor.h" +#include "video/drawing_context.h" +#include "gui/mousecursor.h" using namespace SuperTux; Index: button.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/button.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- button.h 24 Sep 2004 15:08:04 -0000 1.6 +++ button.h 24 Nov 2004 14:10:21 -0000 1.7 @@ -21,8 +21,8 @@ #include <vector> #include <string> -#include "../math/vector.h" -#include "../video/drawing_context.h" +#include "math/vector.h" +#include "video/drawing_context.h" namespace SuperTux { Index: button.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/button.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- button.cpp 20 Nov 2004 22:14:35 -0000 1.8 +++ button.cpp 24 Nov 2004 14:10:21 -0000 1.9 @@ -20,10 +20,10 @@ #include "SDL.h" #include <iostream> -#include "../gui/button.h" -#include "../gui/mousecursor.h" -#include "../app/globals.h" -#include "../video/font.h" +#include "button.h" +#include "mousecursor.h" +#include "app/globals.h" +#include "video/font.h" using namespace SuperTux; |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:04
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/app Modified Files: globals.h setup.cpp Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- setup.cpp 24 Nov 2004 00:44:45 -0000 1.18 +++ setup.cpp 24 Nov 2004 14:10:20 -0000 1.19 @@ -43,14 +43,14 @@ #include <cctype> -#include "../app/globals.h" -#include "../app/setup.h" -#include "../video/screen.h" -#include "../video/surface.h" -#include "../gui/menu.h" -#include "../utils/configfile.h" -#include "../audio/sound_manager.h" -#include "../app/gettext.h" +#include "globals.h" +#include "setup.h" +#include "video/screen.h" +#include "video/surface.h" +#include "gui/menu.h" +#include "utils/configfile.h" +#include "audio/sound_manager.h" +#include "gettext.h" using namespace SuperTux; Index: globals.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/globals.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- globals.h 23 Nov 2004 22:21:49 -0000 1.10 +++ globals.h 24 Nov 2004 14:10:20 -0000 1.11 @@ -26,7 +26,7 @@ #include "SDL.h" -#include "../video/font.h" +#include "video/font.h" #include "tinygettext.h" namespace SuperTux |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:04
|
Update of /cvsroot/super-tux/supertux/lib/audio In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/audio Modified Files: musicref.cpp musicref.h sound_manager.cpp sound_manager.h Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: sound_manager.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/audio/sound_manager.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- sound_manager.cpp 20 Nov 2004 22:14:35 -0000 1.5 +++ sound_manager.cpp 24 Nov 2004 14:10:20 -0000 1.6 @@ -22,11 +22,11 @@ #include <cmath> #include <cassert> -#include "../audio/sound_manager.h" -#include "../audio/musicref.h" -#include "../app/globals.h" -#include "../app/setup.h" -#include "../special/moving_object.h" +#include "audio/sound_manager.h" +#include "audio/musicref.h" +#include "app/globals.h" +#include "app/setup.h" +#include "special/moving_object.h" using namespace SuperTux; Index: sound_manager.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/audio/sound_manager.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- sound_manager.h 20 Nov 2004 22:14:35 -0000 1.7 +++ sound_manager.h 24 Nov 2004 14:10:20 -0000 1.8 @@ -25,7 +25,7 @@ #include <map> #include "SDL_mixer.h" -#include "../math/vector.h" +#include "math/vector.h" namespace SuperTux { Index: musicref.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/audio/musicref.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- musicref.h 22 Jul 2004 19:07:50 -0000 1.3 +++ musicref.h 24 Nov 2004 14:10:20 -0000 1.4 @@ -20,7 +20,7 @@ #ifndef SUPERTUX_MUSICREF_H #define SUPERTUX_MUSICREF_H -#include "../audio/sound_manager.h" +#include "sound_manager.h" namespace SuperTux { Index: musicref.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/audio/musicref.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- musicref.cpp 20 Nov 2004 22:14:35 -0000 1.4 +++ musicref.cpp 24 Nov 2004 14:10:20 -0000 1.5 @@ -20,7 +20,7 @@ #include <config.h> -#include "../audio/musicref.h" +#include "audio/musicref.h" using namespace SuperTux; |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:02
|
Update of /cvsroot/super-tux/supertux/lib/math In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/lib/math Modified Files: physic.cpp vector.cpp Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: vector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/math/vector.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- vector.cpp 20 Nov 2004 22:14:35 -0000 1.4 +++ vector.cpp 24 Nov 2004 14:10:22 -0000 1.5 @@ -21,7 +21,7 @@ #include <cmath> -#include "../math/vector.h" +#include "math/vector.h" using namespace SuperTux; Index: physic.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/math/physic.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- physic.cpp 20 Nov 2004 22:14:35 -0000 1.5 +++ physic.cpp 24 Nov 2004 14:10:22 -0000 1.6 @@ -22,8 +22,8 @@ #include <cstdio> -#include "../math/physic.h" -#include "../special/timer.h" +#include "math/physic.h" +#include "special/timer.h" using namespace SuperTux; |
From: Matze B. <mat...@us...> - 2004-11-24 14:11:02
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/data/levels/test Modified Files: bonusblock.stl Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: bonusblock.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/bonusblock.stl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- bonusblock.stl 23 Nov 2004 23:20:29 -0000 1.3 +++ bonusblock.stl 24 Nov 2004 14:10:19 -0000 1.4 @@ -6,8 +6,6 @@ (time 999) (sector (name "main") - (width 30) - (height 30) (gravity 10.000000) (background (image "arctis.jpg") (speed 0.5)) |
From: Matze B. <mat...@us...> - 2004-11-24 14:10:42
|
Update of /cvsroot/super-tux/supertux/src/object In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/src/object Modified Files: block.cpp growup.cpp Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: growup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/growup.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- growup.cpp 20 Nov 2004 22:14:40 -0000 1.1 +++ growup.cpp 24 Nov 2004 14:10:27 -0000 1.2 @@ -35,7 +35,7 @@ GrowUp::collision(GameObject& other, const CollisionHit& hit) { if(other.get_flags() & FLAG_SOLID) { - if(fabsf(hit.normal.y) > .5) { // roof + if(fabsf(hit.normal.y) > .5) { // roof or ground physic.set_velocity_y(0); } else { // bumped left or right physic.set_velocity_x(-physic.get_velocity_x()); Index: block.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/block.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- block.cpp 24 Nov 2004 03:42:57 -0000 1.4 +++ block.cpp 24 Nov 2004 14:10:27 -0000 1.5 @@ -40,8 +40,7 @@ Player* player = dynamic_cast<Player*> (&other); if(player) { // collided from below? - if(hitdata.normal.x == 0 && hitdata.normal.y < 0 - && player->get_movement().y < 0) { + if(hitdata.normal.x == 0 && hitdata.normal.y < 0) { hit(*player); } } @@ -132,7 +131,7 @@ break; case 3: // star - sector->add_object(new Star(get_pos())); + sector->add_object(new Star(get_pos() + Vector(0, -32))); break; case 4: // 1up |
From: Matze B. <mat...@us...> - 2004-11-24 14:10:41
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17739/src Modified Files: gameloop.cpp player.cpp sector.cpp Log Message: furhter improve collision detection by reintroducing time of collision, still more issues to solve Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.203 retrieving revision 1.204 diff -u -d -r1.203 -r1.204 --- player.cpp 24 Nov 2004 03:42:57 -0000 1.203 +++ player.cpp 24 Nov 2004 14:10:25 -0000 1.204 @@ -885,9 +885,9 @@ physic.set_velocity_y(.1); } - if(hit.normal.x != 0) { // hit on the side? - if(hit.normal.y > 0.6) // limits the slopes we can move up... - physic.set_velocity_x(0); + if(fabsf(hit.normal.x) > .5) { // hit on the side? + printf("s"); fflush(stdout); + physic.set_velocity_x(0); } return CONTINUE; Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- sector.cpp 24 Nov 2004 03:42:57 -0000 1.43 +++ sector.cpp 24 Nov 2004 14:10:25 -0000 1.44 @@ -635,7 +635,7 @@ CollisionHit temphit, hit; Rectangle dest = object->get_bbox(); dest.move(object->movement); - hit.depth = -1; + hit.time = -1; // represents an invalid value for(int x = starttilex; x*32 < max_x; ++x) { for(int y = starttiley; y*32 < max_y; ++y) { const Tile* tile = solids->get_tile(x, y); @@ -670,14 +670,14 @@ if(Collision::rectangle_aatriangle(temphit, dest, object->movement, triangle)) { - if(temphit.depth > hit.depth) + if(temphit.time > hit.time) hit = temphit; } } else { // normal rectangular tile Rectangle rect(x*32, y*32, (x+1)*32, (y+1)*32); if(Collision::rectangle_rectangle(temphit, dest, object->movement, rect)) { - if(temphit.depth > hit.depth) + if(temphit.time > hit.time) hit = temphit; } } @@ -685,7 +685,7 @@ } // did we collide at all? - if(hit.depth < 0) + if(hit.time < 0) return; // call collision function @@ -698,7 +698,7 @@ return; } // move out of collision and try again - object->movement += hit.normal * (hit.depth + .001); + object->movement += hit.normal * (hit.depth + .05); collision_tilemap(object, depth+1); } @@ -714,7 +714,6 @@ Vector movement = object1->get_movement() - object2->get_movement(); if(Collision::rectangle_rectangle(hit, dest1, movement, dest2)) { HitResponse response1 = object1->collision(*object2, hit); - Vector hitnormal1 = hit.normal; hit.normal *= -1; HitResponse response2 = object2->collision(*object1, hit); @@ -722,15 +721,15 @@ if(response1 == ABORT_MOVE) object1->movement = Vector(0, 0); if(response2 == CONTINUE) - object2->movement += hit.normal * (hit.depth + .1); + object2->movement += hit.normal * (hit.depth + .05); } else if(response2 != CONTINUE) { if(response2 == ABORT_MOVE) object2->movement = Vector(0, 0); if(response1 == CONTINUE) - object1->movement += hitnormal1 * (hit.depth + .1); + object1->movement += -hit.normal * (hit.depth + .05); } else { - object1->movement += hitnormal1 * (hit.depth/2 + 1); - object2->movement += hit.normal * (hit.depth/2 + 1); + object1->movement += -hit.normal * (hit.depth/2 + .05); + object2->movement += hit.normal * (hit.depth/2 + .05); } } } Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.198 retrieving revision 1.199 diff -u -d -r1.198 -r1.199 --- gameloop.cpp 24 Nov 2004 03:42:57 -0000 1.198 +++ gameloop.cpp 24 Nov 2004 14:10:25 -0000 1.199 @@ -723,6 +723,7 @@ float elapsed_time = float(ticks - lastticks) / 1000.; global_time += elapsed_time; lastticks = ticks; + // 40fps is minimum if(elapsed_time > .025) elapsed_time = .025; |
From: Ingo R. <gr...@us...> - 2004-11-24 12:57:46
|
Update of /cvsroot/super-tux/supertux/data/images/tilesets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv311 Modified Files: supertux.stgt Log Message: reordered a few tilegroups Index: supertux.stgt =================================================================== RCS file: /cvsroot/super-tux/supertux/data/images/tilesets/supertux.stgt,v retrieving revision 1.59 retrieving revision 1.60 diff -u -d -r1.59 -r1.60 --- supertux.stgt 23 Nov 2004 11:29:15 -0000 1.59 +++ supertux.stgt 24 Nov 2004 12:57:36 -0000 1.60 @@ -2,86 +2,33 @@ (supertux-tiles (tilegroup (name "Snow") - (tiles 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 30 31) - ) - (tilegroup - (name "Snow (More)") - (tiles 122 123 124 125 113 114 115 116 117 118 202 203 204 205 206 207 208 208 210) - ) - (tilegroup - (name "Darksnow") - (tiles 32 33 34 35 36 37 38 39 40 41 42 43) - ) - (tilegroup - (name "Block") - (tiles 27 28 29 47 48 49 50 51 52 61 62 77 78 211 212 213) - ) - (tilegroup - (name "Background") - (tiles 24 25 63 70 71 72 73 74 106 107 108 109 110 111) - ) - (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 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) - ) - (tilegroup - (name "Grasslands") - (tiles 145 146 147 148) - ) - (tilegroup - (name "Jungle") - (tiles 301 302 303 304 305 306 307 308 309 310 311 312) - ) - (tilegroup - (name "Slopes") - (tiles 400 401) - ) - (tilegroup - (name "Waterfall-trans") - (tiles 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194) - ) - (tilegroup - (name "Waterfall") - (tiles 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294) - ) - (tilegroup - (name "Waterfall-edgecloud") - (tiles 195 196 197 198 199) + (tiles + 7 8 9 202 + 13 14 15 204 + 10 11 12 206 + 16 17 18 205 + 22 21 207 208 + 23 20 114 113 + 31 30 115 116 + 122 123 117 118 + 124 125 19 210 + + 33 32 34 0 + 35 37 39 0 + 38 36 43 0 + 40 41 42 0 +) ) (tilegroup - (name "forest") + (name "Forest (Foreground)") (tiles 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 - 0 1060 1061 1062 + 0 1060 1061 0 1063 1064 1065 1066 1067 1068 1069 1070 1045 1046 1051 1052 @@ -93,7 +40,11 @@ 1036 1037 0 1038 1020 1021 1022 1044 1023 1024 1025 1033 - 1026 1027 1028 1039 + 1026 1027 1028 1039 )) + + (tilegroup + (name "Forest (Background)") + (tiles 0 0 1073 1074 0 0 1081 1082 0 1088 1089 1090 @@ -213,8 +164,76 @@ 457 -) +)) + + (tilegroup + (name "Block") + (tiles + 27 28 29 47 + 48 50 49 211 + 77 51 52 212 + 78 62 61 213 + 44 83 84 102 140 103 104 105 112 128) + ) + (tilegroup + (name "Background") + (tiles + 106 107 108 24 + 109 110 111 25 + 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 "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 55 0 0 + 54 56 0 0 + 57 58 0 0 + 59 60 0 0 ) ) + (tilegroup + (name "Grey") + (tiles 64 65 66 67 68 69) + ) + (tilegroup + (name "Signs") + (tiles 136 137 141 142 + 138 139 143 144 ) + ) + (tilegroup + (name "Grasslands") + (tiles 145 146 147 148) + ) + (tilegroup + (name "Jungle") + (tiles 301 302 303 312 + 304 305 306 0 + 307 308 309 0 + 310 311 0 0 ) + ) + (tilegroup + (name "Slopes") + (tiles 400 401) + ) + (tilegroup + (name "Waterfall-trans") + (tiles 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194) + ) + (tilegroup + (name "Waterfall") + (tiles 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294) + ) + (tilegroup + (name "Waterfall-edgecloud") + (tiles 195 196 197 198 199) + ) (tile (id 0) (editor-images "bonus-fireflower.png") |
From: Matze B. <mat...@us...> - 2004-11-24 03:43:19
|
Update of /cvsroot/super-tux/supertux/lib/special In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22752/lib/special Modified Files: collision.cpp collision.h Log Message: Improved collision detection by taking movement into account. Fixed long standing bug where returning from bonuslevel to mainmenu and going back to bonuslevels makes supertux crash Index: collision.h =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- collision.h 20 Nov 2004 22:14:36 -0000 1.1 +++ collision.h 24 Nov 2004 03:42:57 -0000 1.2 @@ -4,6 +4,7 @@ namespace SuperTux { +class Vector; class Rectangle; class CollisionHit; class AATriangle; @@ -15,13 +16,13 @@ * collision and fills in the hit structure then. */ static bool rectangle_rectangle(CollisionHit& hit, const Rectangle& r1, - const Rectangle& r2); + const Vector& movement, const Rectangle& r2); /** does collision detection between a rectangle and an axis aligned triangle * Returns true in case of a collision and fills in the hit structure then. */ static bool rectangle_aatriangle(CollisionHit& hit, const Rectangle& rect, - const AATriangle& triangle); + const Vector& movement, const AATriangle& triangle); }; } Index: collision.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/special/collision.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- collision.cpp 20 Nov 2004 22:14:36 -0000 1.1 +++ collision.cpp 24 Nov 2004 03:42:57 -0000 1.2 @@ -15,38 +15,51 @@ namespace SuperTux { +static const float DELTA = .0001; + bool Collision::rectangle_rectangle(CollisionHit& hit, const Rectangle& r1, - const Rectangle& r2) + const Vector& movement, const Rectangle& r2) { if(r1.p2.x < r2.p1.x || r1.p1.x > r2.p2.x) return false; if(r1.p2.y < r2.p1.y || r1.p1.y > r2.p2.y) return false; - - hit.depth = r1.p2.x - r2.p1.x; - hit.normal.x = -1; - hit.normal.y = 0; - float px2 = r2.p2.x - r1.p1.x; - if(px2 < hit.depth) { - hit.depth = px2; + float xr; + if(movement.x > DELTA) { + hit.depth = r1.p2.x - r2.p1.x; + hit.normal.x = -1; + hit.normal.y = 0; + xr = hit.depth / movement.x; + } else if(movement.x < -DELTA) { + hit.depth = r2.p2.x - r1.p1.x; hit.normal.x = 1; hit.normal.y = 0; + xr = hit.depth / -movement.x; + } else { + xr = FLT_MAX; + if(movement.y > -DELTA && movement.y < DELTA) { + return false; + } } - float py1 = r1.p2.y - r2.p1.y; - if(py1 < hit.depth) { - hit.depth = py1; - hit.normal.x = 0; - hit.normal.y = -1; - } - - float py2 = r2.p2.y - r1.p1.y; - if(py2 < hit.depth) { - hit.depth = py2; - hit.normal.x = 0; - hit.normal.y = 1; + if(movement.y > DELTA) { + float ydepth = r1.p2.y - r2.p1.y; + float yr = ydepth / movement.y; + if(yr < xr) { + hit.depth = ydepth; + hit.normal.x = 0; + hit.normal.y = -1; + } + } else if(movement.y < -DELTA) { + float ydepth = r2.p2.y - r1.p1.y; + float yr = ydepth / -movement.y; + if(yr < xr) { + hit.depth = ydepth; + hit.normal.x = 0; + hit.normal.y = 1; + } } return true; @@ -65,9 +78,9 @@ bool Collision::rectangle_aatriangle(CollisionHit& hit, const Rectangle& rect, - const AATriangle& triangle) + const Vector& movement, const AATriangle& triangle) { - if(!rectangle_rectangle(hit, rect, (const Rectangle&) triangle)) + if(!rectangle_rectangle(hit, rect, movement, (const Rectangle&) triangle)) return false; Vector normal; |
From: Matze B. <mat...@us...> - 2004-11-24 03:43:10
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22752/src/trigger Modified Files: secretarea_trigger.cpp secretarea_trigger.h Log Message: Improved collision detection by taking movement into account. Fixed long standing bug where returning from bonuslevel to mainmenu and going back to bonuslevels makes supertux crash Index: secretarea_trigger.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- secretarea_trigger.h 23 Nov 2004 23:20:32 -0000 1.2 +++ secretarea_trigger.h 24 Nov 2004 03:42:58 -0000 1.3 @@ -14,7 +14,7 @@ { public: SecretAreaTrigger(LispReader& reader); - SecretAreaTrigger(const Vector& pos, const std::string& sequence); + SecretAreaTrigger(const Vector& pos); ~SecretAreaTrigger(); void write(LispWriter& writer); Index: secretarea_trigger.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- secretarea_trigger.cpp 23 Nov 2004 23:20:31 -0000 1.2 +++ secretarea_trigger.cpp 24 Nov 2004 03:42:58 -0000 1.3 @@ -13,8 +13,7 @@ reader.read_string("message", message); } -SecretAreaTrigger::SecretAreaTrigger(const Vector& pos, - const std::string& secretarea) +SecretAreaTrigger::SecretAreaTrigger(const Vector& pos) { bbox.set_pos(pos); bbox.set_size(32, 32); |
From: Matze B. <mat...@us...> - 2004-11-24 03:43:09
|
Update of /cvsroot/super-tux/supertux/src/object In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22752/src/object Modified Files: block.cpp Log Message: Improved collision detection by taking movement into account. Fixed long standing bug where returning from bonuslevel to mainmenu and going back to bonuslevels makes supertux crash Index: block.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/object/block.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- block.cpp 23 Nov 2004 14:32:19 -0000 1.3 +++ block.cpp 24 Nov 2004 03:42:57 -0000 1.4 @@ -35,22 +35,18 @@ HitResponse Block::collision(GameObject& other, const CollisionHit& hitdata) { - if(bouncing) - return FORCE_MOVE; - // TODO kill badguys when bumping them... Player* player = dynamic_cast<Player*> (&other); - if(!player) - return ABORT_MOVE; - - // collided from below? - if(hitdata.normal.x == 0 && hitdata.normal.y < 0 - && player->get_movement().y < 0) { - hit(*player); + if(player) { + // collided from below? + if(hitdata.normal.x == 0 && hitdata.normal.y < 0 + && player->get_movement().y < 0) { + hit(*player); + } } - return ABORT_MOVE; + return FORCE_MOVE; } void @@ -61,9 +57,9 @@ float offset = original_y - get_pos().y; if(offset > BOUNCY_BRICK_MAX_OFFSET) { - bounce_dir *= -1; + bounce_dir = BOUNCY_BRICK_SPEED; movement = Vector(0, bounce_dir * elapsed_time); - } else if(offset < -EPSILON) { + } else if(offset < BOUNCY_BRICK_SPEED * elapsed_time && bounce_dir > 0) { movement = Vector(0, offset); bounce_dir = 0; bouncing = false; |
From: Matze B. <mat...@us...> - 2004-11-24 03:43:08
|
Update of /cvsroot/super-tux/supertux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22752 Modified Files: TODO Log Message: Improved collision detection by taking movement into account. Fixed long standing bug where returning from bonuslevel to mainmenu and going back to bonuslevels makes supertux crash Index: TODO =================================================================== RCS file: /cvsroot/super-tux/supertux/TODO,v retrieving revision 1.87 retrieving revision 1.88 diff -u -d -r1.87 -r1.88 --- TODO 23 Nov 2004 15:36:49 -0000 1.87 +++ TODO 24 Nov 2004 03:42:56 -0000 1.88 @@ -41,7 +41,7 @@ --Collision Detection Rewrite (all [H])-- * make blocks bounce again - ok * bonusblocks don't always bounce back to their original position (but stay a - few pixels higher) + few pixels higher) - hopefully ok * it's impossible to go into passages that have exactly the size of tux, either reduce collision rectangle by DELTA or round collision coordinates to integers... @@ -73,6 +73,9 @@ * rework collision detection to take movement into account - this should fix the egg suddenly turning directions and the somtimes strange behaviour when hitting a block from the side when falling. + - done for rectangles, fixes the issues with blocks and enemies hitting + when they should get squished, still it's not optimal as when hitting 2 + blocks now only 1 gets cleared... * rethink slopes collision feedback... tux becomes too slow when walking up and starts jumping when walking down * think about an attachement mechanism for moving platforms |
From: Matze B. <mat...@us...> - 2004-11-24 03:43:07
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22752/src Modified Files: gameloop.cpp player.cpp sector.cpp Log Message: Improved collision detection by taking movement into account. Fixed long standing bug where returning from bonuslevel to mainmenu and going back to bonuslevels makes supertux crash Index: player.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/player.cpp,v retrieving revision 1.202 retrieving revision 1.203 diff -u -d -r1.202 -r1.203 --- player.cpp 23 Nov 2004 22:44:31 -0000 1.202 +++ player.cpp 24 Nov 2004 03:42:57 -0000 1.203 @@ -728,7 +728,7 @@ else tux_body = big_tux; - int layer = LAYER_OBJECTS - 1; + int layer = LAYER_OBJECTS + 10; /* Set Tux sprite action */ if (duck && size == BIG) @@ -858,15 +858,15 @@ && !dying) { if (size == SMALL || duck) - smalltux_star->draw(context, get_pos(), LAYER_OBJECTS + 2); + smalltux_star->draw(context, get_pos(), layer + 5); else - bigtux_star->draw(context, get_pos(), LAYER_OBJECTS + 2); + bigtux_star->draw(context, get_pos(), layer + 5); } if (debug_mode) context.draw_filled_rect(get_pos(), Vector(bbox.get_width(), bbox.get_height()), - Color(75,75,75, 150), LAYER_OBJECTS+1); + Color(75,75,75, 150), LAYER_OBJECTS+20); } HitResponse @@ -882,7 +882,7 @@ physic.set_velocity_y(0); on_ground_flag = true; } else if(hit.normal.y > 0) { // bumped against the roof - physic.set_velocity_y(0); + physic.set_velocity_y(.1); } if(hit.normal.x != 0) { // hit on the side? Index: sector.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/sector.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- sector.cpp 23 Nov 2004 22:22:14 -0000 1.42 +++ sector.cpp 24 Nov 2004 03:42:57 -0000 1.43 @@ -668,13 +668,15 @@ break; } - if(Collision::rectangle_aatriangle(temphit, dest, triangle)) { + if(Collision::rectangle_aatriangle(temphit, dest, object->movement, + triangle)) { if(temphit.depth > hit.depth) hit = temphit; } } else { // normal rectangular tile Rectangle rect(x*32, y*32, (x+1)*32, (y+1)*32); - if(Collision::rectangle_rectangle(temphit, dest, rect)) { + if(Collision::rectangle_rectangle(temphit, dest, + object->movement, rect)) { if(temphit.depth > hit.depth) hit = temphit; } @@ -683,7 +685,7 @@ } // did we collide at all? - if(hit.depth == -1) + if(hit.depth < 0) return; // call collision function @@ -708,19 +710,27 @@ dest1.move(object1->get_movement()); Rectangle dest2 = object2->get_bbox(); dest2.move(object2->get_movement()); - if(Collision::rectangle_rectangle(hit, dest1, dest2)) { - HitResponse response = object1->collision(*object2, hit); - if(response == ABORT_MOVE) { - object1->movement = Vector(0, 0); - } else if(response == CONTINUE) { - object1->movement += hit.normal * (hit.depth/2 + .001); - } + + Vector movement = object1->get_movement() - object2->get_movement(); + if(Collision::rectangle_rectangle(hit, dest1, movement, dest2)) { + HitResponse response1 = object1->collision(*object2, hit); + Vector hitnormal1 = hit.normal; hit.normal *= -1; - response = object2->collision(*object1, hit); - if(response == ABORT_MOVE) { - object2->movement = Vector(0, 0); - } else if(response == CONTINUE) { - object2->movement += hit.normal * (hit.depth/2 + .001); + HitResponse response2 = object2->collision(*object1, hit); + + if(response1 != CONTINUE) { + if(response1 == ABORT_MOVE) + object1->movement = Vector(0, 0); + if(response2 == CONTINUE) + object2->movement += hit.normal * (hit.depth + .1); + } else if(response2 != CONTINUE) { + if(response2 == ABORT_MOVE) + object2->movement = Vector(0, 0); + if(response1 == CONTINUE) + object1->movement += hitnormal1 * (hit.depth + .1); + } else { + object1->movement += hitnormal1 * (hit.depth/2 + 1); + object2->movement += hit.normal * (hit.depth/2 + 1); } } } @@ -737,7 +747,7 @@ MovingObject* movingobject = dynamic_cast<MovingObject*> (gameobject); if(!movingobject) continue; - + // collision with tilemap if(! (movingobject->movement == Vector(0, 0))) collision_tilemap(movingobject, 0); @@ -755,7 +765,7 @@ collision_object(movingobject, movingobject2); } - + movingobject->bbox.move(movingobject->get_movement()); movingobject->movement = Vector(0, 0); } Index: gameloop.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/gameloop.cpp,v retrieving revision 1.197 retrieving revision 1.198 diff -u -d -r1.197 -r1.198 --- gameloop.cpp 23 Nov 2004 13:41:23 -0000 1.197 +++ gameloop.cpp 24 Nov 2004 03:42:57 -0000 1.198 @@ -724,8 +724,8 @@ global_time += elapsed_time; lastticks = ticks; // 40fps is minimum - if(elapsed_time > .05) - elapsed_time = .05; + if(elapsed_time > .025) + elapsed_time = .025; /* Handle events: */ currentsector->player->input.old_fire = currentsector->player->input.fire; |
From: Matze B. <mat...@us...> - 2004-11-24 03:43:06
|
Update of /cvsroot/super-tux/supertux/lib/gui In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22752/lib/gui Modified Files: menu.cpp Log Message: Improved collision detection by taking movement into account. Fixed long standing bug where returning from bonuslevel to mainmenu and going back to bonuslevels makes supertux crash Index: menu.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/gui/menu.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- menu.cpp 18 Nov 2004 15:09:53 -0000 1.16 +++ menu.cpp 24 Nov 2004 03:42:56 -0000 1.17 @@ -347,6 +347,7 @@ Menu::clear() { item.clear(); + active_item = 0; } /* Process actions done on the menu */ |
From: Matze B. <mat...@us...> - 2004-11-24 00:44:55
|
Update of /cvsroot/super-tux/supertux/lib/app In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15155/lib/app Modified Files: setup.cpp Log Message: set package name before setting up directories Index: setup.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/lib/app/setup.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- setup.cpp 23 Nov 2004 22:21:49 -0000 1.17 +++ setup.cpp 24 Nov 2004 00:44:45 -0000 1.18 @@ -256,12 +256,12 @@ const std::string& _package_symbol_name, const std::string& _package_version) { - directories(); - dictionary_manager.add_directory(datadir + "/locale"); - package_name = _package_name; - package_symbol_name = _package_symbol_name; + package_symbol_name = _package_symbol_name; package_version = _package_version; + + directories(); + dictionary_manager.add_directory(datadir + "/locale"); } /* --- SETUP --- */ |
From: Marek M. <wa...@us...> - 2004-11-23 23:20:54
|
Update of /cvsroot/super-tux/supertux/data/levels/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27081/data/levels/test Modified Files: bonusblock.stl Log Message: made secret area trigger work TODO: Prevent message from scrolling away with the level (the secret area is in data/levels/test/bonusblock.stl, just hop around on the stones you start on) Index: bonusblock.stl =================================================================== RCS file: /cvsroot/super-tux/supertux/data/levels/test/bonusblock.stl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- bonusblock.stl 23 Nov 2004 22:11:05 -0000 1.2 +++ bonusblock.stl 23 Nov 2004 23:20:29 -0000 1.3 @@ -11,7 +11,7 @@ (gravity 10.000000) (background (image "arctis.jpg") (speed 0.5)) - (secretarea (x 64) (y 896) (message "You found a secret area!")) + (secretarea (x 128) (y 128) (message "You found a secret area!")) (spawn-points (name "main") (x 100) @@ -52,7 +52,7 @@ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 - 0 200 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 + 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 )) (tilemap @@ -68,7 +68,7 @@ 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 - 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 + 61 0 0 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 61 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 61 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 61 |
From: Marek M. <wa...@us...> - 2004-11-23 23:20:52
|
Update of /cvsroot/super-tux/supertux/src/trigger In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27081/src/trigger Modified Files: secretarea_trigger.cpp secretarea_trigger.h Log Message: made secret area trigger work TODO: Prevent message from scrolling away with the level (the secret area is in data/levels/test/bonusblock.stl, just hop around on the stones you start on) Index: secretarea_trigger.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- secretarea_trigger.h 23 Nov 2004 22:11:09 -0000 1.1 +++ secretarea_trigger.h 23 Nov 2004 23:20:32 -0000 1.2 @@ -6,6 +6,9 @@ #include "resources.h" #include "video/drawing_context.h" #include "app/globals.h" +#include "timer.h" + +#define MESSAGE_TIME 3 class SecretAreaTrigger : public TriggerBase, public Serializable { @@ -19,9 +22,8 @@ void draw(DrawingContext& context); private: - EventType triggerevent; std::string message; - int show_message; + Timer2 message_timer; }; #endif Index: secretarea_trigger.cpp =================================================================== RCS file: /cvsroot/super-tux/supertux/src/trigger/secretarea_trigger.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- secretarea_trigger.cpp 23 Nov 2004 22:11:09 -0000 1.1 +++ secretarea_trigger.cpp 23 Nov 2004 23:20:31 -0000 1.2 @@ -18,8 +18,7 @@ { bbox.set_pos(pos); bbox.set_size(32, 32); - triggerevent = EVENT_TOUCH; - show_message = 0; + message = "You found a secret area!"; } SecretAreaTrigger::~SecretAreaTrigger() @@ -43,16 +42,20 @@ void SecretAreaTrigger::draw(DrawingContext& context) { - if (show_message == 1) { - context.draw_center_text(gold_text, message, Vector(0, screen->h/2 - gold_text->get_height()/2), LAYER_GUI); - std::cout<<message<<std::endl; + if (message_timer.started()) { + Vector pos = Vector(0, screen->h/2 - gold_text->get_height()/2); + context.draw_center_text(gold_text, message, pos, LAYER_GUI); + //TODO: Prevent text from scrolling with the rest of the level + } + if (message_timer.check()) { + remove_me(); } } void SecretAreaTrigger::event(Player& , EventType type) { - if(type == triggerevent) { - show_message = 1; + if(type == EVENT_TOUCH) { + message_timer.start(MESSAGE_TIME); } } |
From: Matze B. <mat...@us...> - 2004-11-23 22:51:36
|
Update of /cvsroot/super-tux/supertux/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20431/src Modified Files: timer.h Log Message: docu improvement for Timer Index: timer.h =================================================================== RCS file: /cvsroot/super-tux/supertux/src/timer.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- timer.h 23 Nov 2004 22:22:14 -0000 1.18 +++ timer.h 23 Nov 2004 22:51:03 -0000 1.19 @@ -12,12 +12,14 @@ Timer2(); ~Timer2(); - /** start the timer with the given period. If cyclic=true then the timer willl - * be reset after each period. + /** start the timer with the given period (in seconds). + * If cyclic=true then the timer willl be reset after each period. * Set period to zero if you want to disable the timer. */ void start(float period, bool cyclic = false); - /** returns true if a period (or more) passed */ + /** returns true if a period (or more) passed since start call or last + * successfull check + */ bool check(); /** returns the period of the timer or 0 if it isn't started */ |