projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SDL: Implement lightmaps smaller than the screen size. LIGHTMAP_DIV is calculated...
[supertux.git]
/
src
/
object
/
bullet.cpp
diff --git
a/src/object/bullet.cpp
b/src/object/bullet.cpp
index
e9a7c1a
..
c761735
100644
(file)
--- 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;
: 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"));
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) {
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) {
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();
}
}
life_count--;
} else
remove_me();
}
}
-void
+void
Bullet::ricochet(GameObject& , const CollisionHit& hit)
{
collision_solid(hit);
Bullet::ricochet(GameObject& , const CollisionHit& hit)
{
collision_solid(hit);