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
| File | Question it answers |
|---|---|
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterGame.ts | How does the game enter its first scene? |
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterMenuScene.ts | How 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.ts | How 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.ts | Which rules can remain independent of rendering? |
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterPauseScene.ts | How does a pausing overlay freeze the level and background audio? |
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterEconomy.ts | How 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.ts | Where do persistent upgrades, run power-ups, and drop weights live? |
../hosanna-ui-game-samples-public/src/hosanna-game-examples/native-shoot-em-up/VerticalShooterWaveDirector.ts | How are scheduled waves bounded and advanced? |
../hosanna-ui-game-samples-public/asset-bundles/native-shoot-em-up/asset-bundle.json | Which bundle keys must be ready? |
../hosanna-ui-game-samples-public/asset-bundles/native-shoot-em-up/levels/level-1.json | Which world and entity data comes from Tiled? |
Architecture At A Glance
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
Hs2dWorldBuilderchooses terrain from itsautopolicy; 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.