Skip to content

Kotlin Multiplatform dice game for Desktop and Android.

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.txt
Notifications You must be signed in to change notification settings

pandulapeter/zilch-dice

Zilch Dice

Android, Linux, MacOS and Windows client apps for my interpretation of the popular game Dice 10000.

It features a scalable UI that works across multiple screen sizes in dark and light themes and multiple language support.

Table of Contents

How to build

Clone the project and open it in the latest stable version of Android Studio.

The IDE should recognize the entry points for the Android and Desktop apps, generating the proper Run configurations.

The Android app features debug and release build types (the latter being optimized and obfuscated, without a debug menu):

Tech stack

The project uses Kotlin Multiplatform to share a significant amount of code between JVM and Android. Most of the modules are pure Kotlin so they can be reused on multiple platforms. Some parts of the data layer (such as database management) are written separately for Desktop and Android.

The UI is achieved using Compose Multiplatform but again, not all of the UI code is shared so that minor parts of the interface can be optimized for the different platforms.

Some important third party libraries that are being used:

  • Kotlin Coroutines for asynchronous / reactive features
  • Koin for dependency injection (service locator)
  • Arbor for logging
  • Room for local storage on Android
  • Realm for local storage on Desktop

Project architecture

The main goal of the architecture is creating loosely coupled modules that encapsulate as many implementation details as possible, while only exposing a straightforward and small API surface. Using SOLID principles when designing the modularization results in reduced build times due to Gradle's incremental builds, as well as a codebase that's easy to navigate.

App module

The app multiplatform module contains the entry points for the application on the different platforms. It handles opening the first screen and dependency injection.

Features

Each feature folder can have its own data, domain and presentation subdirectory. These can have modules for different platforms (android, desktop or common) or for api and implementation. The app has the following features:

  • feature-game - Responsible for the actual gameplay screen.
  • feature-menu - The main menu screen.
  • feature-settings - The settings screen.

Other

  • The gradle folder contains build scripts and related data.
  • The metadata folder contains images needed for this documentation.
  • The shared folder contains app-specific features used by multiple flows.
  • The utilities folder contains helper functions that are not specific to the application.

About

Kotlin Multiplatform dice game for Desktop and Android.

Resources

License

Apache-2.0, Apache-2.0 licenses found

Licenses found

Apache-2.0
LICENSE
Apache-2.0
LICENSE.txt

Stars

Watchers

Forks

Releases

No releases published

Languages