This repository has been archived on 2022-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
2022-02-07 21:38:35 +08:00
|
|
|
#include "game/action.hpp"
|
|
|
|
|
|
|
|
void Shoot(SpaceshipWeaponCmpt& weapon, const Point& dir) {
|
|
|
|
if (weapon.IsCoolDowning()) return;
|
|
|
|
|
|
|
|
Point playerCenterPos = weapon.owner->Get<MoveCmpt>()->position;
|
|
|
|
|
2022-02-09 16:44:09 +08:00
|
|
|
Entity* bullet;
|
|
|
|
bullet = weapon.ShootBullet(dir);
|
2022-02-07 21:38:35 +08:00
|
|
|
Bullets.Add(bullet);
|
|
|
|
|
|
|
|
weapon.coolDown = weapon.shootDuration;
|
|
|
|
|
|
|
|
Sounds["shoot"]->Play();
|
|
|
|
}
|