mirror of
				https://github.com/flame-engine/flame.git
				synced 2025-11-01 01:18:38 +08:00 
			
		
		
		
	PR suggestion
This commit is contained in:
		| @ -10,7 +10,7 @@ import 'package:flame/palette.dart'; | ||||
| import 'package:flutter/material.dart'; | ||||
|  | ||||
| void main() { | ||||
|   final game = MyGame()..runOnCreation = false; | ||||
|   final game = MyGame(); | ||||
|  | ||||
|   runApp(game.widget); | ||||
| } | ||||
| @ -54,7 +54,7 @@ class Square extends PositionComponent with HasGameRef<MyGame> { | ||||
|  | ||||
| class MyGame extends BaseGame with TapDetector { | ||||
|   final double squareSize = 128; | ||||
|   bool running = false; | ||||
|   bool running = true; | ||||
|  | ||||
|   MyGame() { | ||||
|     add(Square()); | ||||
|  | ||||
| @ -397,8 +397,9 @@ class GameRenderBox extends RenderBox with WidgetsBindingObserver { | ||||
|  | ||||
|   void _unscheduleTick() { | ||||
|     _running = false; | ||||
|     if (_frameCallbackId != null) | ||||
|     if (_frameCallbackId != null) { | ||||
|       SchedulerBinding.instance.cancelFrameCallbackWithId(_frameCallbackId); | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   void _tick(Duration timestamp) { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Erick Zanardo
					Erick Zanardo