X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fobject%2Fbullet.cpp;h=564b7ba0feb44400645d93ab5b120a0f63029d11;hb=3655d32f63f75b2af054ec68d4176e55a561ba96;hp=e9a7c1a0d936e3f294c5d7dc1c6b4614e3d55a06;hpb=714a30abd887def6331a193216387e66cbfbd1bb;p=supertux.git diff --git a/src/object/bullet.cpp b/src/object/bullet.cpp index e9a7c1a0d..564b7ba0f 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,11 +84,11 @@ 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();