Week 68: Camera-swaps and level controls

An animated GIF of a recording from Meteor Power showing outlines and buttons fading depending on the distance from the center of the screen.
Buttons fade-out near the edges of the screen.
Scroll events work correctly even when a button is hovered.

tl;dr: Last week I added improved camera-swapping, a new level-overlay button system, and a system for detecting when a region is close to the center of the screen.

What happened last week?


  • Improved support for swapping cameras.
    • I use this to switch between whether the player can move the camera with touch gestures, or whether the camera follows a navigation path preselection highlight as the player drags their finger around the edges of the screen.
  • A new level-overlay button system.
    • I've consistently had trouble with Godot's normal Button system interfering with scroll events.
    • Not that I'm more heavily relying on scroll events (at least in the desktop environment), this is pretty important!
  • A new system for detecting when a region is close enough to the center of the viewport.
    • This is useful for focusing/highlighting things when they are at the center of the screen.
An animated GIF of a recording from Meteor Power showing the camera being controlled alternatively by touch gestures and by navigation preselection.
When the bot is selected, the camera focuses on the bot or follows the cursor as it is dragged around to select a navigation path.
When the bot is not selected, the camera is controlled explicitly with swipes and mouse scrolls.

Laundry list

  • More camera system updates:
    • Swap back to the non-player level camera when deselecting the character.
    • Remove obsolete character reference from CameraController.
    • Refactor the camera/camera-pan-controller/camera-controller/camera-manifest system.
      • Now there are only camera subclasses and the camera-manifest.
      • This makes it much easier to make updates to the active camera, since all updates can happen through one point of control.
    • Add support for not destroying a camera when swapping.
    • Rename camera subclasses.
    • Add support for tracking a character's position in NavigationPreselectionCamera.
    • Add a new _camera_swap_zoom component similar to the _camera_swap_offset component.
    • Remove redundant sync_to_camera.
    • Fix a regression in the camera-swap offset transition.
    • Update swipe-camera to start with the previous camera's position.
    • Prevent cameras from updating when not active.
    • Fix camera-swap offset transition.
    • Add logic for dynamically adjusting the sprite size and parallax-layer mirroring size to match the current camera zoom.
  • New level-region UI detection systems:
    • Create a new level-overlay button system.
    • Create a new system for detecting when a region is close enough to the center of the camera / viewport.
    • Miscellaneous fixes:
      • Fix LevelButton mouse event detection.
        • My Viewport ancestor node needed to have physics_object_picking set to true.
      • Update station buttons for the new level-overlay button system.
      • Dynamically show station overlay-buttons based on their position in the viewport.
      • Remove station overlay-button emphasis on hover, and fix station overlay-button positioning.
      • Fix station overlay-button click boundary.
      • Fix station overlay-buttons to render in-front-of bots.
  • Miscellaneous:
    • Fix brightness of tileset clipped corners
    • Fix window movement to other monitor.
    • Add support for tracking whether a touch-move had a corresponding touch-down.
    • Fix PathPreselectionAnnotator to render invalid-destination-target annotations.
    • Add support for swiping with mouse-middle-clicks.
    • Add some new editor icons.
    • Add garbage-collecting to ScaffolderTime, in order to prevent memory leaks.
    • Fix an issue with the invalid-navigation-destination indicator not updating position as the camera moves but the cursor doesn't.
    • Add app-publishing metadata to Meteor Power:
      • Privacy Policy
      • ToS
      • Error-log-reporting URL (using a Google Cloud Storage bucket).
      • Analytics
      • HTML export shell
    • Add a post on https://snoringcat.games for Meteor Power.
    • Tried-out the new v2.0-beta version of Pixel FX Designer.
    • Found and installed a new Dvorak-related keyboard layout.
      • This doesn't actually have anything to do with my game-dev work, but I thought it was interesting enough to mention.
      • This uses Programmer Dvorak bindings, as I am used to.
      • But this switches to Qwerty when ctrl is pressed, which lets me get back to the original keys that shortcuts were designed around!
      • Also, this swaps the backspace and caps lock keys.
      • This will take some getting used to!
      • But I think it’ll be a great change.

What's next?

  • Add a message-panel system.
    • I'll use this to show details when selecting a bot or station.
    • I'll also move most of the command buttons into this panel.
  • Add a hold-to-press button.
    • I'll use this for most in-game buttons.
    • When the player taps the button, more details will be shown for the button.
    • When the player holds-down on the button for a while, the button will be triggered.
  • Add logic to automatically select and command the closest bot when triggering a station command.
  • Add a system for queuing bot commands.
    • This way, when the player triggers another command, it doesn't have to cancel a previous command.

🎉 Cheers!

This is a simple icon representing my sabbatical.