-
_wmScalableLinked
-
Custom Weltmeister (editor) property.
- Source:
Example
// to enable scalable entities to scale in both directions at once
// you'll need to edit the 'scaleSelectedEntity' method in weltmeister's 'edit-entities.js'
// add these two lines before the scaling
var _sizeLastX = this.selectedEntity.size.x;
var _sizeLastY = this.selectedEntity.size.y;
// and then add the following lines after the scaling
if ( this.selectedEntity._wmScalableLinked ) {
if ( this.selectedEntity.size.x !== _sizeLastX ) {
this.selectedEntity.size.y = this.selectedEntity.size.x;
}
else if ( this.selectedEntity.size.y !== _sizeLastY ) {
this.selectedEntity.size.x = this.selectedEntity.size.y;
}
}
-
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:
- Source:
-
<readonly> added :Boolean
-
Whether entity has been added to game world.
- Inherited From:
- Default Value:
- Source:
-
alpha :Number
-
Alpha value from 0 to 1.
- Source:
-
alwaysToggleActivate :Boolean
-
Whether entity's activate should override deactivate.
- Inherited From:
- Default Value:
- Source:
-
angle :Number
-
Angle of rotation in radians.
- Inherited From:
- Default Value:
- Source:
-
animationType :Number
-
Type of animation from ig.EntityExtended#animationTypes.
- used when creating animations from ig.EntityExtended#animSettings
- Inherited From:
- Default Value:
- Source:
-
animationTypes :Array
-
Types of animation.
- used when creating animations from ig.EntityExtended#animSettings
- Inherited From:
- Default Value:
- 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:
- 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:
- 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:
- Source:
Example
// 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:
- 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:
- 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:
- Source:
-
b :Number
-
Blue value from 0 to 1.
- 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:
- 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:
-
castsShadows :Boolean
-
Whether light should cast shadows on objects that are ig.EntityExtended#opaque.
- IMPORTANT: casting shadows can have a higher performance cost, use carefully!
- to cast shadows on movable entities, light ig.EntityExtended#performance must be movable and ig.EntityLight#castsShadowsMovable
- Source:
-
castsShadowsMovable :Boolean
-
Whether light should cast shadows on movable objects that are ig.EntityExtended#opaque.
- IMPORTANT: casting shadows can have a higher performance cost, use carefully!
- to cast shadows, light must also ig.EntityLight#castsShadows
- doesn't work in combination with ig.EntityLight#pixelPerfect due to performance reasons
- Source:
-
<readonly> changed :Boolean
-
Whether entity has changed since last update.
- Inherited From:
- Default Value:
- 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:
- Source:
- See:
-
-
<readonly> checking :Boolean
-
Whether entity is checking against another entity matching ig.Entity#checkAgainst flag.
- Inherited From:
- Default Value:
- Source:
-
climbable :Boolean
-
Whether entity is climbable.
- Inherited From:
- Default Value:
- Source:
-
climbableStairs :Boolean
-
Whether entity is climbable as stairs.
IMPORTANT: has no effect unless ig.EntityExtended#climbable is true.
- Inherited From:
- Default Value:
- 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:
- Source:
- See:
-
-
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:
- Source:
-
collidingWithEntitiesBelow :Boolean
-
Whether entity is colliding with one or more entities below.
- Inherited From:
- Default Value:
- Source:
-
collidingWithMap :Boolean
-
Whether entity is colliding with a wall, floor, ceiling, etc in collision map.
- Inherited From:
- Default Value:
- 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:
- Source:
-
-
Currently displaying animation.
- defers to ig.EntityExtended#overridingAnim
- Inherited From:
- Default Value:
- 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:
-
<readonly> dieing :Boolean
-
Whether entity is in the process of dieing.
- Inherited From:
- Default Value:
- Source:
-
<readonly> dieingSilently :Boolean
-
Whether entity is in the process of dieing without effects or animation.
- Inherited From:
- Default Value:
- Source:
-
diffuse :Number
-
How much light should get through objects that are ig.EntityExtended#opaque.
- Source:
-
dynamicColor :Boolean
-
Whether color can change dynamically in addition to alpha.
- be aware that this comes at a slightly higher performance cost
- Default Value:
- Source:
-
facing :Vector2|Object
-
Facing direction of entity based on velocity and look at.
- Inherited From:
- Default Value:
- 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:
- 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 :Boolean
-
Whether entity should skip updating.
- Inherited From:
- Default Value:
- Source:
-
g :Number
-
Green value from 0 to 1.
- Source:
-
gradient :Boolean
-
Whether light should be gradient or flat shaded.
- this works well in combination with ig.EntityLight#pixelPerfect
- 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:
- 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:
- Source:
-
-
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:
- Source:
-
hollow :Boolean
-
Whether entity only casts shadows from edges when ig.EntityExtended#opaque.
- Inherited From:
- Default Value:
- Source:
-
ignoreSystemScale :Boolean
-
Whether entity elements should ignore system scale.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.IGNORE_SYSTEM_SCALE
- Source:
-
-
Off screen canvas to cache complete light to improve performance.
- created on init
- Source:
-
-
Off screen canvas to cache base light to improve performance.
- created on init
- Source:
-
-
Off screen canvas to cache shadows to improve performance.
- created on init
- Source:
-
-
Off screen canvas to cache light color to improve performance.
- created on init
- Source:
-
<readonly> intersecting :Boolean
-
Whether entity is intersecting another entity.
- Inherited From:
- Default Value:
- Source:
-
invulnerable :Boolean
-
Whether entity blocks all incoming damage.
- Inherited From:
- Default Value:
- Source:
-
<readonly> items :Array
-
List of items to cast shadows with.
- populated on update
- Source:
-
layerName
-
- Default Value:
- Source:
-
-
Another entity that this entity is linked to.
- Inherited From:
- Default Value:
- Source:
-
<readonly> managed :Boolean
-
Whether entity is currently being managed by ig.GameExtended#playerManager.
- Inherited From:
- Default Value:
- 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:
- Source:
-
<readonly> moving :Boolean
-
Whether entity is moving.
- Inherited From:
- Default Value:
- Source:
-
<readonly> movingTo :ig.EntityExtended|Vector2|Object
-
Whether entity is moving to another entity.
- Inherited From:
- Default Value:
- Source:
-
<readonly> movingToOnce :Boolean
-
Whether entity should move to another entity and stop moving.
- Inherited From:
- Default Value:
- Source:
-
<readonly> movingToTweening :Boolean
-
Whether entity is tweening to another entity.
IMPORTANT: this is automatically disabled with dynamic entities!
- Inherited From:
- Default Value:
- 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:
- Source:
-
<readonly> movingY :Boolean
-
Whether entity is moving vertically.
- Inherited From:
- Default Value:
- 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:
- 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:
-
-
-
Signal dispatched when entity added to game.
- created on init.
- Inherited From:
- Source:
-
oneWay :Boolean
-
Whether entity is one way
- Inherited From:
- Default Value:
- Source:
-
oneWayFacing :Vector2
-
Direction from which entity will collide with another entity.
- Inherited From:
- Default Value:
- Source:
Example
// 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 };
-
-
Signal dispatched when entity completes moving to another entity.
- created on init.
- Inherited From:
- Source:
-
-
Signal dispatched when entity is refreshed.
- created on init.
- Inherited From:
- Source:
-
-
Signal dispatched when entity removed from game.
- 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:
-
Example
// 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:
-
-
Currently overriding animation.
- if present, this displays instead of ig.EntityExtended#currentAnim
- Inherited From:
- Default Value:
- Source:
-
<readonly> paused :Boolean
-
Whether entity is paused.
- Inherited From:
- Default Value:
- Source:
-
-
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:
- 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:
- Source:
-
pixelPerfect :Boolean
-
Whether light should be drawn and scaled pixel perfectly.
IMPORTANT: pixel perfect scaling has a very high performance cost, use carefully!
- doesn't work in combination with ig.EntityLight#castsShadowsMovable due to performance reasons
- Source:
-
pos :Vector2|Object
-
Base position.
- Inherited From:
- Source:
-
<readonly> posDraw :Vector2|Object
-
Drawn position.
- Inherited From:
- Source:
-
r :Number
-
Red value from 0 to 1.
- Source:
-
radius
-
Size of light can be set either through ig.EntityLight#size or ig.EntityLight#radius property.
- if size is used, larger of x and y will become size and radius
- if radius is used, size will copy radius
- Default Value:
- 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:
- 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:
- 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:
-
samples :Number
-
Number of passes to make when casting shadows.
- IMPORTANT: casting shadows can have a higher performance cost, use carefully!
- Source:
-
scale :Number
-
Scale that overrides system scale when ig.EntityExtended#ignoreSystemScale is true.
- Inherited From:
- Default Value:
- 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:
- Source:
-
scaleOfSystemScale :Number
-
Scale of system scale.
- Inherited From:
- Default Value:
- ig.CONFIG.ENTITY.SCALE_OF_SYSTEM_SCALE
- Source:
-
size
-
Size of light can be set either through ig.EntityLight#size or ig.EntityLight#radius property.
- if size is used, larger of x and y will become size and radius
- if radius is used, size will copy radius
- Default Value:
- Source:
-
<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:
-
-
standing :Boolean
-
Whether entity is standing.
- Inherited From:
- Source:
- See:
-
-
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:
- 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:
- 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:
- Source:
- See:
-
-
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:
- Source:
-
<readonly> wasChecking :Boolean
-
Whether entity was checking against another entity matching ig.Entity#checkAgainst flag.
- Inherited From:
- Default Value:
- Source: