X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fbullet.cpp;h=c761735d5be41e29960e2b4390db9858b7132c46;hb=1dfbd27a41341f26775ca4e2b9ca4864f5744a6f;hp=e9a7c1a0d936e3f294c5d7dc1c6b4614e3d55a06;hpb=714a30abd887def6331a193216387e66cbfbd1bb;p=supertux.git diff --git a/src/object/bullet.cpp b/src/object/bullet.cpp index e9a7c1a0d..c761735d5 100644 --- a/src/object/bullet.cpp +++ b/src/object/bullet.cpp @@ -37,7 +37,7 @@ Bullet::Bullet(const Vector& pos, float xm, int dir, BonusType type) : life_count(3), type(type) { float speed = dir == RIGHT ? BULLET_XM : -BULLET_XM; - physic.vx = speed + xm; + physic.set_velocity_x(speed + xm); if(type == FIRE_BONUS) { sprite.reset(sprite_manager->create("images/objects/bullets/firebullet.sprite")); @@ -84,18 +84,18 @@ void Bullet::collision_solid(const CollisionHit& hit) { if(hit.top || hit.bottom) { - physic.vy = -physic.vy; + physic.set_velocity_y(-physic.get_velocity_y()); life_count--; } else if(hit.left || hit.right) { if(type == ICE_BONUS) { - physic.vx = -physic.vx; + physic.set_velocity_x(-physic.get_velocity_x()); life_count--; } else remove_me(); } } -void +void Bullet::ricochet(GameObject& , const CollisionHit& hit) { collision_solid(hit);