RotatingShooter

RotatingShooter

A RotatingTraveler that is also set up to shoot BlittedTraveler bullets.


Constructor

new RotatingShooter(wd, source, canvas, fromRect, x, y, width, height, rotationImage, rotationFromRect, bulletCanvas, bulletFromRect, bulletMap)

Parameters:
Name Type Description
wd WayDeterminer
source Image
canvas CanvasObject
fromRect Rectangle
x Number
y Number
width Number
height Number
rotationImage CanvasObject
rotationFromRect Rectangle
bulletCanvas CanvasObject
bulletFromRect Rectangle
bulletMap Array

If set then the bullets shot will be MapTravelers instead of BlittedTravelers.

Members

_bulletCanvas

bulletFromRect

bulletHolder

bulletSpeed

constructor

Methods

reclaimBullet(b)

Resets the bullets x y and veloc and puts it back into bulletHolder.

Parameters:
Name Type Description
b

reload(amount)

Populates bulletHolder with the given amount of bullets ready to be shot.

Parameters:
Name Type Description
amount Number

shoot() → {BlittedTraveler|MapTraveler}

Shoots a bullet, the x and y position and _veloc is adjusted to shoot from the middle of the RotatingShooter.

Returns:
Type
BlittedTraveler | MapTraveler