v0.11.0
Pre-releaseNew on-disk asset layout
NOTE: This is a risky change so, as usual, make sure to back up your projects before upgrading.
In v0.10, asset folders used to be named by their numerical ID. This made browsing the project's assets on disk basically impossible so the full path of the asset is now included. The various asset files have also been renamed to be more explicit and use appropriate extensions where possible.
See the source project for our Ludum Dare 33 game, Fat Kevin for an example of the new folder layout.
Transform gizmos in the scene editor
The scene editor has gained handles for moving, rotating and scaling actors.
You can also use Ctrl
to snap to a 1x1x1 grid (which will be configurable later). Snapping doesn't work well when in "Local" mode though. The handles don't work with a 2D camera either for now. Baby steps!
Improved shader and multiple texture maps support
The shader editor has seen numerous improvements.
You can now declare texture uniforms, and both models and sprites now have an Advanced textures
button that let you upload arbitrary additional textures for use with your shaders.
Superpowers uses Three.js as its 3D engine under the hood. You can now reuse shader chunks from Three.js's library with the THREE_ShaderChunk(chunk_name)
macro in shaders, and there's a checkbox in the uniforms table to have Superpowers automatically expose Three.js's lights as uniforms.
See Fat Kevin's Toon Shading shader for some examples.
Finally, the vertex and fragment shaders now have a draft system like in the script editor, with a Save
button to apply changes.
Raycasting
The new Sup.Math.Ray
class lets you cast rays against a list of actors.
let ray = new Sup.Math.Ray();
ray.setFromCamera(someCameraComponent, Sup.Input.getMousePosition());
let results = ray.intersectActors(listOfActors);
Sup.log(results);
It returns a sorted list of hits with positions and normals. Should be useful for all kinds of games as it lets you do precise mouse picking :)
You can also use Sup.Math.Ray.intersectPlane
and the new Sup.Math.Plane
class to cast rays onto planes.
Streamlined APIs
We've streamlined various APIs to make them more pleasant to use.
You can now create a vector with all its components set to a particular value by passing a single parameter to new Sup.Math.Vector3(xyz);
.
Using assets is now easier. For instance, instead of doing this.actor.spriteRenderer.setSprite(Sup.get("My Sprite", Sup.Sprite));
, you can now write this.actor.spriteRenderer.setSprite("My Sprite")
directly.
Auto-repeat key presses
You can now pass { autoRepeat: true }
to Sup.Input.wasKeyJustPressed()
and it'll return true at regular intervals after an initial delay. It's very useful for erasing or moving around with arrow keys in text fields for instance, or any other keyboard controls in menus. See the Text input demo to see it in action.
Open referenced assets from the scene editor
You can now quickly open an asset referenced by a component in a scene with the new Open
button.
Actor.getBehavior works with derived classes
Assuming you have a behavior class B
that extends the behavior class A
, you can now use actor.getBehavior(A);
and get back an instance of B
. This is useful if you need to specialize a behavior but still reuse most code from another.
XZ plane for ArcadePhysics2D
You can now choose whether ArcadePhysics2D should work with the XY or XZ plane in your game. Pretty useful if you're making a top-down game for instance.
Superpowers packages are now built with npm@3
npm@3
has a flatter node_modules
directory tree. This should fix the long-path issues various people encountered on Windows when unzipping Superpowers.
Noteworthy fixes and improvements
- The Behavior scene component now supports customizing
Sup.Math.Vector3
properties - Improved parsing of OBJ files as well as importing more glTF files
- You can now define a unit ratio in the model importer to normalize all your model sizes
- Sprite animation frames can now be displayed in column-first order instead of row-first
- The number of assets in a folder is displayed on hover in the project tree view
- Fixed mouse buttons getting stuck in various editors (introduced in v0.10)