ig.

ParticleFast

new ParticleFast()

Base entity class for high performance particles, that don't change animations (but can animate), don't collide with map or entities, don't check against entities, etc. IMPORTANT: this removes most, if not all, of the extra functionality built into entities to try and speed up performance! IMPORTANT: this is an abstract entity that should be extended.

Author:
  • Collin Hover - collinhover.com
Source:
Example
// fast particles are meant for particles that
// - move with velocity, but ignore accel, friction, and gravity
// - don't use offsets (posDraw = pos and sizeDraw = size)
// - only ever use one animation and dont use overriding animations
// - ignore animSettings (set the animation in the initProperties)
// - don't need to flip or face different directions
// - don't need a full refresh
// - don't collide with the map or other entities
// - are always moving and changed (changed check is skipped)
// - does not link to another entity
// - does not resize except for once when added to game

checkAgainst

Fast particles check against nothing.

Default Value:
  • none
Source:

collides

Fast particles collide with nothing.

Default Value:
  • never
Source:

highPerformance

Fast particles are high performance entities.

Default Value:
  • never
Source:

performance

Fast particles are dynamic but do not collide with map.

Default Value:
  • never
Source:

type

Fast particles have no type.

Default Value:
  • never
Source:

cleanup()

Fast particle has an abbreviated cleanup.

Source:

collideWith()

Fast particles don't collide with other entities.

Source:

die()

Fast particles don't call die method, use kill instead.

Source:

draw()

Fast particles draw assuming animation exists, not fixed, no flipping, no texturing, and no angle change. IMPORTANT: all important animation and image draw code is pulled into this single method!

Source:

getIsVisible()

Fast particles are never fixed and have a simpler visible check.

Source:

handleMovementTrace()

Fast particles don't collide with collision map.

Source:

init()

Fast particles have an abbreviated init where some methods, such as initTypes and initProperties, are skipped.

Source:

kill()

Fast particles always die silently.

Source:

ready()

Fast particles have an abbreviated ready.

Source:

recordChanges()

Fast particles never records changes.

Source:

recordLast()

Fast particles never records last.

Source:

recordResetState()

Fast particles don't record reset state.

Source:

refresh()

Fast particles do refresh scale, but do not resize, reposition, or rebuild, and refresh is done only once in reset method.

Source:

reset()

Fast particles are always changed and moving, and have an abbreviated reset.

Source:

resetCore()

Fast particles do reset all in reset method.

Source:

resetExtras()

Fast particles do reset all in reset method.

Source:

spawn()

Fast particles don't call the spawn method (use ready instead).

Source:

tween()

Fast particles don't tween.

Source:

update()

Fast particles condense entire update flow into a single method.

Source:

updateBounds()

Fast particles never records last.

Source: