mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-03 20:36:31 +08:00
game widget (#533)
This commit is contained in:
@ -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);
|
||||
|
||||
Reference in New Issue
Block a user