import java.awt.image.BufferedImage; public class ShotType { private int x; private int y; private int speed; private int angle; private int damage; private int firingInterval; private BufferedImage pic; private long timeLastShot; public ShotType(final int newX, final int newY, final int newDamage, final int newSpeed, final int newInterval, final BufferedImage newPic) { this.x = newX; this.y = newY; this.speed = newSpeed; this.damage = newDamage; this.firingInterval = newInterval; this.pic = newPic; } public boolean ready() { return System.currentTimeMillis() - this.timeLastShot > this.firingInterval; } public Shot produceBullet(final int startX, final int startY) { this.timeLastShot = System.currentTimeMillis(); return new Shot(startX + this.x, startY + this.y, this.damage, this.speed, this.pic); } }