[Super-tux-commit] supertux/src/object block.cpp,1.4,1.5 growup.cpp,1.1,1.2
Brought to you by:
wkendrick
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 |