?1.想起小的时候,还发钱去玩这个游戏,你说是不是很傻很傻。
2.现在这个游戏没有几个人爱玩的。
3.实现的方式 flutter +dart 运行在网页上。看了代码应该是可以安装到手机上的。
还是绿色的好看
?
主函数:
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:tetris/gamer/gamer.dart';
import 'package:tetris/generated/l10n.dart';
import 'package:tetris/material/audios.dart';
import 'package:tetris/panel/page_portrait.dart';
import 'gamer/keyboard.dart';
void main() {
debugDefaultTargetPlatformOverride = TargetPlatform.fuchsia;
_disableDebugPrint();
runApp(MyApp());
}
void _disableDebugPrint() {
bool debug = false;
assert(() {
debug = true;
return true;
}());
if (!debug) {
debugPrint = (message, {wrapWidth}) {
//disable log print when not in debug mode
};
}
}
final RouteObserver<ModalRoute> routeObserver = RouteObserver<ModalRoute>();
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'tetris',
localizationsDelegates: [
S.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
navigatorObservers: [routeObserver],
supportedLocales: S.delegate.supportedLocales,
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: Scaffold(
body: Sound(child: Game(child: KeyboardController(child: _HomePage()))),
),
);
}
}
const SCREEN_BORDER_WIDTH = 3.0;
const BACKGROUND_COLOR = const Color(0xff0af15e);
class _HomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
//only Android/iOS support land mode
bool land = MediaQuery.of(context).orientation == Orientation.landscape;
return land ? PageLand() : PagePortrait();
}
}
|