Skip to content

z7workbench/minigames

Repository files navigation

Android build Linux build Web build Windows build macOS & iOS build

Mini games collection written in Dart & Flutter!

Games

Hit & Blow

Hit & Blow is inspired by Nintendo Switch's Clubhouse Games: 51 Worldwide Classics' Hit & Blow.

Hit & Blow

Description

This is a game of guessing the hidden n numbers and positions, with the default n being 4. Select n-2 numbers from 1 to n and place them in the positions, then press "Check" to check for correctness. Each position will be judged as "all correct" (indicated by colored check marks) or "half correct" (indicated by grey check marks), the number of former is the number of correct positions and numbers, the number of latter is the number of correct numbers. If it fails, you can try again until you get it right!

Leaderboard

Currently Hit & Blow has a leaderboard powered by Hive Flutter. It contains time when finished, playtime and count you tried, sorted by count you tried.

Hit & Blow leaderboard

Further Objects

  • Minor UI changes
  • Bug fixes

Guess Arrangement (猜排列)

A card guessing game inspired by deduction-style board games.

Description

Two players each draw 8 cards from a standard 52-card deck and arrange them face-down from low to high (A=1, K=13). Players take turns guessing their opponent's cards by position and rank.

Gameplay:

  • Guess a card: "Position 3 is a 7" (only guess the rank, not the suit)
  • Correct guess: The card is revealed, you continue guessing and build your combo
  • Wrong guess: Turn passes to opponent, your combo resets
  • Win condition: First player to reveal all opponent's cards wins

Game Modes:

  • 2 Players: Local multiplayer with turn switching and card hiding
  • Easy AI: Random guessing strategy
  • Medium AI: Rule-based deduction with position awareness
  • Hard AI: Heuristic search with probability analysis

Features

  • Animated card flip effects
  • Combo tracking system
  • Round summary for AI turns
  • Persistent game records

Yacht Dice

Simple Dice Game inspired by Nintendo Switch's Clubhouse Games: 51 Worldwide Classics' Yacht Dices.

Simple Dice Game

Description

It's a game of throwing dices at each other to make permutations and compete for points. If you make a good combination, double tap the corresponding score to confirm the score. The selected permutations cannot be selected again. You can tap on the dice once, save only the good ones and roll them again. The remaining dice can also be changed after a re-roll. Each sheet's cell must be filled in, even if there are no permutations. The one with the highest score wins!

Further Objects

  • Leaderboard
  • Versus AI
  • More players

2048

Classic tile-sliding puzzle game.

Description

Slide tiles in four directions to merge tiles with the same number. When two tiles with the same number collide, they merge into one tile with double the value. Try to reach the 2048 tile!

Gameplay:

  • Swipe up, down, left, or right to move all tiles
  • Tiles with the same number merge when they collide
  • Each move spawns a new tile (90% chance of 2, 10% chance of 4)
  • Game ends when no more moves are possible

Scoring System:

  • Base points = merged tile value (e.g., merging two 4s gives 8 points)
  • Multiple merges in one swipe: ×1.5 bonus
  • Consecutive merge swipes: ×2 bonus

Features:

  • Animated tile sliding and spawning effects
  • Up to 5 save slots
  • Best score tracking
  • Game timer
  • Light/Dark theme support

Mancala

Ancient seed-sowing strategy game.

Description

Capture more seeds than your opponent in this classic board game! Each player has 6 pits and a store. Pick up all seeds from one of your pits and sow them counter-clockwise around the board.

Gameplay:

  • Pick up all seeds from one of your pits on your side
  • Sow them one by one counter-clockwise, skipping opponent's store
  • Land in your own store: Extra turn!
  • Land in your empty pit with seeds in opposite pit: Capture all those seeds!
  • Game ends when one side is empty - remaining seeds go to their owner's store
  • Player with more seeds wins

Game Modes:

  • 2 Players: Local multiplayer
  • Easy AI: Random pit selection
  • Medium AI: Basic heuristics
  • Hard AI: Minimax with alpha-beta pruning

Features:

  • Animated seed sowing
  • Turn indicator
  • Score tracking
  • Game timer

Dice Battle 🚧 (WIP)

Dice battle game - coming soon!

Used Libraries & Materials

Technology Stack

Layer Technology
UI/Game Engine Flame 1.36+
State Management Riverpod
Database Drift (SQLite)
Localization flutter_intl
Framework Flutter 3.27+
Language Dart 3.6+

Platform Support

Platform Status
Android ✅ Supported
iOS ✅ Supported
Web ✅ Supported
Windows ✅ Supported
Linux ✅ Supported
macOS ✅ Supported

All games run offline with no network dependencies.

Theme System

This app supports 2 color schemes × 2 brightness modes = 4 theme combinations:

Color Scheme Light Mode Dark Mode
Wooden Warm wood tones (khaki, brown) Dark walnut (deep brown, ebony)
Starlight Soft purple, sky blue Deep purple, navy blue

Theme-Aware Color Usage

When developing components, always use theme-aware colors from context.theme* extension:

import 'package:flutter/material.dart';
import '../../ui/theme/theme_colors.dart';

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Container(
      // ✅ Correct: Auto-adapts to Wooden/Starlight + Dark/Light
      color: context.themeBackground,
      child: Text(
        'Hello',
        style: TextStyle(color: context.themeTextPrimary),
      ),
    );
  }
}

Available Theme Colors

Extension Usage
context.themePrimary Primary color (AppBar, main buttons)
context.themeBackground Background color (Scaffold)
context.themeSurface Surface color (cards, containers)
context.themeCard Card background
context.themeAccent Accent color (icons, highlights)
context.themeTextPrimary Primary text
context.themeTextSecondary Secondary text
context.themeBorder Border color
context.themeOnPrimary Text/icons on primary color (AppBar icons)

❌ Never Hardcode Colors

// ❌ WRONG: This breaks Starlight theme
Icon(Icons.settings, color: WoodenColors.accentAmber),

// ✅ CORRECT: Works for all themes
Icon(Icons.settings, color: context.themeOnPrimary),

Component Development Checklist

  • Use context.theme* extensions, not WoodenColors.* directly
  • Import theme_colors.dart
  • Test in Dark + Wooden theme
  • Test in Dark + Starlight theme
  • Test in Light + Wooden theme
  • Test in Light + Starlight theme
  • AppBar icons/text use themeOnPrimary

Pre-adapted Shared Components

  • WoodenButton - Button with theme support (primary, secondary, accent, ghost variants)
  • WoodenAppBar - Application bar
  • GameCard - Game card widget
  • ThemeToggle - Theme toggle switch

About

🎮Minigames written in Flutter/Dart

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors