Members
-
actions :Array
-
List of input actions, that tell tutorial it has been completed.
- Source:
-
activateCallback :function
-
Function called on activate.
- do not use this for predefined entity classes, override activate instead- Inherited From:
- Source:
-
activateContext :Object
-
Context to execute activate callback function in.
- do not use this for predefined entity classes, override activate instead- Inherited From:
- Source:
-
activated :Boolean
-
Whether entity's activate has been triggered,
- set to true to have an entity activate on init- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> added :Boolean
-
Whether entity has been added to game world.
- Inherited From:
- Default Value:
- false
- Source:
-
alpha :Number
-
Entity alpha. IMPORTANT: applied to animations automatically on draw.
- Inherited From:
- Default Value:
- 1
- Source:
-
alwaysToggleActivate :Boolean
-
Whether entity's activate should override deactivate.
- Inherited From:
- Default Value:
- false
- Source:
-
angle :Number
-
Angle of rotation in radians.
- Inherited From:
- Default Value:
- 0
- Source:
-
animationType :Number
-
Type of animation from ig.EntityExtended#animationTypes.
- used when creating animations from ig.EntityExtended#animSettings- Inherited From:
- Default Value:
- 0
- Source:
-
animationTypes :Array
-
Types of animation.
- used when creating animations from ig.EntityExtended#animSettings- Inherited From:
- Default Value:
- null
- Source:
-
animFrameTime :Number
-
Default frame time in seconds for animations when not defined in ig.EntityExtended#animSettings.
- used when creating animations from ig.EntityExtended#animSettings- Inherited From:
- Default Value:
- 1
- Source:
-
animInit :String
-
Name of animation to play when entity is ready and after spawned.
- Inherited From:
- Source:
-
animSequenceCount :Number
-
Default sequence frame count for animations when not defined in ig.EntityExtended#animSettings.
- used when creating animations from ig.EntityExtended#animSettings- Inherited From:
- Default Value:
- 1
- Source:
-
animSettings :Object
-
Animation settings used to automatically create and add animations on initialization.
- use this instead of hardcoding animations into ig.EntityExtended#init for better inheritance!- Inherited From:
- Default Value:
- null
- Source:
// previous method of adding animations // this would likely be hardcoded into the init method this.addAnim( 'idleX', 0.25, [0,1] ); // new (and improved?) method of adding animations // which would be defined in the class properties // properties match the parameters passed to ig.AnimationExtended#init animSettings: { // note here the directional animation name // animations in Impact++ are directional and based on flip and facing // so if an entity can flip X // you should have animations for X // i.e. "idleX" // but if an entity can flip X and Y // you should have animations for both X and Y // i.e. "idleX" and "idleY" // if an entity cannot flip X and Y // you should have animations for Up, Down, Left, and Right // i.e. "idleUp", "idleDown", "idleLeft", "idleRight" idleX: { // sequence frames 0 and 1 sequence: [0,1], // quarter second per frame frameTime: 0.25, // play only once once: true, // do not play immediately stop: true // play animation in reverse reverse: true } } // then to easily change the sequence in a descendant class // while retaining the original properties animSettings: { idleX: { sequence: [3,4,5,6] } }
-
animSheetHeight :Number
-
Tile height of dynamic animation sheet. IMPORTANT: use this for dynamically / run-time created entity types, not classes.
- Inherited From:
- Default Value:
- 0
- Source:
-
animSheetPath :String
-
Path to dynamic animation sheet.
- created on init
- automatically prepends shared base media directory from ig.CONFIG.PATH_TO_MEDIA IMPORTANT: use this for dynamically / run-time created entity types, not classes.- Inherited From:
- Source:
-
animSheetWidth :Number
-
Tile width of dynamic animation sheet. IMPORTANT: use this for dynamically / run-time created entity types, not classes.
- Inherited From:
- Default Value:
- 0
- Source:
-
animTileOffset :Number
-
Default tile offset, within animation sheet, to start animation when not defined in ig.EntityExtended#animSettings.
- used when creating animations from ig.EntityExtended#animSettings- Inherited From:
- Default Value:
- 0
- Source:
-
autoComplete
-
- Default Value:
- false
- Source:
-
autoToggle
-
Tutorials should automatically toggle back to default state.
- this is useful for if player moves out of tutorial the tutorial will stop but be able to be restarted- Default Value:
- true
- Source:
-
bounciness :Number
-
How bouncy entity is in collisions, between 0 and 1.
- Inherited From:
- Source:
- See:
-
canDieInstantly :Boolean
-
Whether entity can skip death animation if it dies while off screen.
- Inherited From:
- Default Value:
- true
- Source:
-
canFlipX :Boolean
-
Whether entity can flip animations vertically and set facing on x.
- Inherited From:
- Source:
-
canFlipY :Boolean
-
Whether entity can flip animations vertically and set facing on y.
- Inherited From:
- Source:
-
<readonly> changed :Boolean
-
Whether entity has changed since last update.
- Inherited From:
- Default Value:
- false
- Source:
-
checkAgainst :Bitflag|Number
-
Entities to check against, expanded for more flexibility and specificity. IMPORTANT: for an entity to avoid being ignored in checks, it must either collide, checkAgainst, or have a type!
- Inherited From:
- Default Value:
- none
- Source:
- See:
-
<readonly> checking :Boolean
-
Whether entity is checking against another entity matching ig.Entity#checkAgainst flag.
- Inherited From:
- Default Value:
- false
- Source:
-
climbable :Boolean
-
Whether entity is climbable.
- Inherited From:
- Default Value:
- false
- Source:
-
climbableStairs :Boolean
-
Whether entity is climbable as stairs. IMPORTANT: has no effect unless ig.EntityExtended#climbable is true.
- Inherited From:
- Default Value:
- false
- Source:
-
collides :Bitflag|Number
-
How entity should collide with other entities.
- this does not affect whether entity collides with collision map, only how it collides with other entities IMPORTANT: for an entity to avoid being ignored in checks, it must either collide, checkAgainst, or have a type!- Inherited From:
- Default Value:
- never
- Source:
- See:
-
- ig.Entity
-
collidesChanges :Boolean
-
Whether an entity may change its ig.EntityExtended#collides property during gameplay. IMPORTANT: this forces an entity to be included in collision checks, even if it does not collide, checkAgainst, or have a type
- Inherited From:
- Default Value:
- false
- Source:
-
collidingWithEntitiesBelow :Boolean
-
Whether entity is colliding with one or more entities below.
- Inherited From:
- Default Value:
- false
- Source:
-
collidingWithMap :Boolean
-
Whether entity is colliding with a wall, floor, ceiling, etc in collision map.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> collisionMapResult :Object
-
Entity's result from colliding with ig.GameExtended#collisionMap.
- created on init- Inherited From:
- Source:
-
controllable :Boolean
-
Whether entity has control of itself and can move. IMPORTANT: uncontrollable entities update but do not move or change!
- Inherited From:
- Default Value:
- true
- Source:
-
<readonly> currentAnim :ig.AnimationExtended
-
Currently displaying animation.
- defers to ig.EntityExtended#overridingAnim- Inherited From:
- Default Value:
- null
- Source:
-
deactivateCallback :function
-
Function called on deactivate.
- do not use this for predefined entity classes, override activate instead- Inherited From:
- Source:
-
deactivateContext :Object
-
Context to execute deactivate callback function in.
- do not use this for predefined entity classes, override activate instead- Inherited From:
- Source:
-
delay
-
Tutorials should be delayed slightly to allow players that already know how to do tutorial to skip naturally.
- Default Value:
- 1
- Source:
-
delayTimer :ig.Timer
-
Timer to handle delay duration.
- created on init- Inherited From:
- Source:
-
<readonly> dieing :Boolean
-
Whether entity is in the process of dieing.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> dieingSilently :Boolean
-
Whether entity is in the process of dieing without effects or animation.
- Inherited From:
- Default Value:
- false
- Source:
-
diffuse :Number
-
How much light is blocked when ig.EntityExtended#opaque.
- Inherited From:
- Source:
-
duration
-
Tutorials have infinite respawns until completed.
- Source:
-
durationTimer :ig.Timer
-
Timer for duration of spawning.
- created on init- Inherited From:
- Source:
-
<readonly> entities :Array
-
List of entities that have been spawned and are still in game world.
- Inherited From:
- Source:
-
<readonly> entity :ig.EntityExtended
-
Spawned entity used to help player focus and/or give instructions to player.
- created on activation- Source:
-
facing :Vector2|Object
-
Facing direction of entity based on velocity and look at.
- Inherited From:
- Default Value:
- right
- Source:
-
fixed :Boolean
-
Whether is fixed in screen vs inside world space.
- this is particularly useful for UI elements IMPORTANT: fixed elements cannot have dynamic performance!- Inherited From:
- Default Value:
- false
- Source:
-
flip :Boolean
-
Whether entity is flipped. IMPORTANT: flip is now an object with x and y boolean values!
- Inherited From:
- Source:
-
friction :Vector2|Object
-
Friction of entity
- Inherited From:
- Source:
- See:
-
frozen
-
Triggers do not need to update.
- Inherited From:
- Default Value:
- true
- Source:
-
gravityFactor :Number
-
Percent of gravity to apply, between 0 and 1.
- Inherited From:
- Source:
- See:
-
grounded :Boolean
-
Whether entity is grounded.
- Inherited From:
- Source:
- See:
-
group :Bitflag|Number
-
Group of entities to avoid checking against and colliding with. Tip: as the group property is a bitflag, it can be any combination of groups!
- Inherited From:
- Default Value:
- none
- Source:
- See:
-
<readonly> hasGravity :Boolean
-
Whether entity has gravity.
- set automatically during update- Inherited From:
- Source:
-
health :Number
-
Health statistic.
- someone once asked me how I died, so I told them that my health reached 0- Inherited From:
- Source:
-
healthMax :Number
-
Max health statistic.
- Inherited From:
- Source:
-
<readonly> hidden :Boolean
-
Whether entity is hidden and cannot be seen by other entities. Set via ig.EntityExtended#setHidden.
- Inherited From:
- Default Value:
- false
- Source:
-
highPerformance :Boolean
-
Whether entity is high performance, i.e. skips a lot of checks and adds/removals to increase speed at the loss of flexibility and functionality. IMPORTANT: high performance entities don't check, don't collide, and are not interactive!
- Inherited From:
- Default Value:
- false
- Source:
-
hollow :Boolean
-
Whether entity only casts shadows from edges when ig.EntityExtended#opaque.
- Inherited From:
- Default Value:
- true
- Source:
-
ignoreSystemScale :Boolean
-
Whether entity elements should ignore system scale.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.IGNORE_SYSTEM_SCALE
- Source:
-
<readonly> intersecting :Boolean
-
Whether entity is intersecting another entity.
- Inherited From:
- Default Value:
- false
- Source:
-
invulnerable :Boolean
-
Whether entity blocks all incoming damage.
- Inherited From:
- Default Value:
- false
- Source:
-
isolate :Object
-
Map of entity names to isolate when tutorial is active.
- use this together with ig.Tutorial#layerNameIsolation and ig.Tutorial#overlayEntity- Source:
// sometimes, it is useful to isolate the player for a tutorial // this may help them focus on what they need to do // and the player has the 'player' name by default, so this is easy to do tutorial.isolate.1 = 'player';
-
layerName :String
-
Layer to be added to upon instantiation.
- Inherited From:
- Default Value:
- entities
- Source:
-
layerNameIsolation :String
-
Name of layer to isolate entities to. IMPORTANT: this property controls whether or not entities are isolated.
- Default Value:
- overlay
- Source:
// tutorial will isolate entities to overlay layer tutorial.layerNameIsolation = 'overlay'; // tutorial won't isolate entities tutorial.layerNameIsolation = '';
-
<readonly> learned :Boolean
-
Whether player has completed tutorial and learned activity.
- Default Value:
- false
- Source:
-
linkedTo :ig.EntityExtended
-
Another entity that this entity is linked to.
- Inherited From:
- Default Value:
- null
- Source:
-
loops :Number
-
Times to loop tutorial.
- Default Value:
- // a tutorial can be looped infinitely tutorial.loops = -1; // or just a few times tutorial.loops = 2;
- Source:
-
<readonly> managed :Boolean
-
Whether entity is currently being managed by ig.GameExtended#playerManager.
- Inherited From:
- Default Value:
- false
- Source:
-
maxVel :Vector2|Object
-
Max velocity of entity
- Inherited From:
- Source:
- See:
-
minBounceVelocity :Number
-
Minimum velocity to bounce.
- Inherited From:
- Source:
- See:
-
<readonly> movedTo :Boolean
-
Whether entity has moved to currently moving to entity.
- Inherited From:
- Default Value:
- true
- Source:
-
<readonly> moving :Boolean
-
Whether entity is moving.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> movingTo :ig.EntityExtended|Vector2|Object
-
Whether entity is moving to another entity.
- Inherited From:
- Default Value:
- null
- Source:
-
<readonly> movingToOnce :Boolean
-
Whether entity should move to another entity and stop moving.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> movingToTweening :Boolean
-
Whether entity is tweening to another entity. IMPORTANT: this is automatically disabled with dynamic entities!
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> movingToTweenPct :Number
-
Percent progress of tweening to another entity.
- Inherited From:
- Source:
-
<readonly> movingX :Boolean
-
Whether entity is moving horizontally.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> movingY :Boolean
-
Whether entity is moving vertically.
- Inherited From:
- Default Value:
- false
- Source:
-
needsRebuild :Boolean
-
Whether entity needs to be rebuilt on next refresh. IMPORTANT: it is usually a bad idea to set this to false initially!
- Inherited From:
- Default Value:
- true
- Source:
-
needsVertices :Boolean
-
Whether to calculate vertices on change.
- Inherited From:
- Source:
- See:
-
offset :Vector2|Object
-
Offset of entity, reflected on both sides.
- Inherited From:
- Source:
- See:
-
onAdded :ig.Signal
-
Signal dispatched when entity added to game.
- created on init.- Inherited From:
- Source:
-
once :Boolean
-
Whether trigger can only activate once before needed to be deactivated.
- Inherited From:
- Default Value:
- true
- Source:
-
onCompleted :ig.Signal
-
Signal dispatched when trigger completes triggering.
- created on init- Inherited From:
- Source:
-
oneWay :Boolean
-
Whether entity is one way
- Inherited From:
- Default Value:
- false
- Source:
-
oneWayFacing :Vector2
-
Direction from which entity will collide with another entity.
- Inherited From:
- Default Value:
- null
- Source:
// direction should be a 2d vector with a length of 1 // i.e. this is invalid entity.oneWayFacing = { x: 0, y: 0 }; // while either of the following is okay entity.oneWayFacing = { x: 1, y: 0 }; entity.oneWayFacing = ig.utilsvector2.vector( 1, 0 ); // to block from the left entity.oneWayFacing = { x: -1, y: 0 }; // to block from the right entity.oneWayFacing = { x: 1, y: 0 }; // to block from the top entity.oneWayFacing = { x: 0, y: -1 }; // to block from the bottom entity.oneWayFacing = { x: 0, y: 1 };
-
onMovedTo :ig.Signal
-
Signal dispatched when entity completes moving to another entity.
- created on init.- Inherited From:
- Source:
-
onRefreshed :ig.Signal
-
Signal dispatched when entity is refreshed.
- created on init.- Inherited From:
- Source:
-
onRemoved :ig.Signal
-
Signal dispatched when entity removed from game.
- created on init.- Inherited From:
- Source:
-
onSpawned :ig.Signal
-
Signal dispatched when spawner spawns an entity.
- created on init.- Inherited From:
- Source:
-
onSpawnedAll :ig.Signal
-
Signal dispatched when spawner has finished spawning all entities.
- created on init.- Inherited From:
- Source:
-
onUnspawned :ig.Signal
-
Signal dispatched when spawner unspawns an entity.
- created on init.- Inherited From:
- Source:
-
onUnspawnedAll :ig.Signal
-
Signal dispatched when spawner has unspawned all entities.
- created on init.- Inherited From:
- Source:
-
opaque :Boolean
-
Whether entity casts a shadow from lights.
- Inherited From:
- Source:
-
opaqueFromVertices :Boolean
-
Whether opaque vertices should use vertices when present. IMPORTANT: when true, this overrides ig.EntityExtended#initOpaqueVertices, and ig.EntityExtended#getOpaqueVertices.
- Inherited From:
- Source:
- See:
-
opaqueOffset :Object
-
Size to offset from entity bounds for casting shadows when ig.EntityExtended#opaque. Tip: to set opaque offsets per animation, use ig.AnimationExtended#opaqueOffset
- Inherited From:
- Source:
- See:
// by default, shadow casting uses // entity's opaque offsets entity.opaqueOffset = { left: 0, right: 0, top: 0, bottom: 0 }; // unless the entity's current animation // has its own opaque offsets entity.currentAnim.opaqueOffset = { left: 0, right: 0, top: 0, bottom: 0 }; // opaque offsets can also be done per tile entity.currentAnim.opaqueOffset = { tiles: { 1: { left: 0, right: 0, top: 0, bottom: 0 }, 2: {...} } };
-
opaqueVertices :Array
-
List of vertices in world space for shadow casting.
- recalculated when casting shadows by ig.EntityExtended#getOpaqueVertices- Inherited From:
- Source:
-
overlayEntity :ig.UIOverlay
-
Overlay entity class to use to help player focus during tutorial.
- this will overlay behind isolated entities but over anything else- Default Value:
- null
- Source:
-
overlaySettings :ig.UIOverlay
-
Settings object that is based directly on ig.UIOverlay settings.
- this will overlay behind isolated entities but over anything else- Default Value:
- null
- Source:
-
<readonly> overridingAnim :ig.AnimationExtended
-
Currently overriding animation.
- if present, this displays instead of ig.EntityExtended#currentAnim- Inherited From:
- Default Value:
- null
- Source:
-
<readonly> paused :Boolean
-
Whether entity is paused.
- Inherited From:
- Default Value:
- false
- Source:
-
performance :String
-
How entity should perform during update.
- static will only update animation
- movable can move but does not collide with collision map
- dynamic does full update, including movement and collision map checks IMPORTANT: this directly correlates to the complexity of entity's update and whether it collides with collision map.- Inherited From:
- Default Value:
- static
- Source:
-
persistent :Boolean
-
Whether entity should remain across levels. Tip: an entity will only be moved from one level to another if an entity is found with a matching name! IMPORTANT: the game will keep the first of each uniquely named persistent entity it encounters and merge the editor position and settings of any others with the same name as it encounters them.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> pool :Array
-
List of entities that have been spawned and returned to spawning pool.
- Inherited From:
- Source:
-
pos :Vector2|Object
-
Base position.
- Inherited From:
- Source:
-
<readonly> posDraw :Vector2|Object
-
Drawn position.
- Inherited From:
- Source:
-
properties :Array
-
List of player properties to check for truthy that tell tutorial it has been completed.
- Source:
-
propertiesTarget :Array
-
List of spawn target properties to check for truthy that tell tutorial it has been completed.
- Source:
-
rangeInteractableX :Number
-
Horizontal range at which this entity can be interacted with.
- a range of 0 is considered infinite
- abilities compare this to their own range and use the higher of the two IMPORTANT: only relevant if entity type includes ig.EntityExtended.TYPE.INTERACTIVE.- Inherited From:
- Default Value:
- 0
- Source:
-
rangeInteractableY :Number
-
Vertical range at which this entity can be interacted with.
- a range of 0 is considered infinite
- abilities compare this to their own range and use the higher of the two IMPORTANT: only relevant if entity type includes ig.EntityExtended.TYPE.INTERACTIVE.- Inherited From:
- Default Value:
- 0
- Source:
-
resetState :Object
-
Last recorded state taken during ig.EntityExtended#recordResetState.
- automatically updated first time entity added to game world
- reset state records only a limited set of properties
- this can be useful for checkpoints, respawning, etc- Inherited From:
- Source:
-
respawnDelay :Number
-
Duration in seconds to delay looping of tutorial.
- Default Value:
- 1
- Source:
-
respawnTimer :ig.Timer
-
Timer for respawn delay.
- created on init- Inherited From:
- Source:
-
scale :Number
-
Scale that overrides system scale when ig.EntityExtended#ignoreSystemScale is true.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.SCALE
- Source:
-
scaleMax :Number
-
Maximum value of ig.EntityExtended#scale.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.SCALE_MAX
- Source:
-
scaleMin :Number
-
Minimum value of ig.EntityExtended#scale.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.SCALE_MIN
- Source:
-
<readonly> scaleMod :Number
-
Modifier for when ig.EntityExtended#scale != ig.system.scale.
- Inherited From:
- Default Value:
- 1
- Source:
-
scaleOfSystemScale :Number
-
Scale of system scale.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.SCALE_OF_SYSTEM_SCALE
- Source:
-
size :Vector2|Object
-
Size of entity
- Inherited From:
- Source:
- See:
-
<readonly> sizeDraw :Vector2|Object
-
Drawn size of entity, including size, offsets, etc.
- Inherited From:
- Source:
-
slope :Object
-
Whether entity is on a slope, and if so, slope properties.
- Inherited From:
- Source:
-
slopeSpeedMod :Number
-
Speed multiplier on slopes
- Inherited From:
- Source:
- See:
-
slopeStanding :Vector2
-
Slope angle range that entity can stand on.
- Inherited From:
- Source:
- See:
-
slopeSticking :Boolean
-
Whether entity should stick to slopes instead of sliding down.
- Inherited From:
- Source:
- See:
-
sortTargetsBy :function
-
Method to sort targets by when triggered.
- Inherited From:
- Default Value:
- null
- Source:
-
spawnAndMoveTo
-
Tutorial demos should move to each target in ig.EntityTrigger#target.
- Default Value:
- true
- Source:
-
spawnAndMoveToSettings
-
- Source:
Properties:
Name Type Description tween
Boolean true -
spawnAt :Boolean|ig.EntityExtended
-
Entity to spawn entities at.
- Inherited From:
- Default Value:
- self
- Source:
-
spawnAtFirstTarget
-
Tutorial demos should usually spawn at first target in ig.EntityTrigger#target, then move to rest in sequence.
- Default Value:
- true
- Source:
-
spawnAtRandomPosition
-
Tutorial demos should not spawn at a random position.
- Default Value:
- false
- Source:
-
spawnAtRandomTarget :Boolean
-
Whether to find ig.Spawner#spawnAt based on a random target from ig.EntityTrigger#target.
- Inherited From:
- Default Value:
- false
- Source:
-
spawnAtSide :Vector2|Object
-
Which side of ig.Spawner#spawnAt to snap spawned entity position to.
- Inherited From:
- Default Value:
- null
- Source:
// this snaps spawned entities to the bottom of a spawner // which is very useful for creature spawners, which need to spawn on the ground spawner.spawnAtSide = { x: 0, y: 1 };
-
<readonly> spawnCount :Number
-
Number of currently spawned entities.
- Inherited From:
- Source:
-
spawnCountMax :Number
-
Total number of entities to spawn over duration.
- Inherited From:
- Default Value:
- 1
- Source:
-
spawnDelay :Number
-
Delay between individual spawns.
- Inherited From:
- Source:
// spawner that finds delay automatically based on duration spawner.spawnDelay = -1; // spawner that has a 1 second delay between each spawn spawner.spawnDelay = 1;
-
<readonly> spawnedCount :Number
-
Number of spawned entities since first activated.
- Inherited From:
- Source:
-
spawnedDieWith
-
Anything tutorial spawns should die when tutorial dies.
- Default Value:
- true
- Source:
-
<readonly> spawning :Boolean
-
Whether spawner is currently spawning entities.
- Inherited From:
- Source:
-
spawningEntity :String|ig.EntityExtended
-
Entity to spawn. IMPORTANT: spawner does nothing if this is empty!.
- Inherited From:
- Source:
-
spawnSettings
-
- Source:
Properties:
Name Type Description layerName
String overlay -
spawnTarget :Object
-
Map of name of entities to spawn entities at.
- Inherited From:
- Source:
// spawner will spawn entities within its own bounds spawner.spawnTarget = {}; // spawner will spawn entities within the bounds of a void entity var spawnLocation = ig.game.spawnEntity( ig.EntityVoid, 0, 0 ); spawner.spawnTarget.1 = spawnLocation;
-
spawnTargetSequence :Array
-
List of entities to spawn entities at, populated on activate.
- Inherited From:
- Source:
-
spawnTimer :ig.Timer
-
Timer for delay between each spawn.
- created on init- Inherited From:
- Source:
-
standing :Boolean
-
Whether entity is standing.
- Inherited From:
- Source:
- See:
-
suicidal
-
Tutorials don't die until learned.
- Default Value:
- false
- Source:
-
target :Object
-
Map of names of target entities to activate when activated.
- Inherited From:
- Source:
// a trigger can trigger any entity by name entityA.name = 'foo'; triggerA.target.1 = 'foo'; // a trigger can trigger another trigger by name to create a chain triggerA.name = 'bar'; triggerB.target.1 = 'bar';
-
targetable :Boolean
-
Whether entity can be targeted by an intersection search. Tip: for interactive entities, set this to true and add the ig.EntityExtended.TYPE.INTERACTIVE flag to its type.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> targetSequence :Array
-
Sorted list of targets, populated when triggered.
- Inherited From:
- Source:
-
teardownWhenComplete
-
Tutorials don't teardown until learned.
- Default Value:
- false
- Source:
-
textEntity :ig.UIText
-
Text entity class to use to help player focus during tutorial. IMPORTANT: do not use this when using an overlay as overlay already handles text!
- Default Value:
- null
- Source:
-
textSettings :Object
-
Settings object that is based directly on ig.UIText settings. IMPORTANT: this property controls whether or not text is displayed during tutorial.
- Default Value:
- null
- Source:
-
textured :Boolean
-
Whether animations should be automatically textured across entity when added to entity.
- textures can be animated, but be careful about adding high amounts of frames Tip: this is best applied to resizable entities.- Inherited From:
- Default Value:
- false
- Source:
-
triggerable
-
Tutorials should trigger through collision.
- Default Value:
- true
- Source:
-
triggerAfterDelay
-
Tutorials should not trigger after delay.
- Default Value:
- false
- Source:
-
<readonly> triggering :Boolean
-
Whether trigger is in the process of triggering.
- Inherited From:
- Default Value:
- false
- Source:
-
<readonly> tweens :Object
-
All tweens affecting this entity that were initiated by ig.EntityExtended#tween.
- these tweens are automatically deleted when complete- Inherited From:
- Source:
-
type :Bitflag|Number
-
Entity type, expanded for more flexibility and specificity. IMPORTANT: for an entity to avoid being ignored in checks, it must either collide, checkAgainst, or have a type!
- Inherited From:
- Default Value:
- none
- Source:
- See:
-
unspawnSilently :Boolean
-
Whether to force spawned entities to unspawn silently.
- Inherited From:
- Default Value:
- true
- Source:
-
useCheckingAsTarget :Boolean
-
Whether entity that checks and causes trigger to activate should be used as a target.
- Inherited From:
- Default Value:
- false
- Source:
-
vertices :Array
-
List of vertices based on bounds, relative to entity.
- not calculated by default for performance reasons
- to manually enable, use ig.EntityExtended#needsVertices- Inherited From:
- Source:
-
verticesWorld :Array
-
List of vertices based on bounds, relative to world space.
- not calculated by default for performance reasons
- to manually enable, use ig.EntityExtended#needsVertices- Inherited From:
- Source:
-
<readonly> visible :Boolean
-
Whether entity is visible in screen.
- Inherited From:
- Default Value:
- false
- Source:
-
wait :Number
-
Duration in seconds before this trigger can be activated again.
- Inherited From:
- Default Value:
- 0
- Source:
-
waitTimer :ig.Timer
-
Timer to handle wait duration.
- created on init- Inherited From:
- Source:
-
<readonly> wasChecking :Boolean
-
Whether entity was checking against another entity matching ig.Entity#checkAgainst flag.
- Inherited From:
- Default Value:
- false
- Source:
Methods
-
activate()
-
Begins spawning entities if not already spawning or not spawned up to max.
- Inherited From:
- Source:
-
addAnim(name, settings)
-
Adds an animation to an entity.
Parameters:
- uses ig.AnimationExtended instead of the original ig.AnimationName Type Argument Description name
String name of animation settings
Object <optional>
settings based on animation properties - Inherited From:
- Source:
- See:
-
addControl()
-
Adds control to entity. Tip: this allows entity to call ig.GameExtended#updateChanges during update cycle.
- Inherited From:
- Source:
-
angleTo(from) → {Number}
-
Calculates angle from this entity to another entity or position.
Parameters:Name Type Description from
ig.EntityExtended | Vector2 | Object entity or position to find angle to. - Inherited From:
- Source:
{ Number } angle -
animOverride(animName, settings)
-
Plays an animation and sets animation as override until complete to ensure that no other animations play.
Parameters:Name Type Argument Description animName
String name of animation to play. settings
Object <optional>
settings object. - Inherited From:
- Source:
// settings is a plain object settings = {}; // use an animation from another entity settings.entity = otherEntity; // don't auto release override settings.lock = true; // loop overriding animation // also does not auto release override settings.loop = true; // play animation in reverse settings.reverse = true; // call a function when override completes settings.callback = function () {...}; // call the callback in a context settings.context = callbackContext;
-
animRelease(name, silent)
-
Removes animation override, see ig.EntityExtended.animOverride.
Parameters:Name Type Argument Default Description name
String <optional>
any specific name of overriding animation to release. If does not match will not release. silent
Boolean <optional>
false whether to suppress callback. - Inherited From:
- Source:
-
applyAntiGravity()
-
Applies velocity to counteract gravity.
- Inherited From:
- Source:
-
applyAntiVelocity()
-
Zeroes out velocity.
- Inherited From:
- Source:
-
applyAntiVelocityX()
-
Zeroes out horizontal velocity.
- Inherited From:
- Source:
-
applyAntiVelocityY()
-
Zeroes out vertical velocity.
- Inherited From:
- Source:
-
castShadow(light, context, point, minX, minY, radius)
-
Fill context with the shadow cast by this entity from a point within a light, constrained by the given bounds.
Parameters:Name Type Description light
ig.EntityLight to cast shadows from context
CanvasRenderingContext2D The canvas context onto which the shadows will be cast. point
Object point that represents where the light is coming from. minX
Number left position of light minY
Number top position of light radius
Number radius of light - Inherited From:
- Source:
-
changePerformance() → {Boolean}
-
Makes changes based on this entity's performance level.
- Inherited From:
- Source:
{ Boolean } whether changed or not. -
changePerformanceDynamic()
-
Called when performance changed to dynamic.
- Inherited From:
- Source:
-
changePerformanceMovable()
-
Called when performance changed to movable.
- Inherited From:
- Source:
-
changePerformanceStatic()
-
Called when performance changed to static.
- Inherited From:
- Source:
-
check()
-
Checks trigger against entity and tries to trigger.
- Inherited From:
- Source:
-
cleanup()
-
Cleans up spawner and, if ig.Spawner#spawnedDieWith, also kills all spawned entities.
- Inherited From:
- Source:
-
cleanupCollision()
-
Cleans entity of previous collision properties just before new collision checks.
- Inherited From:
- Source:
-
cleanupPersistent()
-
Does cleanup on persistent changes to game made by this entity, ex: UI elements.
- Inherited From:
- Source:
-
collideWith(entity, dirX, dirY, nudge, vel, weak)
-
Collides with another entity along a specified axis.
Parameters:Name Type Description entity
ig.EntityExtended entity colliding with. dirX
Number horizontal direction of colliding entity dirY
Number vertical direction of colliding entity nudge
Number nudge amount in direction vel
Number velocity in direction weak
Boolean weak colliding entity (i.e. only weak moves) - Inherited From:
- Source:
-
complete()
-
- Inherited From:
- Source:
-
createAnim(name, settings)
-
Generates and adds an animation from ig.EntityExtended#animSettings. If no settings passed, creates default idle animation.
Parameters:Name Type Argument Description name
Object <optional>
name of animation. settings
Object <optional>
settings for animation. - Inherited From:
- Source:
- See:
-
deactivate(entity, silent)
-
Stops spawning and unspawns all spawned entities. IMPORTANT: this kills all spawned and return them to spawning pool!
Parameters:Name Type Argument Default Description entity
ig.EntityExtended entity triggering deactivate. silent
Boolean <optional>
ig.Spawner.unspawnSilently whether to despawn all spawned silently (i.e. no death animations). - Inherited From:
- Source:
-
death(animNameDeath)
-
Shows death animation, automatically called when entity is first killed. Tip: it is not recommended to call this method, but it is fine to override it!
Parameters:Name Type Argument Default Description animNameDeath
String <optional>
"death" + direction name of death animation to play - Inherited From:
- Source:
-
die()
-
Automatically called after entity finished being killed. IMPORTANT: for full animated death, use ig.EntityExtended#kill instead.
- Inherited From:
- Source:
-
distanceEdgeTo(from) → {Number}
-
Calculates distance from edge of this entity to edge of another entity or position.
Parameters:Name Type Description from
ig.EntityExtended | Vector2 | Object entity or position to find distance to. - Inherited From:
- Source:
{ Number } distance -
distanceSquaredEdgeTo(from) → {Number}
-
Calculates distance squared from edge of this entity to edge of another entity or position.
Parameters:
- this is faster than distanceEdgeTo as it avoids sqrt, but the distance is squaredName Type Description from
ig.EntityExtended | Vector2 | Object entity or position to find distance to. - Inherited From:
- Source:
{ Number } distance -
distanceSquaredTo(from) → {Number}
-
Calculates distance squared from center of this entity (in world space) to center of another entity or position (in world space).
Parameters:
- this is faster than distanceTo as it avoids sqrt, but the distance is squaredName Type Description from
ig.EntityExtended | Vector2 | Object entity or position to find distance to. - Inherited From:
- Source:
{ Number } distance squared -
distanceTo(from) → {Number}
-
Calculates distance from center of this entity to center of another entity or position.
Parameters:Name Type Description from
ig.EntityExtended | Vector2 | Object entity or position to find distance to. - Inherited From:
- Source:
{ Number } distance -
draw()
-
Draws entity.
- Inherited From:
- Source:
-
fadeIn(settings) → {Tween}
-
Convenience function for tween fade to max alpha.
Parameters:Name Type Argument Description settings
Object <optional>
settings for tween. - Inherited From:
- Source:
{ Tween } tween object. -
fadeOut(settings) → {Tween}
-
Convenience function for tween fade out.
Parameters:Name Type Argument Description settings
Object <optional>
settings for tween. - Inherited From:
- Source:
{ Tween } tween object. -
fadeTo(alpha, settings) → {Tween}
-
Simple fade to specified alpha. Only tweens if not already at alpha, but onUpdate and onComplete methods are guaranteed to call at least once.
Parameters:Name Type Argument Description alpha
Number alpha value between 0 and 1. settings
Object <optional>
settings for tween. - Inherited From:
- Source:
{ Tween } tween object if tweening to alpha. -
fadeToDeath(settings) → {Tween}
-
Convenience function for tween fade out and then kill.
Parameters:Name Type Argument Description settings
Object <optional>
settings for tween. - Inherited From:
- Source:
{ Tween } tween object. -
getCanTrigger(entity) → {Boolean}
-
Gets whether trigger can be triggered.
Parameters:Name Type Description entity
ig.EntityExtended entity trying to trigger this trigger. - Inherited From:
- Source:
{ Boolean } whether trigger can be triggered. -
getCenterX() → {Number}
-
Calculates entity's center x position.
- Inherited From:
- Source:
{ Number } horizontal center. -
getCenterY() → {Number}
-
Calculates entity's center x position.
- Inherited From:
- Source:
{ Number } vertical center. -
getDirectionalAnimName(animName) → {String}
-
Gets the directional name of an animation based on whether entity can flip and current facing. IMPORTANT: this method is biased towards facing vertical.
Parameters:Name Type Description animName
String base animation name - Inherited From:
- Source:
{ String } directional animation nameExample// if we begin with an animation named "move" // and this entity can flip horizontally var animName = entity.getAnimName( "move" ); // the result will be "moveX" // while if the entity cannot flip horizontally // but it is facing to the left entity.facing.x = -1; // the result will be "moveLeft"
-
getIsCollidingWithOneWay(entityOneWay) → {Boolean}
-
Approximate check of whether this entity is colliding with the one way blocking direction of another other entity.
Parameters:
- checks for whether the touching edges are within a certain range based on ig.CONFIG#PRECISION_PCT_ONE_SIDED IMPORTANT: the non one way entity does this check to allow it to choose whether to ignore one way block.Name Type Description entityOneWay
ig.EntityExtended one way entity to check against. - Inherited From:
- Source:
{ Boolean } true if this entity is coming from other entity's one way blocking direction. -
getIsMovingSelf() → {Boolean}
-
Calculates if entity is handling its own movement, i.e. dynamic, moving to, etc.
- Inherited From:
- Source:
{ Boolean } if is handling own movement. -
getIsVisible() → {Boolean}
-
Calculates if entity is visible in screen.
- instead of calling this, use ig.EntityExtended#visible- Inherited From:
- Source:
{ Boolean } if is in screen.Example// this is a bad idea var visible = entity.getIsVisible(); // this is a good idea var visible = entity.visible;
-
getLayer() → {ig.Layer}
-
Gets entity layer based on ig.EntityExtended#layerName.
- Inherited From:
- Source:
{ ig.Layer } layer this entity is on. -
getNewVelocity(vel, accel, friction, max)
-
Calculates new velocity on a single axis for entity, and fixes bug of friction not limiting velocity.
Parameters:Name Type Description vel
Number velocity accel
Number acceleration friction
Number friction max
Number max velocity - Inherited From:
- Source:
-
getOpaqueVertices() → {Array}
-
Calculates vertices for shadow casting just before first shadow is cast since changed.
- Inherited From:
- Source:
{ Array } vertices for shadow casting -
getPosDrawX() → {Number}
-
Calculates entity's draw x position, offset included.
- Inherited From:
- Source:
{ Number } draw x position. -
getPosDrawY() → {Number}
-
Calculates entity's draw y position, offset included.
- Inherited From:
- Source:
{ Number } draw y position. -
getSizeDrawX() → {Number}
-
Calculates horizontal size, offset included.
- Inherited From:
- Source:
{ Number } total horizontal size. -
getSizeDrawY() → {Number}
-
Calculates horizontal size, offset included.
- Inherited From:
- Source:
{ Number } total vertical size. -
getVertices() → {Array}
-
Calculates vertices based on entity's size.
- vertices are relative to entity, not world space, and are not scaled to window
- instead of calling this, use ig.EntityExtended#vertices- Inherited From:
- Source:
{ Array } vertices.Example// normally, vertices are never calculated // but you can force vertices to be updated on change entity.needsVertices = true; // this is a bad idea var vertices = entity.getVertices(); // this is a good idea var vertices = entity.vertices;
-
getVerticesWorld() → {Array}
-
Calculates vertices in world space.
- verticesWorld are in world space and are not scaled to window
- instead of calling this, use ig.EntityExtended#verticesWorld- Inherited From:
- Source:
{ Array } vertices.Example// normally, vertices are never calculated // but you can force vertices to be updated on change entity.needsVertices = true; // this is a bad idea var verticesWorld = entity.getVerticesWorld(); // this is a good idea var verticesWorld = entity.verticesWorld;
-
handleMovementTrace()
-
Enhanced handling of results of collision with collision map.
- Inherited From:
- Source:
// generally, climbable tiles are IGNORED // if we need them we should be using game's shapesPasses myGame.shapesPasses = [ { ignoreSolids: true, ignoreOneWays: true } ] // this is because movement trace only catches collisions // and it does not record the tile(s) this entity is within // but the above shapes passes will extract climbable shapes // and create entities of them, so we can know when // one entity is within another entity that is climbable
-
handleTargets(entity, needsActivation)
-
Handles activating all self and targets in the target sequence. Tip: override this method to change how the trigger and each target is activated.
Parameters:Name Type Argument Default Description entity
ig.EntityExtended entity calling trigger. needsActivation
Boolean <optional>
true whether to activating self in addition to targets - Inherited From:
- Source:
-
hide()
-
Sets ig.EntityExtended#hidden to true.
- Inherited From:
- Source:
-
init(x, y, settings)
-
Initializes entity.
Parameters:
- initializes types for checks, via ig.EntityExtended#initTypes
- initializes properties that are created at run-time, such as signals and timers, via ig.EntityExtended#initProperties
- resets entity, merges in new settings, and initializes animations via ig.EntityExtended#resetName Type Argument Description x
Number x position. y
Number y position. settings
Object <optional>
settings object. - Inherited From:
- Source:
-
initOpaqueVertices()
-
Initializes vertices for shadow casting.
- Inherited From:
- Source:
-
initProperties()
-
Initializes properties of spawner.
- checks and sets default ig.Spawner#spawnAt
- creates timers for spawning- Inherited From:
- Source:
-
initTypes()
-
Initializes trigger types.
- adds ig.EntityExtended.TYPE.TRIGGER to {@link ig.EntityExtended#type}
- adds ig.EntityExtended.TYPE.PLAYER to {@link ig.EntityExtended#checkAgainst}- Inherited From:
- Source:
-
intersectWith(entity)
-
Called when two entities intersect, regardless of collides and before checks or collisions.
Parameters:Name Type Description entity
ig.EntityExtended entity intersecting. - Inherited From:
- Source:
-
kill()
-
- Inherited From:
- Source:
-
learn()
-
Finishes tutorial.
- Source:
-
lineOfSight(entity) → {Boolean}
-
Whether this entity can see another in a direct line of sight.
Parameters:Name Type Description entity
ig.EntityExtended entity to check against. - Inherited From:
- Source:
{ Boolean } if sees other. -
link(entity, refresh)
-
Links entity to another entity, making original refresh after the entity it is linked to. Tip: this allows for entity chaining and pseudo parent/child transforms.
Parameters:Name Type Argument Default Description entity
ig.EntityExtended to link to. refresh
Boolean <optional>
true whether to refresh after linking. - Inherited From:
- Source:
-
linkSpawned()
-
Adds attachments between spawner and spawned.
- spawners hook the ig.EntityExtended#onRemoved signal of the entities they spawn to ensure they return to the pool automatically
- adds a 'spawner' property to entity with a reference to this spawner- Inherited From:
- Source:
-
lookAt(target)
-
Flips entity to face a target entity or position.
Parameters:Name Type Description target
ig.EntityExtended | Vector2 | Object target to look at. - Inherited From:
- Source:
-
manageStart()
-
Called automatically by ig.GameExtended#PlayerManager when managing entity as if player were playing them.
- Inherited From:
- Source:
-
manageStop()
-
Called automatically by ig.GameExtended#PPlayerManager when done managing entity.
- Inherited From:
- Source:
-
moveAllStop()
-
Stops all movement immediately.
- Inherited From:
- Source:
-
moveTo(item, settings) → {Boolean}
-
Moves to an item, which can be an entity or a position.
Parameters:Name Type Argument Description item
ig.EntityExtended | Vector2 | Object entity with bounds or position with x and y properties. settings
Object <optional>
settings for move. - Inherited From:
- Source:
{ Boolean } whether a new move to has been startedExample// settings is a plain object settings = {}; // to ensure entity follows other properly settings.matchPerformance = true; // to move to only once settings.once = true; // follow defaults to aligning at center of followed // to follow at the top left instead of center settings.align = { x: 0, y: 0 }; // to follow and flip with whatever we're moving to settings.flipWith = true; // to follow offset by 10 px settings.offset = { x: 10, y: 10 }; // to follow above settings.offsetPct = { x: 0, y: -1 }; // to follow at a random offset between -0.25 and 0.25 on both axes settings.randomOffsetPct = { x: 0.25, y: 0.25 }; // a lerp between 0 and 1 will cause a smooth follow settings.lerp = 0.1; // a tweened follow with optional tween settings based on ig.EntityExtended#tween settings.tween = true; settings.tweenSettings = {...};
-
moveToComplete() → {Boolean}
-
Called when moved to complete.
- Inherited From:
- Source:
{ Boolean } true when move is completed, otherwise is continuing sequence. -
moveToPosition(item, settings)
-
Positions this entity relative to moving to item based on settings.
Parameters:Name Type Argument Description item
ig.EntityExtended | Vector2 | Object item to move to. settings
Object <optional>
settings object. - Inherited From:
- Source:
- See:
-
moveToSequenceNext()
-
Moves to next in current sequence of moving to entities.
- Inherited From:
- Source:
-
moveToStop()
-
Ends any moveTo in progress.
- Inherited From:
- Source:
-
moveToUpdate()
-
Updates any moveTo in progress.
- Inherited From:
- Source:
-
pause()
-
- Inherited From:
- Source:
-
projectShadow(point, radius, a, b, pointToA, pointToB, aToB) → {Array}
-
Projects an edge based on an point.
Parameters:Name Type Description point
Vector2 | Object 2d point to project from. radius
Number a
Object edge vertex a. b
Object edge vertex b. pointToA
Vector2 | Object 2d vector from point to vertex a. pointToB
Vector2 | Object 2d vector from point to vertex b. aToB
Object 2d vector from vertex a to vertex b. - Inherited From:
- Source:
{ Array } vertices of the shape cast by light from edge. -
ready()
-
Called automatically when entity added to game world.
- Inherited From:
- Source:
- See:
-
- ig.Entity.
-
rebuild()
-
Rebuilds entity by updating all animations.
- Inherited From:
- Source:
-
receiveDamage(amount, from, unblockable) → {Boolean}
-
Does damage to entity while checking if invulnerable.
Parameters:Name Type Argument Description amount
Number amount of damage. from
ig.EntityExtended <optional>
entity causing damage. unblockable
Boolean <optional>
whether damage cannot be blocked. - Inherited From:
- Source:
{ Boolean } whether damage was applied. -
recordChanges(force)
-
Records limited changes in transform and sets ig.EntityExtended#changed and ig.EntityExtended#moving.
Parameters:
- called automatically by ig.EntityExtended#updateName Type Argument Description force
Boolean <optional>
forces changed. - Inherited From:
- Source:
-
recordLast()
-
Records last transform.
- called automatically by ig.EntityExtended#update- Inherited From:
- Source:
-
recordResetState()
-
Records the state of an entity for later reset.
- does not record all properties for performance reasons- Inherited From:
- Source:
-
refresh(force)
-
Refreshes entity size, position, etc when screen is resized or linked to is refreshed. Tip: usually this is best applied to UI elements and not dynamic entities.
Parameters:Name Type Argument Description force
Boolean <optional>
whether to force. - Inherited From:
- Source:
-
removeControl()
-
Removes control from entity. Tip: this blocks entity from calling ig.GameExtended#updateChanges during update cycle.
- Inherited From:
- Source:
-
reposition(force)
-
Repositions entity. Tip: by default, this method does nothing, so override this method with a class specific one.
Parameters:Name Type Argument Description force
Boolean <optional>
whether to force. - Inherited From:
- Source:
-
reset(x, y, settings)
-
Resets an entity to last state.
Parameters:Name Type Argument Description x
Number x position. y
Number y position. settings
Object <optional>
settings object. - Inherited From:
- Source:
-
resetCore(x, y, settings)
-
Resets settings and position of entity.
Parameters:Name Type Argument Description x
Number x position. y
Number y position. settings
Object <optional>
settings object. - Inherited From:
- Source:
-
resetExtras()
-
- Source:
-
resetToInitAnim()
-
Resets current anim to initial animation.
- Inherited From:
- Source:
-
resize(force)
-
Resizes entity. Tip: by default, this method does nothing, so override this method with a class specific one.
Parameters:Name Type Argument Description force
Boolean <optional>
whether to force. - Inherited From:
- Source:
-
setControllable(controllable)
-
Sets whether entity can control self.
Parameters:Name Type Argument Default Description controllable
Boolean <optional>
true - Inherited From:
- Source:
-
setGrounded(withoutVelocity)
-
Sets entity as grounded. Only changes gravity state if has gravity.
Parameters:Name Type Argument Default Description withoutVelocity
Boolean <optional>
false whether to leave velocity untouched - Inherited From:
- Source:
-
setHidden(hidden)
-
Sets ig.EntityExtended#hidden.
Parameters:Name Type Argument Default Description hidden
Boolean <optional>
false whether entity should be hidden. - Inherited From:
- Source:
-
setPerformance()
-
Sets this entity's performance level.
- Inherited From:
- Source:
-
setUngrounded()
-
Sets entity as ungrounded.
- Inherited From:
- Source:
-
setup(entity)
-
Setup tutorial.
Parameters:
- overlay is added
- isolates all isolate entities
- starts loopName Type Argument Description entity
ig.EntityExtended <optional>
entity to base loop on. - Source:
-
spawn()
-
Called after ig.EntityExtended#ready when spawn animation is complete.
- sets ig.EntityExtended#currentAnim to ig.EntityExtended#animInit if present
- activates entity if ig.EntityExtended#activated is true- Inherited From:
- Source:
-
spawned(entity)
-
Handles entity after spawning, useful for positioning, starting behavior, etc.
Parameters:
- links entity as a spawned entity to this spawner
- repositions entity based on spawning properties of this spawnerName Type Description entity
ig.EntityExtended entity that has been spawned. - Inherited From:
- Source:
-
spawnNext(entity) → {ig.EntityExtended}
-
Spawns next entity of spawning entity if possible.
Parameters:Name Type Argument Description entity
ig.EntityExtended <optional>
entity to force spawn (i.e. ignore pool and count) - Inherited From:
- Source:
{ ig.EntityExtended } entity spawned -
teardown()
-
Teardown tutorial.
- overlay is removed
- all isolate entities are returned to their original layers- Source:
-
toggleActivate(entity)
-
Toggles between activate and deactivate.
Parameters:Name Type Argument Description entity
Entity <optional>
causing deactivation. - Inherited From:
- Source:
-
touches(entity) → {Boolean}
-
Whether this entity touches another.
Parameters:Name Type Description entity
ig.EntityExtended entity to check against. - Inherited From:
- Source:
{ Boolean } if touches other. -
trigger(entity, needsActivation, entityIsChecking)
-
Called when triggering to activate self and all targets.
Parameters:Name Type Argument Default Description entity
ig.EntityExtended <optional>
entity calling trigger. needsActivation
Boolean <optional>
true whether to activating self in addition to targets. entityIsChecking
Boolean <optional>
false whether entity is checking. - Inherited From:
- Source:
-
tween(properties, settings) → {Tween}
-
Simple tween of specified properties. IMPORTANT: make sure this entity has all tweening properties.
Parameters:Name Type Argument Description properties
Object property values on entity. settings
Object <optional>
settings for tween, based on ig.TWEEN.tween. - Inherited From:
- Source:
{ Tween } tween object. -
tweenEnd(name)
-
Stops tweens on this entity. IMPORTANT: if no specific tween name passed, will stop all tweens.
Parameters:Name Type Argument Description name
String <optional>
name of specific tween. - Inherited From:
- Source:
-
unhide()
-
Sets ig.EntityExtended#hidden to false.
- Inherited From:
- Source:
-
unlink(refresh)
-
Unlinks entity from whatever it was linked to.
Parameters:Name Type Argument Default Description refresh
Boolean <optional>
true whether to refresh after unlinking. - Inherited From:
- Source:
-
unlinkSpawned()
-
Removes attachments between spawner and spawned.
- removes hooks to ig.EntityExtended#onRemoved signal
- removes 'spawner' property from entity- Inherited From:
- Source:
-
unpause()
-
- Inherited From:
- Source:
-
unspawn()
-
Tutorial will automatically complete if not looping.
- Source:
-
update()
-
Updates tutorial.
- checks if complete via ig.Tutorial#actions ig.Tutorial#properties
- checks if should loop- Source:
- See:
-
- ig.Spawner.
-
updateBounds()
-
Updates bounds.
- called automatically by ig.EntityExtended#recordChanges when ig.EntityExtended#needsBounds- Inherited From:
- Source:
-
updateChanges()
-
Changes entity.
- called automatically by ig.EntityExtended#update Tip: use this method to handle moving, acting, etc, instead of the main update method.- Inherited From:
- Source:
-
updateDynamics()
-
Updates dynamic properties such as velocity, gravity, collisions with collision map, etc.
- called automatically by ig.EntityExtended#update IMPORTANT: if you change the way bounds are calculated you will also need to override the updateDynamics method!- Inherited From:
- Source:
-
updateVelocity()
-
Updates velocity based on acceleration and friction.
- called automatically by ig.EntityExtended#updateDynamics- Inherited From:
- Source:
-
updateVisible()
-
Called when visible to update animations.
- called automatically by ig.EntityExtended#update- Inherited From:
- Source: