presentation/game/roy_game
library
Classes
-
BouncingOrb
-
Bounces around the viewport and reverses off its edges — the
collision-detection counterpart (IDEA-65) to SparkleParticle's
pooling demo: on touching TappableCircle, both components flash
NeonTheme.gold, proving Flame's
CollisionCallbacks/hitbox wiring
actually fires through a real GameWidget, not just a unit test
constructing CircleHitbox in isolation.
-
CircleTappedEvent
-
Fires whenever TappableCircle is tapped — the one demo GameEvent
this starter template ships, so
GameDemoScreen has something concrete
to subscribe to (FEAT-88). A real game defines its own event types
(EntityDefeated, LevelCompleted, ...) the same way, outside this
package.
-
PlayableCharacter
-
A playable character moving in 8 directions with attack action.
-
PlayerAttackedEvent
-
-
RoyGame
-
Minimal Flame starter template (FEAT-14): proves
FlameGame/Component/
GameWidget actually wire up end-to-end in this package — the flame
dependency existed but nothing used the game-loop engine before this.
Deliberately not a real game: one background color + one tappable
TappableCircle. A consumer app building a real game should extend this
rather than reading it as a template to copy-paste from scratch.
-
SparkleParticle
-
One decaying particle in a tap-triggered burst (ENH-81) — shrinks and
fades over
_lifetimeSeconds, then removes itself; PooledComponent
then returns it to RoyGame.sparklePool automatically. reset (not the
constructor) sets per-spawn state, since a pooled instance is reused
across many bursts instead of being constructed fresh each time.
-
TappableCircle
-
A circle that flips between two
NeonTheme accents on tap — the single
piece of interactive state this starter template proves works through a
real GameWidget (see neon_dialog.dart's overlay pattern doc comment,
which this template's demo screen also exercises).