X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fbadguy%2Fbadguy.cpp;h=d993c0fc40c7c02894621066ce7d0eb3c6a0daf4;hb=fc73efa7ff699fe3c9c237845b6f4fda0d999862;hp=aa772a280e33fd9ae1a73d85edc99fbcc9ec430b;hpb=e6a940db5904743e8220491ce10b5107e119a44c;p=supertux.git diff --git a/src/badguy/badguy.cpp b/src/badguy/badguy.cpp index aa772a280..d993c0fc4 100644 --- a/src/badguy/badguy.cpp +++ b/src/badguy/badguy.cpp @@ -1,7 +1,7 @@ // $Id$ -// +// // SuperTux -// Copyright (C) 2005 Matthias Braun +// Copyright (C) 2006 Matthias Braun // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -12,11 +12,11 @@ // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. -// +// // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -// 02111-1307, USA. +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + #include #include "badguy.hpp" @@ -32,7 +32,7 @@ static const float X_OFFSCREEN_DISTANCE = 1600; static const float Y_OFFSCREEN_DISTANCE = 1200; BadGuy::BadGuy() - : countMe(true), sprite(0), remove_out_of_bounds(true), dir(LEFT), state(STATE_INIT) + : countMe(true), sprite(0), dir(LEFT), state(STATE_INIT) { set_group(COLGROUP_DISABLED); } @@ -62,7 +62,7 @@ BadGuy::draw(DrawingContext& context) void BadGuy::update(float elapsed_time) { - if(!Sector::current()->inside(bbox) && remove_out_of_bounds) { + if(!Sector::current()->inside(bbox)) { remove_me(); return; } @@ -165,18 +165,21 @@ BadGuy::collision_solid(GameObject& , const CollisionHit& ) } HitResponse -BadGuy::collision_player(Player& player, const CollisionHit& hit) +BadGuy::collision_player(Player& player, const CollisionHit& ) { if(player.is_invincible()) { kill_fall(); return ABORT_MOVE; } + /* printf("PlayerHit: GT %3.1f PM: %3.1f %3.1f BM: %3.1f %3.1f Hit: %3.1f %3.1f\n", game_time, player.get_movement().x, player.get_movement().y, get_movement().x, get_movement().y, hit.normal.x, hit.normal.y); + */ + // hit from above? if(player.get_movement().y /*- get_movement().y*/ > 0 && player.get_bbox().p2.y <