game widget (#533)

This commit is contained in:
Renan
2020-12-06 20:32:30 +00:00
committed by renancaraujo
parent 4939b708dd
commit 2f2ab1341e
46 changed files with 711 additions and 391 deletions

View File

@ -1,11 +1,14 @@
import 'package:flutter/material.dart';
import 'package:flame/game.dart';
import 'package:flutter/material.dart';
import 'package:flame/gestures.dart';
import 'package:flame/palette.dart';
void main() {
final game = MyGame();
runApp(game.widget);
runApp(
GameWidget(
game: MyGame(),
),
);
}
/// Includes an example including basic detectors
@ -16,6 +19,9 @@ class MyGame extends Game
final _greenPaint = Paint()..color = const Color(0xFF00FF00);
final _redPaint = Paint()..color = const Color(0xFFFF0000);
@override
Color backgroundColor() => const Color(0xFFF1F1F1);
Paint _paint;
Rect _rect = const Rect.fromLTWH(50, 50, 50, 50);