bonfire 0.1.1 copy "bonfire: ^0.1.1" to clipboard
bonfire: ^0.1.1 copied to clipboard

outdated

(RPG maker) Create RPG-style or similar games more simply with Flame.

example/lib/main.dart

import 'package:bonfire/bonfire.dart';
import 'package:example/map/dungeon_map.dart';
import 'package:example/player/knight.dart';
import 'package:example/player/knight_interface.dart';
import 'package:flutter/material.dart';

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await Flame.util.setLandscape();
  await Flame.util.fullScreen();
  runApp(
    MaterialApp(
      home: Game(),
    ),
  );
}

class Game extends StatelessWidget {
  static const sizeTile = 32.0;
  @override
  Widget build(BuildContext context) {
    return BonfireWidget(
      joystick: Joystick(
        pathSpriteBackgroundDirectional: 'joystick_background.png',
        pathSpriteKnobDirectional: 'joystick_knob.png',
        sizeDirectional: 100,
        marginLeftDirectional: 150,
        actions: [
          JoystickAction(
            actionId: 0,
            pathSprite: 'joystick_atack.png',
            size: 80,
            margin: EdgeInsets.only(bottom: 50, right: 50),
          ),
          JoystickAction(
            actionId: 1,
            pathSprite: 'joystick_atack_range.png',
            size: 50,
            margin: EdgeInsets.only(bottom: 50, right: 160),
          )
        ],
      ),
      player: Knight(
        initPosition: Position(5 * sizeTile, 6 * sizeTile),
      ),
      interface: KnightInterface(),
      map: DungeonMap.map(),
      decorations: DungeonMap.decorations(),
      enemies: DungeonMap.enemies(),
      background: BackgroundColorGame(Colors.blueGrey[900]),
      listener: (context, game) {
        // TODO ANYTHING
      },
    );
  }
}
468
likes
0
pub points
88%
popularity

Publisher

verified publisherrafaelbarbosatec.com

(RPG maker) Create RPG-style or similar games more simply with Flame.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flame, flutter, ordered_set

More

Packages that depend on bonfire