mine sweeper pt2
This commit is contained in:
@@ -36,6 +36,7 @@ class MineTile extends StatelessWidget {
|
|||||||
child: Text(
|
child: Text(
|
||||||
'${square.bombsAround}',
|
'${square.bombsAround}',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
fontSize: 25,
|
||||||
fontWeight: FontWeight.bold,
|
fontWeight: FontWeight.bold,
|
||||||
color: _getTileColor(square.bombsAround, context),
|
color: _getTileColor(square.bombsAround, context),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -35,7 +35,23 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
|||||||
int squaresLeft = -1;
|
int squaresLeft = -1;
|
||||||
bool _isFirstLoad = true;
|
bool _isFirstLoad = true;
|
||||||
|
|
||||||
|
String getModeConfig() {
|
||||||
|
switch (modeController.text) {
|
||||||
|
case ("Easy"):
|
||||||
|
return "Columns: 10\nRows: 10\nBomds: 15";
|
||||||
|
case ("Normal"):
|
||||||
|
return "Columns: 10\nRows: 15\nBomds: 23";
|
||||||
|
case ("Hard"):
|
||||||
|
return "Columns: 10\nRows: 20\nBomds: 30";
|
||||||
|
default:
|
||||||
|
return "Error";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void showStartGameWindow(MihMineSweeperProvider mihMineSweeperProvider) {
|
void showStartGameWindow(MihMineSweeperProvider mihMineSweeperProvider) {
|
||||||
|
// easy - 10 * 10 & 15 bombs
|
||||||
|
// Normal - 10 * 15 & 23 bombs
|
||||||
|
// Hard - 10 * 20 & 30 bombs
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
@@ -58,6 +74,17 @@ class _MineSweeperGameState extends State<MineSweeperGame> {
|
|||||||
editable: true,
|
editable: true,
|
||||||
enableSearch: false,
|
enableSearch: false,
|
||||||
),
|
),
|
||||||
|
const SizedBox(height: 10),
|
||||||
|
Text(
|
||||||
|
getModeConfig(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: MihColors.getSecondaryColor(
|
||||||
|
MzansiInnovationHub.of(context)!.theme.mode ==
|
||||||
|
"Dark"),
|
||||||
|
fontSize: 20,
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
const SizedBox(height: 25),
|
const SizedBox(height: 25),
|
||||||
Center(
|
Center(
|
||||||
child: MihButton(
|
child: MihButton(
|
||||||
|
|||||||
Reference in New Issue
Block a user