2D Platformer – build 006

22 June 2021 gamedev

No big visual changes in this build. But I finally got around to learning how audio works in Unity.

New stuff:

  • Made a music manager system, capable of playing music tracks and fading between them. It can also fade up/down to different “intensity levels” or “layers” of synchronised audio tracks. E.g. just ambient/subtle music, then add new instruments to grow in intensity such as entering combat. Current build doesn’t really show this off though.
  • Made a basic audio manager, which uses the Unity Audio Mixer to volume for music/SFX – so now the global mute and music mute buttons in the options menu actually work (though there are no sound effects in the game yet). TODO: make them sliders, not toggles.
  • Fullscreen and windowed mode now actually work. Though it’s a bit weird on the WebGL version due to browser permissions. The fix for this is a bit hacky and my target audience (my niblings) will play it on Windows anyway.
  • Added vsync and framerate limiter (it was reaching 3000fps and making my GPU hit 100% load). However this seems to make the WebGL version appear a little jittery. UPDATE: fixed in newer builds.
  • Using user preferences to save volume and fullscreen/window preferences between play sessions. Surprisingly this also works on WebGL version.

The build is getting pretty big at 77mb for WebGL version and over 300mb for Windows version! Likely due to the 11 uncompressed audio tracks in this build for my music manager testing, and no real effort to efficiently compress the sprites I’ve created which make up the main menu and the hero. TODO: look into compression techniques.

This content does not resize on smaller browser widths. Try using the fullscreen button below (after loading the game).
WebGL builds are not supported on mobile devices.

Controls

Action Keyboard Xbox controller (or other controllers)
Movement A/D, or Left/Right arrows left analogue stick
Jump Space A button (the bottom ‘primary’ button)
Crouch S or Ctrl left bumper or left trigger
Menu Escape Start
comments powered by Disqus