Skip to main content

Vertical Shooter Reference

Use this page as a source-reading map. For the architecture and caveats, read Example Walkthrough: Vertical Shooter.

Read In This Order

FileQuestion it answers
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterGame.tsHow does the game enter its first scene?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterMenuScene.tsHow do start, store, pairing, player selection, settings, and quit fit together?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterLevelScene.tsHow does an Hs2dLevelScene load, build, update, synchronize, render, restart, and dispose?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterGameLogic.tsWhich rules can remain independent of rendering?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterPauseScene.tsHow does a pausing overlay freeze the level and background audio?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterEconomy.tsHow do the menu store and level resolve the same persistent progress?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterUpgradeDefs.tsWhere do persistent upgrades, run power-ups, and drop weights live?
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterWaveDirector.tsHow are scheduled waves bounded and advanced?
../hosanna-ui-game-samples-public/asset-bundles/native-shoot-em-up/asset-bundle.jsonWhich bundle keys must be ready?
../hosanna-ui-game-samples-public/asset-bundles/native-shoot-em-up/levels/level-1.jsonWhich world and entity data comes from Tiled?

Architecture At A Glance

Vertical Shooter reference architecture from menu and overlay navigation through asset readiness, auto-mode Tiled world construction, retained simulation, fixed pools, HUD, and lifecycle persistenceVertical Shooter reference architecture from menu and overlay navigation through asset readiness, auto-mode Tiled world construction, retained simulation, fixed pools, HUD, and lifecycle persistence

Copy These Patterns

  • Handle bundle states before loading a level or resolving bitmap-dependent resources.
  • Build the world once and retain its camera, layers, groups, pools, and gates.
  • Keep gameplay rules in a renderer-independent object with capped storage and events.
  • Bind map-authored objects through the builder; create separate pools for runtime-only entities.
  • Bank run currency transactionally at restart, quit, death, and disposal.
  • Reuse scratch arrays and preserve slot identity where collisions require it.
  • Keep telemetry and debug snapshots observational.

Check Before Copying

  • Hs2dWorldBuilder chooses terrain from its auto policy; do not label it ring, static, or cached without inspecting current stats and options.
  • The sample contains several feature flags for collision, particles, HUD, and phase timing. Choose one coherent production configuration.
  • Native batch compaction is used only where stable external slot indices are unnecessary.
  • The current public control-scene constructors take object options even where an older sample call site still uses positional arguments.
  • The sample's single-player routing is not a multiplayer architecture.
Talk to us