Code Monkey home page Code Monkey logo

tsinis / slide_puzzle Goto Github PK

View Code? Open in Web Editor NEW
10.0 1.0 4.0 6.25 MB

Google-awarded Map Slide Puzzle (Flutter Puzzle Hack challenge) πŸŽ–οΈ

Home Page: https://devpost.com/software/map-slide-puzzle

License: MIT License

Ruby 0.56% Swift 0.36% Objective-C 0.01% Dart 89.73% HTML 0.90% Kotlin 0.03% CMake 3.32% C++ 4.63% C 0.30% JavaScript 0.04% CSS 0.13%
flutter dart flutter-puzzle flutterpuzzlehack flutter-puzzle-hack flutter-animations windows linux macos ios

slide_puzzle's Introduction

Map Slide Puzzle

Preview

License: MIT Releases Codemagic build status Deploy Tests codecov Chrome macOS Windows Linux iOS Android

Table of content

Description

This project is one of the winning submissions in the Official Google's Flutter Challenge, called "Flutter Puzzle Hack" (with hundreds valid entries from around the world and more than 5,5k participants). You can read more about this contest here: flutter.dev/events/puzzle-hack.

This is a heavily modified version of the sample project provided as a starting point of this challenge (Built by Very Good Ventures in partnership with Google.). Modified by Roman Cinis.

Your goal is to assemble the map of the island with a treasure, which will be displayed after the 15 tiles are correctly placed. Each tile contains its unique, handcrafted location and animation. The whole design is created in vector graphics, so there are no raster images in the game at all. You can zoom in on the tiles (mouse wheel on desktop and macOS and pinch gesture on mobile). The game works on all platforms that Flutter offers.

Flutter and the related logo are trademarks of Google LLC. We are not endorsed by or affiliated with Google LLC.

Getting Started

To run the project either use the launch configuration in VSCode/Android Studio or use the following command:

flutter pub get
flutter gen-l10n
flutter run

Platform Specific Setup

You should run the the app without any additional steps on all platforms without any problems, however, for audio player in Linux builds you will need to install libwebkit2gtk-4.0-dev package first (via sudo apt-get install):

sudo apt-get update -y
sudo apt-get --assume-yes install libwebkit2gtk-4.0-dev

Tests

The code is almost 100% covered by the unit/widget tests. To run all unit and widget tests use the following command:

flutter test --coverage --test-randomize-ordering-seed random

To view the generated coverage report you can use lcov.

# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/

# Open Coverage Report
$ open coverage/index.html

Accessibility

The app was originally designed to be accessible by WCAG 2.1 AA standards at minimum, and AAA in particular. All texts have a contrast ratio at least of 4.5, images 3.0, touch target sizes of at least 48dp. The game was also built to be controllable via keyboard/input device/remote control/gamepad.

Licenses

This project is released under the terms of the MIT license. All assets (as sounds, fonts) licensed and are free for personal use. You can find LICENSE files in their folders. You can also press on floating compass logo to show "About" dialog and check all licenses for packages used in this game.

Working with Translations

This project relies on flutter_localizations and follows the official internationalization guide for Flutter.

Adding Strings

  1. To add a new localizable string, open the app_en.arb file at lib/l10n/arb/app_en.arb.
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}
  1. Then add a new key/value and description
{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    },
    "helloWorld": "Hello World",
    "@helloWorld": {
        "description": "Hello World Text"
    }
}
  1. Use the new string
import 'package:map_slide_puzzle/l10n/l10n.dart';

@override
Widget build(BuildContext context) {
  final l10n = context.l10n;
  return Text(l10n.helloWorld);
}

Adding Supported Locales

Update the CFBundleLocalizations array in the Info.plist at ios/Runner/Info.plist to include the new locale.

    ...

    <key>CFBundleLocalizations</key>
	<array>
		<string>en</string>
		<string>es</string>
	</array>

    ...

Adding Translations

  1. For each supported locale, add a new ARB file in lib/l10n/arb.
β”œβ”€β”€ l10n
β”‚   β”œβ”€β”€ arb
β”‚   β”‚   β”œβ”€β”€ app_en.arb
β”‚   β”‚   └── app_es.arb
  1. Add the translated strings to each .arb file:

app_en.arb

{
    "@@locale": "en",
    "counterAppBarTitle": "Counter",
    "@counterAppBarTitle": {
        "description": "Text shown in the AppBar of the Counter Page"
    }
}

app_es.arb

{
    "@@locale": "es",
    "counterAppBarTitle": "Contador",
    "@counterAppBarTitle": {
        "description": "Texto mostrado en la AppBar de la pΓ‘gina del contador"
    }
}

slide_puzzle's People

Contributors

tsinis avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.