There are a few API breaking changes in this release but nothing that should be very complicated to update.
Function parameter hints with overload support
The script editor gained a new hint popup that will present the various variants of a function as well as their parameters.
Use Up or Down to cycle through them. The popup will appear automatically when writing a function call but you can trigger it manually with Ctrl+Space too.
Animation speed and sprite renderer playback speed
You can now define each animation's speed (a multiplier of the sprite's frames per second setting) in the sprite editor.
Additionally, you can control a sprite renderer's global playback speed with the new Sup.SpriteRenderer.setPlaybackSpeed(speed: number) method.
Animation time APIs
We've removed the Sup.SpriteRenderer.getAnimationTime(), .setAnimationTime(time: number) and .getAnimationDuration() methods (which worked with seconds) in favor of Sup.SpriteRenderer.getAnimationFrameTime(), .setAnimationFrameTime(frameTime: number) and .getAnimationFrameCount(), which use frame indices instead.
Floating point numbers have limited precision so the old methods using seconds led to various limitations and didn't allow frame-precise behaviors. Some of your code might need to be updated (sorry!), but we believe this is for the best, as people won't be bitten by these issues anymore.
Better sound playback API
Playing back a sound effect is now as simple as calling Sup.Audio.playSound("Sound Asset");.
You can optionally pass in the volume and additional options: Sup.Audio.playSound("Sound Asset", 0.5, { loop: false, pitch: 1 });
If you need to setup a sound player without starting playback right away, Sup.Audio.SoundInstance is still around but has been renamed Sup.Audio.SoundPlayer (why use complicated words?) and its constructor has gained the same additional parameters.
Disabling ArcadePhysics2D bodies
You can now temporarily disable ArcadePhysics2D body components with Sup.ArcadePhysics2D.Body.setEnabled(enabled: boolean). Gravity won't be applied to it anymore and it'll be ignored for collisions by other bodies.
Random floats!
You can now use Sup.Math.Random.float(min, max) to get a random real number, similarly to Sup.Math.Random.integer(min, max) (for integers).
Note that if you need a seedable random number generator for reproducible world generation, RNG.js is also available.
Check out the TypeScript API browser to see how it works!
Noteworthy fixes and improvements
- We worked around a recent Firefox regression that gave you a 16-bit depth buffer instead of a more manageable 24-bit one.
- You can now press F12 to open the devtools while running your game through the Superpowers app.
- Similarly, you can now press F5 to reload the game window without rebuilding.
- When pressing Ctrl+Shift+Tab to move to another tab while in a 3D editor, Superpowers won't move the camera down anymore.
- Sprite flips now correctly take the origin into account