+
Skip to content

0.12.0

Latest
Compare
Choose a tag to compare
@sporeball sporeball released this 12 Jun 00:19

more than 2 years after the most recent patch, victus 0.12.0 is here! it's the biggest victus update ever, and not in terms of the file size - in fact, quite the opposite, as this build is less than 1400 bytes in size!

features

file size improvements

  • builds are now crushed using the brilliant JSCrush algorithm, saving nearly 1000 bytes.
  • a 3-byte-per-key version of JS1k's time-honored canvas context hash trick is now used internally, saving 33 bytes before crushing.
  • Primitive.clone() is now just 2 lines long.
  • countless other byte saves all over the framework.

new stuff

  • the Primitive class has been added to the victus object, allowing for the creation of custom classes which extend it.
  • new rotation features are now available, including an rv property for rotational velocity as well as rotateTo() and rotateBy() methods.
  • the Rect, Ellipse, and Sprite classes now include a path property, allowing for the use of CanvasRenderingContext2D.isPointInPath().
  • the keys object has been completely refactored, and now exposes press and held properties for every key returned by KeyboardEvent.key.

quality of life

  • the canvas context is now simply exposed as victus.ctx.
  • the Sprite.spr, Sound.vol, and Sound.loop properties can now be set directly.
  • Sound.vol is now optional (defaults to 1).

bugfixes

  • the let keyword is now used instead of var (#1).
  • Primitive.xv and Primitive.yv are now in pixels per second, not pixels per frame.
  • Primitive.ax and Primitive.ay are now relative to the top left corner of the canvas, not the top left corner of the primitive.
  • the anchor point of a primitive will now move when the primitive does.
  • Ellipse instances are now drawn with the correct radii.
  • Sound.reset() now sets the sound's currentTime property to 0 instead of reloading the whole sound.

other changes

  • a test directory has been created.
  • certain keywords and method names have been changed; see the 0.11.2 → 0.12.0 migration guide for more information.

0.11.2 → 0.12.0 migration guide

  • because of the change in units of Primitive.xv and Primitive.yv, these values should now be divided by 60.
  • also note the change to Primitive.ax and Primitive.ay, and change relevant code accordingly.
  • the Primitive.setProps() method has been changed to Primitive.set().
  • the Primitive.rotation property has once again been changed to Primitive.r.
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载