BonfireGame constructor
BonfireGame({
- required BuildContext context,
- required MapGame map,
- JoystickController? joystickController,
- Player? player,
- GameInterface? interface,
- List<
Enemy> ? enemies, - List<
GameDecoration> ? decorations, - List<
GameComponent> ? components, - GameBackground? background,
- bool constructionMode = false,
- bool showCollisionArea = false,
- GameController? gameController,
- Color? constructionModeColor,
- Color? collisionAreaColor,
- Color? lightingColorGame,
- bool showFPS = false,
- ValueChanged<
BonfireGame> ? onReady, - TapInGame? onTapDown,
- TapInGame? onTapUp,
- GameColorFilter? colorFilter,
- CameraConfig? cameraConfig,
Implementation
BonfireGame({
required this.context,
required this.map,
JoystickController? joystickController,
this.player,
this.interface,
List<Enemy>? enemies,
List<GameDecoration>? decorations,
List<GameComponent>? components,
this.background,
this.constructionMode = false,
this.showCollisionArea = false,
this.gameController,
this.constructionModeColor,
this.collisionAreaColor,
this.lightingColorGame,
this.showFPS = false,
this.onReady,
this.onTapDown,
this.onTapUp,
GameColorFilter? colorFilter,
CameraConfig? cameraConfig,
}) : _joystickController = joystickController,
super(camera: BonfireCamera(cameraConfig ?? CameraConfig())) {
_initialEnemies = enemies;
_initialDecorations = decorations;
_initialComponents = components;
_colorFilter = colorFilter ?? GameColorFilter();
debugMode = constructionMode;
camera.setGame(this);
camera.target ??= player;
_interval = IntervalTick(
INTERVAL_UPDATE_CACHE,
tick: _updateTempList,
);
_intervalUpdateOder = IntervalTick(
INTERVAL_UPDATE_ORDER,
tick: updateOrderPriority,
);
_intervalAllCollisions = IntervalTick(
INTERVAL_UPDATE_COLLISIONS,
tick: () => scheduleMicrotask(_updateAllCollisions),
);
}