Module: monsters

Uses string in base[3] to select a sprite.
Author:
  • Robert Laing
Source:

Namespaces

monster

Methods

(static) init()()

Source:

(static) render()()

Source:

(static) send()

Source:

(static) update()()

Source:

(inner) calcAngle()

up is -90, down is +90 (vertically flipped cartesian plane) offset by - Math.PI/2 because sprites are facing 90, not 0
Source:

(inner) draw()

needed to guard against undefined monster.frame for some reason when selected clicked on bees monsters[monster.name].frames[monster.action][monster.frame] stops garbled sprites, but causes sprite to vanish
Source:

(inner) nextFrame()

TODO make more elaborate to remove killed monsters on last death frame etc
Source:

(inner) startMove()

eg {"black":["move","e",1,"e",3]}
Source: