Skip to content

r5

Compare
Choose a tag to compare
@collinhover collinhover released this 04 Oct 18:58
· 120 commits to master since this release
General
  • Load up Impact++ by requiring 'plusplus.core.plusplus' instead of several separate modules
  • Impact++ now appropriately handles various game screen sizing options, including:
    • fixed pixel size (static scale)
    • pecent of screen (static scale)
    • minimum number of pixels in view (dynamic scaling)
  • Impact++ now allows per entity scaling, which can be particularly useful for UI and text when dynamically scaling
  • Impact++ now works for both 2D sidescrolling and top-down (see ig.CONFIG.TOP_DOWN)
  • Added SUPER COLLIDER! demo as a test suite / kitchen sink (~130 features as of release)
  • Added more warnings and tips to docs to avoid confusion.
  • Heavy bug hunting completed!
CONFIG
  • DYNAMIC renamed MOVING
  • KINEMATIC renamed DYNAMIC
  • AUTO_SORT_LAYERS added
  • PRERENDER_MAPS added
  • CANVAS_WIDTH_PCT renamed GAME_WIDTH_PCT
  • CANVAS_HEIGHT_PCT renamed GAME_HEIGHT_PCT
  • DEBUG removed, useless config value
  • CAMERA.BOUNDS_ and CAMERA.TRAP_BOUNDS_ renamed to CAMERA.BOUNDS_TRAP_
  • MIN_TIME_STEP added (automatically caps fps on mobile)
Physics
  • Box2D physics removed from Impact++, performance is not acceptable for mobile web
  • EntityShapeEdge and ig.utilsphysics removed
  • ig.utilstile.shapesFromCollisionMap returns shapes with solids instead of edges
Tiles
  • Collision tiles completely reworked, all half tiles removed (use offset instead)
  • Climbable collision tiles are now climbable AND stairs
  • Collision visualization tiles now in 4 sizes: 64 px, 32 px, 16 px, and 8 px
ig.BackgroundMap
  • ig.BackgroundMap expanded to ig.BackgroundMapExtended
ig.GameExtended
  • getEntitiesByType now searches by an entity's type property (instead of by class as the method does in vanilla ImpactJS)
  • getEntitiesByClass now searches by entity class (to help avoid confusion)
  • getEntities* all use getEntitiesMatching
  • getEntitiesMatching settings object refactored fromsettings.x/y to settings.from.x/y
  • getEntitiesMatching settings now accepts a distanceSquared to search by distance
ig.EntityExtended
  • ig.EntityExtended has been significantly changed!
  • entities now stick to slopes by default, but all other gravity response cases remain the same
  • persistent entity swapping handled by game instead of entity's staticInstantiate method
  • reset now called at end of init method (instead of at start)
  • initVisuals removed and functionality moved to resetExtras method
  • recordResetState moved into resetExtras method
  • no longer reliant on bounds, use pos + size properties instead
  • no longer reliant on boundsDraw, use posDraw + sizeDraw properties instead
  • bounds/boundsDraw now opt-in and null by default
  • updateBounds no longer recalculates bounds or vertices by default
  • verticesNeeded renamed needsVertices
  • getTotalPosX/Y renamed getDrawX/Y
  • totalSizeX/Y renamed sizeDraw.x/y
  • flip from boolean to object flip.x/y
  • flip.x/y now controlled by properties canFlipX/Y
  • dynamics updates, such as gravity and collisions with collision map moved into updateDynamics method
  • all animation names are now directional, i.e. "spawn" is now "spawnX/Y/Left/Right/Up/Down" based on flip.x/y and facing.x/y
  • addAnim now takes only animation name and settings as parameters
  • collideWith replaces ig.Entity.seperateOnX/YAxis for better control of collisions
  • collideWith parameters changed
  • ig.Entity.COLLIDES renamed ig.EntityExtended.COLLIDES to be consistent with ig.EntityExtended.TYPE
  • pointInside removed
  • refresh added and called by reset (instead of ready)
  • ready now called by way of adding for proper execution order
  • _ungroundedFor renamed ungroundedFor
  • ungroundedFor no longer increases when climbing
  • moveToEntity renamed moveTo and automatically handles moving to entity or position
  • movingToEntity removed
  • movingTo property now holds a reference to what the entity is moving to rather than true/false
  • moveToHere renamed moveToStop
  • textured now creates textures on first draw call instead of when animations first added
  • castShadows renamed castShadow
  • project renamed projectShadow
  • fixed entities can now collide with each other safely!
  • ig.Entity.checkPair renamed ig.EntityExtended.checkPair to preserve original functionality
  • ig.Entity.solveCollision renamed ig.EntityExtended.solveCollision to preserve original functionality
ig.AnimationExtended
  • init now takes only animation sheet and settings as parameters
  • can now play in reverse
  • update reworked so stop pauses instead of sets frame to end
  • changed added to keep track of when animation changes tiles
ig.Character
  • moveToLocation removed and replaced with pathfinding
  • anims.run renamed anims.move
  • no longer restores stats on ready by default, as no longer needed
  • respawn method removed, as no longer needed
  • checking if any abilities are in use is now as easy as myCharacter.abilities.getUsing
ig.Creature
  • creatures no longer tether to spawner by default, use tetherToSpawner and ig.CONFIG.CREATURE.TETHER_TO_SPAWNER to set
  • can find predator and prey by entity name, class, or group (as opposed to only group)
  • groupPrey renamed preyGroup
  • entityPrey renamed prey
  • groupPredator renamed predatorGroup
  • entityPredator renamed predator
  • creatures now properly search for prey/predator by distance instead of doing an AABB intersection test
  • creatures no longer wander while using abilities unless ability allows movement
ig.Player
  • deathDelay moved to ig.EntityCheckpoint.respawnDelay
  • player no longer handles respawning self, now handled by checkpoint
  • player no longer handles camera movement to self when respawning, now handled by camera
ig.Particle
  • particle now automatically sets facing.x/y based on velocity
  • particle now automatically sets currentAnim to "move" + direction based on facing
ig.Projectile
  • updateCurrentAnim moved to ig.Particle
  • placeholdAnims moved to ig.Particle
ig.EntityTrigger
  • ig.EntityTrigger has been significantly changed!
  • now properly chains triggers (if you are getting strange behavior, check your trigger targets and check your activate/deactivate overrides)
  • to define repeated actions, use activate instead of setupand deactivate instead of teardown
  • to define temporary modifications, use setup instead of activateand teardown instead of deactivate
  • triggering added to help prevent triggers from infinitely looping
  • actual activation of all targets now handled by handleTargets for easier overriding
ig.Spawner
  • spawnAtTarget removed
  • use spawnTargetSequence instead of targetSequence when referencing spawn locations
  • unspawned entities are now automatically unlinked to be consistent with spawning automatically linking
  • added respawnDelay to allow a pause between endless spawning (ex: checkpoints)
ig.EntityLight
  • settings now determined by ig.CONFIG.LIGHT for easier control
  • createLight renamed drawLight
  • createCache renamed resizeCache
  • canvas caches created in initProperties method for better garbage handling
  • castShadows renamed drawShadows
  • castShadows now handles casting each item in light bounds (and called by drawShadows)
ig.EntityDestructable
  • now no longer damageable or targetable or collidable
  • ig.EntityDestructableCollide is now collidable
  • ig.EntityDestructableDamage is now damageable and targetable
ig.Door
  • locked and autoLock added
ig.EntitySwitch
  • stuck renamed broken
  • autoStuck renamed autoBreak
ig.UIElement
  • ig.UIElement has been significantly changed!
  • refresh moved to ig.EntityExtended
  • resize moved to ig.EntityExtended
  • reposition moved to ig.EntityExtended
  • rebuild moved to ig.EntityExtended
  • link/unlink moved to ig.EntityExtended
  • vertical moved to ig.UIMeter
  • size now includes margins and alignment and calculated in reposition
  • ui elements will revert pos toresetState.pos unless linked or pos as pct of screen size
  • ui elements that are linked begin at the center of the element they are linked to!
  • linkAlign now controls how far inside or outside of linkedTo a linked UI element is offset, where 0 is the center
  • resize renamed refresh
  • onResized renamed onRefreshed
  • refresh calls (in order) resize and reposition
  • ig.UIText no longer positions to center by default (but still aligns to center by default)
ig.EntityConversation
  • ig.EntityConversation has been significantly changed!
  • pausing now split into pausing and locking to give finer control
  • steps can now define whether the speaker for that step is locked
  • steps can now define the speaker's talk animation name (defaults to talk)
  • no longer kills self on complete by default, listens to suicidal property as expected
ig.UIMeter
  • size now includes bar size and is calculated in resize
  • meters will revert size toresetState.size when refreshed
ig.Ability
  • castSettings.entity renamed castSettings.entityClass
  • castSettings.entityClass is no longer stored for reuse
  • casting now account for facing of entity using ability and appends direction to casting animation name
  • casting can now automatically stop the movement of the entity using ability based on autoStopMoving
  • added methods to check for whether ability is being used .getUsing and whether ability is being interrupted .getInterrupted
ig.Camera
  • settings moved from ig.CONFIG to ig.CONFIG.CAMERA
  • bounds renamed boundsTrap
  • boundsPct renamed boundsTrapPct
  • boundsTrapPct is off by default, use ig.CONFIG.CAMERA.BOUNDS_TRAP_AS_PCT or ig.Camera.boundsTrapAsPct to toggle on
Utils
  • ig.utilsdraw.pixelFillPolygon no longer takes bounds object, takes min/max x/y
  • ig.utilsdraw.fillPolygon no longer takes fill parameters, instead it assumes fillStyle has already been set
  • ig.utilsintersection bounds methods can be optionally passed a bounds object to help with garbage collection
  • ig.utilsclass pooling removed and replaced by ig.EntityPool (which is almost identical)
ig.pathfinding
  • pathfinding added, use ig.Character.canPathfind with ig.EntityExtended.moveTo for magic!
  • pathfinding is garbage free
  • pathfinding map added to draw optimal pathfinding areas
  • pathfinding map tiles reduced from 6 to 4 (jumping tiles 5 and 6 redundant)
  • pathfinding should behave much more sensibly and handle slopes better
  • pathfinding in simple mode will now move over slopes by default, but this can be disabled by passing avoidSlopes as false in the move settings
ig.ImageDrawing
  • canvas and context removed
  • complete overhaul of scaling to defer scaling until first draw call
  • most methods and properties moved to ig.Image