Class: BHell_Generator

BHell.BHell_Generator()

new BHell_Generator()

Enemy generator class. Periodically spawns an enemy.

Source:

Methods

initialize(x, y, image, name, n, period, sync, stop, comments, enemies, parent)

Constructor. The enemy parameters are defined at three different levels:

  1. Enemy class default values,
  2. JSON configuration file,
  3. Game Event's comments.

Each level overrides the previous one, allowing a fine grained control over each generator.

Parameters:
Name Type Description
x

X spawning coordinate.

y

Y spawning coordinate.

image

Sprite for the spawned enemies.

name

Enemy name (from the JSON configuration file).

n

Number of enemies to be generated.

period

Spawn period in frames (i.e. 60 generates an enemy every second).

sync

True if the stage must wait for every enemy of this generator to be spawned.

stop

True if the map should stop when this generator is active.

comments

RPGMaker's Comment string containing overridden parameters for the enemies.

enemies

Array where the enemies will be pushed.

parent

Container for the Sprite objects.

Source:

update()

Updates the generator (called every frame). If there are enemies left to be spawned, spawn one every this.period frames.

Source: