Gameplay changes:
- Press the B button for a speed boost. Use with care.
- The playing area now wraps around, asteroids no longer bounce off invisible walls.
- When starting a new wave, make sure the asteroids aren’t too close to the player.
- Added a new accelerometer control scheme using tilt yaw/pitch and stick roll.
The game now starts at a settings screen that allows choosing the control scheme, cockpit on/off, and some graphics-related flags. You can also choose a starting wave for increased difficulty. The settings are stored persistently using the settings API, so they should remain set across restarts.
Behind the scenes, I restructured how it draws to the screen, cutting the memory consumption almost in half (from ~40kB to~ 25kB according to heap snapshots), and increasing performance a bit. Boring technical bits following, feel free to skip these
I had been modifying scene.backgroundImage()
since I thought that this corresponded to the screen buffer, but that’s actually a separate in-memory image which needs about 10kB, and also needs to be copied to the screen every frame as an additional internal step.
Now I’m using scene.createRenderable()
instead, this is far more efficient since it actually does draw to the screen buffer directly. It’s also integrated into the scene Z hierarchy, making it easy to structure UI layers without needing separate images. See the Is it possible to write directly to screen (pixels) on the Arcade? thread for more information on this.
This also made it possible to simplify the starfield background code a lot, and to add screen shake effects to the radar screen for consistency.
Enjoy!