Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 652 Bytes

TREX.md

File metadata and controls

35 lines (25 loc) · 652 Bytes

Flame cơ bản

1. File structure

    assets/audio
    assets/fonts
    assets/images

2. Game Widget

  • Game widget là 1 Flutter widget được dùng để insert Game vào widget tree.

  • Có 2 cách để insert game vào widget tree

void main() {
  final game = MyGame();
  runApp(GameWidget(game: game));
}

Hoặc

void main() {
  runApp(GameWidget.controlled(gameFactory: MyGame.new));
}

3. Game loop