Skip to content

Releases: AthenaJS/athenajs

v0.1.0

22 Dec 15:43
Compare
Choose a tag to compare

NEW FEATURES

This is the second major release of AthenaJS since initial release and contains lots of new features and numerous bugs were fixed.

Scene Debugger

AthenaJS 0.1.0 includes a new scene debugger which can be brought up by pressing d at any time:

scene_debugger

With this you can easily inspect your scene objects and map tiles;

  • view object hitboxes
  • view tile behavior
  • view tile number

To include it in your game, simply pass the debug:true option to your game's constructor.

New documentation!

The documentation has been rewritten from scratch using Docma.

It's now more pleasant to read with a section for each API group and a getting started section with tutorials.

New repository to quickly get started

A new repository has been created so that an AthenaJS project can be started in a minute or two: just clone the athenajs-webpack-starter repository, type npm install and you are ready to go!

New: Behavior class

  • create and re-use your own object behaviors

New: Canvas class

  • draw shapes using this new class: it's basically a wrapper over canvas drawing APIs

Deferred

  • new Deferred.resolve() to create a resolved promise

Dom

  • added ability to retrieve a dom node
  • added limited support for changing css properties
  • added Dom.find()to find children inside a collection
  • added Dom.removeClass()
  • Dom.addClass() can add several classes, separated by a space
  • new keyword is now optional

Drawable (was: Object)

  • new drawable.moveTo(): plan a move with custom easing function
  • new drawable.setMask(): apply (rect for now) masks to your objects, including exclude mode
  • drawable.move() renamed to drawable.update(), now receives current timestamp
  • implemented opacity handling in drawable base class so that any drawable now supports opacity

Game

  • added game.toggleFullscreen() to toggle game fullscreen support (requires the fullscreen API)
  • new: pressing p key will call Game.scene.pause() and stop rendering & event loops
  • new: if window becomes inactive, Game.scene.pause() is also called (requires visibility API)

InputManager

  • gamepad detection and automatic mapping of arrow keys+ctrl+space to gamepad dpad + buttons 0/1
  • new isKeyPressed() shortcut that can take string for common keys instead of keycodes (eg. isKeyPressed('UP'))
  • InstallKeyCallback() can now accept multiple keys in a single call (separated by a space character)

Map

  • new map.addTileSet(): quickly add a new set of tiles programmatically
  • new map.updateTile(): update map tiles at runtime
  • new map.getMaxDistanceToTile() for tiles-based platform moves
  • new map.checkMatrixForCollision() for detecting collisions between tetris-like shapes & maps
  • new map.shift() that allows to shift a part of the map (tetris-like games)
  • new map.clear() that clears the whole map with tile/behavior (Tetris)
  • new map.setEasing()to change scrolling easing function

ResourceManager

  • now using new createImageBitmap API if available to allocate bitmaps in VRAM
  • new ResourceManager.loadImage() no longer marked as private and can be used to load a single image

Scene

  • new: Map doesn't need to be the same size as the scene anymore
  • new: scene.loadImage()& scene.loadAudio()can be used in new scene.load()to preload sounds
  • new scene.fadeIn(), scene.fadeOut(), Scene.fadeInOut()
  • new scene.setLayerPriority()
  • scene.setMap() now has new parameters: x, y that allow placing the map anywhere onto the scene

Sprite

  • new sprite.addAnimations(): easily add new animations to your sprite at runtime

Athena-samples

  • new: a new sample app has been written. It covers main topics: objects, effects, scene effects, behaviors, maps, sound

BUGS FIXED

Dom

  • fixed: lots of fixes in jQuery-lite implementation

Game

  • fixed: set target width/height (when no target is specified), fixes invisible background
  • fixed: if a new scene was set before the previous one was finished loading, two scenes would end up being started

Map

  • fixed: background & multidirectional scrolling
  • fixed: triggers were not reset properly
  • fixed: window calculation didn't work correctly if viewport window wasn't centered

Scene

  • fixed: rewrote scene load/start code which is now more robust and allows adding objects before the scene has been loaded
  • fixed: map.setBackgroundImage() didn't use scene target element
  • added catch when calling scene.load(), this fixes silent errors because es6-promise was silently catching errors

Sprite

  • fixed: angle/scale wasn't applied outside of animate, so calling mySprite.setAngle(Math.PI) would have not effect

SimpleText (was Text)

  • fixed: undefined was displayed instead of empty string if no text was set

NEW APPS

  • A new game has been developed using AthenaJS: athenatris

BREAKING CHANGES

Two classes have been renamed to avoid collisions with native JavaScript objects:

  • GfxObject -> Drawable
  • Text -> SimpleText