Skip to main content

flame_gallery_core 0.1.0 copy "flame_gallery_core: ^0.1.0" to clipboard
flame_gallery_core: ^0.1.0 copied to clipboard

Core contracts, host page, themed overlays and HUD widgets shared by Flame Gallery mini games. Build your own drop-in Flame game on top of it.

example/example.md

flame_gallery_core example #

Build your own gallery game: extend GalleryFlameGame for gameplay and GalleryGame for the public, brandable description.

import 'package:flame_gallery_core/flame_gallery_core.dart';
import 'package:flutter/material.dart';

final class TapGame extends GalleryFlameGame {
  TapGame() : super(gameId: TapCounter.id);

  @override
  void onRoundStart() {}

  void tap() => addScore(1);
}

final class TapCounter extends GalleryGame<TapGame> {
  const TapCounter()
    : super(
        strings: const GameStrings.en(
          title: 'Tap Counter',
          instructions: 'Tap as fast as you can.',
        ),
      );

  static const id = 'tap_counter';

  @override
  String get gameId => id;

  @override
  TapGame createGame(ColorScheme colors) => TapGame();

  @override
  Widget buildHud(BuildContext context, TapGame game) =>
      HudScoreChip(score: game.score);
}

Open it with GameHostPage(game: const TapCounter()) or FlameGallery.show from the flame_gallery package.

0
likes
160
points
0
downloads

Documentation

API reference

Publisher

verified publishervbxtech.app

Weekly Downloads

Core contracts, host page, themed overlays and HUD widgets shared by Flame Gallery mini games. Build your own drop-in Flame game on top of it.

Repository (GitHub)
View/report issues

Topics

#flame #game #gamification #minigame #widget

License

MIT (license)

Dependencies

flame, flutter

More

Packages that depend on flame_gallery_core