#include "Shotgun.h" Shotgun::Shotgun() { damage = 20; speed = 5; size = 1; curProjectile = 0; setImage("weapons.png"); setClip(0, 100, 0, 100, 50); } void Shotgun::attack() { // Shoots 3 bullets in a row for (int i = 0; i < 3; i++) { projectiles[curProjectile].setX(getX() + 50); projectiles[curProjectile].setY(getY() - 50 + (i * 30)); projectiles[curProjectile].setActive(true); if (curProjectile < 9) { curProjectile++; } else { curProjectile = 0; } } }