IntroObstacles

Draw special versions of obstacles used in level introductions

Author
  • Mark Mayes / mm-dev
License
  • GPL-3.0-only

Methods

(static) drawGroup(_data)

Source
Draw a group of static obstacles for the level intro screen, eg 'all the avoid obstacles for level 2'
Parameters
Name Type Description
_data object
Name Type Description
startX number

X coordinate of where to start drawing the group

startY number

Y coordinate of where to start drawing the group

obstacle_ar Array.<object>

A specially formulated array (created by IntroObstacles.getDataArrayForType() of objects containing info on how to draw the special versions of the obstacles

(static) getDataArrayForType(_type) → {Array.<object>}

Source
Get an array of objects describing the intro obstacles of a certain type for the current level
Parameters
Name Type Description
_type OBSTACLE_TYPE

The type of obstacles from this level we want to draw

Returns
  Array.<object>

An array of objects, each describing a special version of an obstacle configured for the level intro screen

(static) getGroupWidth(_data) → {number}

Source
Calculate the width of a group of intro obstacles to help with layout
Parameters
Name Type Description
_data object
Name Type Description
obstacle_ar Array.<object>

A specially formulated array (created by IntroObstacles.getDataArrayForType() of objects containing info on how to draw the special versions of the obstacles

Returns
  number

The width of the group in pixels

(static) setupForLevel()

Source
Reset some variables

(static) updateSizes()

Source
Keep sizes correct in relation to the viewport