Changed horizontal location bullets are spawned.
The previous method was inconsistent between the left and right directions; it placed the left edge of the bullet on the left edge of the ship when going to the right, and in the center of the ship when going left. This was barely noticeable with small ships, but more noticeable with large ships. The method also sometimes made the backs of bullets visible behind the smaller ships, which looked kind of ugly. Now, the back edge of the bullet is consistently placed in the center of the ship.
This commit is contained in:
parent
bb0d6b4849
commit
199ee7a58b
|
@ -32,7 +32,8 @@ void addBullet(object *theWeapon, object *attacker, int y, int dy)
|
||||||
|
|
||||||
bullet->next = NULL;
|
bullet->next = NULL;
|
||||||
bullet->active = true;
|
bullet->active = true;
|
||||||
bullet->x = attacker->x - ((attacker->image[0]->w / 2) * attacker->face);
|
bullet->x = attacker->x + (attacker->image[0]->w / 2) -
|
||||||
|
(theWeapon->image[0]->w * attacker->face);
|
||||||
bullet->y = attacker->y + y;
|
bullet->y = attacker->y + y;
|
||||||
bullet->flags = theWeapon->flags;
|
bullet->flags = theWeapon->flags;
|
||||||
bullet->shield = 300; // bullets live for (approximately) 5 seconds
|
bullet->shield = 300; // bullets live for (approximately) 5 seconds
|
||||||
|
|
Loading…
Reference in New Issue