diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..165a26e --- /dev/null +++ b/.gitignore @@ -0,0 +1,13 @@ + +*draft* +__pycache__ +.coverage +coverage.xml +.buildozer +venv +audacity +build +*_test.* +settings_agathe.json +dist +bin \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..8ffa429 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2023 Paul Creusy + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/NOTICE b/NOTICE new file mode 100644 index 0000000..e051f3f --- /dev/null +++ b/NOTICE @@ -0,0 +1,6 @@ +Notice of Lumacryte + +This software has been developed during the Open Source AI Game Jam on the 7th of July 2023 by: +- Agathe +- Paul + diff --git a/PRIVACY b/PRIVACY new file mode 100644 index 0000000..2fb7844 --- /dev/null +++ b/PRIVACY @@ -0,0 +1,2 @@ +Lumacryte does not collect any data during its execution as the application is not linked to internet. We therefore guaranty you that we will not collect any of your data or use them for any purpose. +We decline all responsabilities for any other kind of data collection as the ones coming from the use of Google Play for example. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..e451561 --- /dev/null +++ b/README.md @@ -0,0 +1,124 @@ +# Lumacryte + +*Version 1.0.0* + +## Table of contents + +- [Lumacryte](#lumacryte) + - [Table of contents](#table-of-contents) + - [Introduction](#introduction) + - [Installation](#installation) + - [For users](#for-users) + - [For developers](#for-developers) + - [Cloning the repository](#cloning-the-repository) + - [Creation of a virtual environment](#creation-of-a-virtual-environment) + - [Installation of the necessary librairies](#installation-of-the-necessary-librairies) + - [Utilisation](#utilisation) + - [Development](#development) + - [Architecture of the project](#architecture-of-the-project) + - [Build for Windows](#build-for-windows) + - [Build for Android](#build-for-android) + - [Credits](#credits) + - [License](#license) + +## Introduction + +This software is a game developed during the [Open Source AI Game Jam](https://itch.io/jam/open-source-ai-game-jam) from Hugging Face between the 7th and the 9th of July 2023. + +## Installation + +### For users + +Just download our zip folder, unzip it and start the .exe file. + +### For developers + +#### Cloning the repository + +To clone the github repository, you have to search the clone button on the main page of the project. Then click on it and select `https` or `ssh` depending on your favorite mode of connexion. Copy the given id and then open a terminal on your computer, go to the folder where you want to install the project and use the following command: + +```bash +git clone +``` + +#### Creation of a virtual environment + +You might want to use a virtual environment to execute the code. To do so, use the following command: + +```bash +python -m virtualenv venv +``` + +To start it, use the command on *Windows*: + +```bash +venv/Scripts/Activate.ps1 +``` + +Or for *MacOS* and *Linux*: + +```bash +venv/Scripts/activate +``` + +#### Installation of the necessary librairies + +To execute this software, you need several *Python* librairies, specified in the `requirements.txt` file. To install them, use the following command: + +```bash +pip install -r requirements.txt +``` + +## Utilisation + +Start and play :wink:. + +## Development + +### Architecture of the project + +The project is divided into several folders: + +- `data` +- `resources` +- `tools`, divided into several modules: + - `tools_` + - `tools_` + +It also contains the following files: + +- `.gitignore` +- `main.py` +- `requirements.txt`, list of packages required to run the app. +- `pyproject.toml`, configuration file for *Pylint* and *Pytest*. + +### Build for Windows + +`pyinstaller lumacryte_onefile.spec` + +### Build for Android + +To create a debug unsigned apk, use the following command : `buildozer android debug` + +To launch it on a device connected with a USB cable, use the following command : `buildozer -v android deploy run logcat | grep python` + +To create a release version of the application : `buildozer android release` + +```bash +keytool -genkey -v -keystore ~/keystores/Lumacryte.keystore -alias Lumacryte -keyalg RSA -keysize 2048 -validity 10000 +keytool -importkeystore -srckeystore ~/keystores/Lumacryte.keystore -destkeystore ~/keystores/Lumacryte.keystore -deststoretype pkcs12 + +export P4A_RELEASE_KEYSTORE=~/keystores/Lumacryte.keystore +export P4A_RELEASE_KEYSTORE_PASSWD= +export P4A_RELEASE_KEYALIAS_PASSWD= +export P4A_RELEASE_KEYALIAS="Lumacryte" +``` + +## Credits + +This software has been developed by Paul and Agathe. + +## License + +This program is licensed under the `Apache License version 2.0`. + diff --git a/buildozer.spec b/buildozer.spec new file mode 100644 index 0000000..0cd33b6 --- /dev/null +++ b/buildozer.spec @@ -0,0 +1,427 @@ +[app] + +# (str) Title of your application +title = Lumacryte + +# (str) Package name +package.name = lumacryte + +# (str) Package domain (needed for android/ios packaging) +package.domain = org + +# (str) Source code where the main.py live +source.dir = . + +# (list) Source files to include (let empty to include all the files) +source.include_exts = py,png,jpg,kv,atlas,json,txt,ttf,wav,ico,ogg,otf,mp3 + +# (list) List of inclusions using pattern matching +#source.include_patterns = assets/*,images/*.png + +# (list) Source files to exclude (let empty to not exclude anything) +#source.exclude_exts = spec + +# (list) List of directory to exclude (let empty to not exclude anything) +source.exclude_dirs = test, bin, .buildozer, data/collection, venv, PlayStore, reports, .vscode, resources/images/ghost_textures, resources/images/map_textures + +# (list) List of exclusions using pattern matching +# Do not prefix with './' +source.exclude_patterns = *.gitignore, requirements.txt, tools_dev.py + +# (str) Application versioning (method 1) +version = 1.1.0 + +# (str) Application versioning (method 2) +# version.regex = __version__ = ['"](.*)['"] +# version.filename = %(source.dir)s/main.py + +# (list) Application requirements +# comma separated e.g. requirements = sqlite3,kivy +requirements = python3,kivy + +# (str) Custom source folders for requirements +# Sets custom source for any requirements with recipes +# requirements.source.kivy = ../../kivy + +# (str) Presplash of the application +presplash.filename = ./resources/images/splashscreen.png + +# (str) Icon of the application +icon.filename = ./resources/images/logo.png + +# (str) Supported orientation (one of landscape, sensorLandscape, portrait or all) +orientation = landscape + +# (list) List of service to declare +#services = NAME:ENTRYPOINT_TO_PY,NAME2:ENTRYPOINT2_TO_PY + +# +# OSX Specific +# + +# +# author = © Copyright Info + +# change the major version of python used by the app +osx.python_version = 3 + +# Kivy version to use +osx.kivy_version = 1.9.1 + +# +# Android specific +# + +# (bool) Indicate if the application should be fullscreen or not +fullscreen = 1 + +# (string) Presplash background color (for android toolchain) +# Supported formats are: #RRGGBB #AARRGGBB or one of the following names: +# red, blue, green, black, white, gray, cyan, magenta, yellow, lightgray, +# darkgray, grey, lightgrey, darkgrey, aqua, fuchsia, lime, maroon, navy, +# olive, purple, silver, teal. +android.presplash_color = #46413e + +# (string) Presplash animation using Lottie format. +# see https://lottiefiles.com/ for examples and https://airbnb.design/lottie/ +# for general documentation. +# Lottie files can be created using various tools, like Adobe After Effect or Synfig. +#android.presplash_lottie = "path/to/lottie/file.json" + +# (str) Adaptive icon of the application (used if Android API level is 26+ at runtime) +#icon.adaptive_foreground.filename = %(source.dir)s/data/icon_fg.png +#icon.adaptive_background.filename = %(source.dir)s/data/icon_bg.png + +# (list) Permissions +# android.permissions = READ_EXTERNAL_STORAGE, WRITE_EXTERNAL_STORAGE + +# (list) features (adds uses-feature -tags to manifest) +#android.features = android.hardware.usb.host + +# (int) Target Android API, should be as high as possible. +android.api = 34 + +# (int) Minimum API your APK / AAB will support. +android.minapi = 21 + +# (int) Android SDK version to use +android.sdk = 34 + +# (str) Android NDK version to use +#android.ndk = 19b + +# (int) Android NDK API to use. This is the minimum API your app will support, it should usually match android.minapi. +#android.ndk_api = 21 + +# (bool) Use --private data storage (True) or --dir public storage (False) +#android.private_storage = True + +# (str) Android NDK directory (if empty, it will be automatically downloaded.) +android.ndk_path = ~/.buildozer/android/platform/android-ndk-r25 + +# (str) Android SDK directory (if empty, it will be automatically downloaded.) +#android.sdk_path = + +# (str) ANT directory (if empty, it will be automatically downloaded.) +#android.ant_path = + +# (bool) If True, then skip trying to update the Android sdk +# This can be useful to avoid excess Internet downloads or save time +# when an update is due and you just want to test/build your package +# android.skip_update = False + +# (bool) If True, then automatically accept SDK license +# agreements. This is intended for automation only. If set to False, +# the default, you will be shown the license when first running +# buildozer. +# android.accept_sdk_license = False + +# (str) Android entry point, default is ok for Kivy-based app +#android.entrypoint = org.kivy.android.PythonActivity + +# (str) Full name including package path of the Java class that implements Android Activity +# use that parameter together with android.entrypoint to set custom Java class instead of PythonActivity +#android.activity_class_name = org.kivy.android.PythonActivity + +# (str) Extra xml to write directly inside the element of AndroidManifest.xml +# use that parameter to provide a filename from where to load your custom XML code +#android.extra_manifest_xml = ./src/android/extra_manifest.xml + +# (str) Extra xml to write directly inside the tag of AndroidManifest.xml +# use that parameter to provide a filename from where to load your custom XML arguments: +#android.extra_manifest_application_arguments = ./src/android/extra_manifest_application_arguments.xml + +# (str) Full name including package path of the Java class that implements Python Service +# use that parameter to set custom Java class instead of PythonService +#android.service_class_name = org.kivy.android.PythonService + +# (str) Android app theme, default is ok for Kivy-based app +# android.apptheme = "@android:style/Theme.NoTitleBar" + +# (list) Pattern to whitelist for the whole project +#android.whitelist = + +# (str) Path to a custom whitelist file +#android.whitelist_src = + +# (str) Path to a custom blacklist file +#android.blacklist_src = + +# (list) List of Java .jar files to add to the libs so that pyjnius can access +# their classes. Don't add jars that you do not need, since extra jars can slow +# down the build process. Allows wildcards matching, for example: +# OUYA-ODK/libs/*.jar +#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar + +# (list) List of Java files to add to the android project (can be java or a +# directory containing the files) +#android.add_src = + +# (list) Android AAR archives to add +#android.add_aars = + +# (list) Put these files or directories in the apk assets directory. +# Either form may be used, and assets need not be in 'source.include_exts'. +# 1) android.add_assets = source_asset_relative_path +# 2) android.add_assets = source_asset_path:destination_asset_relative_path +#android.add_assets = + +# (list) Gradle dependencies to add +#android.gradle_dependencies = + +# (bool) Enable AndroidX support. Enable when 'android.gradle_dependencies' +# contains an 'androidx' package, or any package from Kotlin source. +# android.enable_androidx requires android.api >= 28 +#android.enable_androidx = False + +# (list) add java compile options +# this can for example be necessary when importing certain java libraries using the 'android.gradle_dependencies' option +# see https://developer.android.com/studio/write/java8-support for further information +# android.add_compile_options = "sourceCompatibility = 1.8", "targetCompatibility = 1.8" + +# (list) Gradle repositories to add {can be necessary for some android.gradle_dependencies} +# please enclose in double quotes +# e.g. android.gradle_repositories = "maven { url 'https://kotlin.bintray.com/ktor' }" +#android.add_gradle_repositories = + +# (list) packaging options to add +# see https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.PackagingOptions.html +# can be necessary to solve conflicts in gradle_dependencies +# please enclose in double quotes +# e.g. android.add_packaging_options = "exclude 'META-INF/common.kotlin_module'", "exclude 'META-INF/*.kotlin_module'" +#android.add_packaging_options = + +# (list) Java classes to add as activities to the manifest. +#android.add_activities = com.example.ExampleActivity + +# (str) OUYA Console category. Should be one of GAME or APP +# If you leave this blank, OUYA support will not be enabled +#android.ouya.category = GAME + +# (str) Filename of OUYA Console icon. It must be a 732x412 png image. +#android.ouya.icon.filename = %(source.dir)s/data/ouya_icon.png + +# (str) XML file to include as an intent filters in tag +#android.manifest.intent_filters = + +# (str) launchMode to set for the main activity +#android.manifest.launch_mode = standard + +# (list) Android additional libraries to copy into libs/armeabi +#android.add_libs_armeabi = libs/android/*.so +#android.add_libs_armeabi_v7a = libs/android-v7/*.so +#android.add_libs_arm64_v8a = libs/android-v8/*.so +#android.add_libs_x86 = libs/android-x86/*.so +#android.add_libs_mips = libs/android-mips/*.so + +# (bool) Indicate whether the screen should stay on +# Don't forget to add the WAKE_LOCK permission if you set this to True +#android.wakelock = False + +# (list) Android application meta-data to set (key=value format) +#android.meta_data = + +# (list) Android library project to add (will be added in the +# project.properties automatically.) +#android.library_references = + +# (list) Android shared libraries which will be added to AndroidManifest.xml using tag +#android.uses_library = + +# (str) Android logcat filters to use +#android.logcat_filters = *:S python:D + +# (bool) Android logcat only display log for activity's pid +#android.logcat_pid_only = False + +# (str) Android additional adb arguments +#android.adb_args = -H host.docker.internal + +# (bool) Copy library instead of making a libpymodules.so +#android.copy_libs = 1 + +# (list) The Android archs to build for, choices: armeabi-v7a, arm64-v8a, x86, x86_64 +# In past, was `android.arch` as we weren't supporting builds for multiple archs at the same time. +android.archs = arm64-v8a, armeabi-v7a + +# (int) overrides automatic versionCode computation (used in build.gradle) +# this is not the same as app version and should only be edited if you know what you're doing +# android.numeric_version = 1 + +# (bool) enables Android auto backup feature (Android API >=23) +android.allow_backup = True + +# (str) XML file for custom backup rules (see official auto backup documentation) +# android.backup_rules = + +# (str) If you need to insert variables into your AndroidManifest.xml file, +# you can do so with the manifestPlaceholders property. +# This property takes a map of key-value pairs. (via a string) +# Usage example : android.manifest_placeholders = [myCustomUrl:\"org.kivy.customurl\"] +# android.manifest_placeholders = [:] + +# (bool) disables the compilation of py to pyc/pyo files when packaging +# android.no-compile-pyo = True + +# (str) The format used to package the app for release mode (aab or apk). +android.release_artifact = aab + +# +# Python for android (p4a) specific +# + +# (str) python-for-android URL to use for checkout +#p4a.url = + +# (str) python-for-android fork to use in case if p4a.url is not specified, defaults to upstream (kivy) +#p4a.fork = kivy + +# (str) python-for-android branch to use, defaults to master +p4a.branch = develop + +# (str) python-for-android specific commit to use, defaults to HEAD, must be within p4a.branch +#p4a.commit = HEAD + +# (str) python-for-android git clone directory (if empty, it will be automatically cloned from github) +#p4a.source_dir = + +# (str) The directory in which python-for-android should look for your own build recipes (if any) +#p4a.local_recipes = + +# (str) Filename to the hook for p4a +#p4a.hook = + +# (str) Bootstrap to use for android builds +# p4a.bootstrap = sdl2 + +# (int) port number to specify an explicit --port= p4a argument (eg for bootstrap flask) +#p4a.port = + +# Control passing the --use-setup-py vs --ignore-setup-py to p4a +# "in the future" --use-setup-py is going to be the default behaviour in p4a, right now it is not +# Setting this to false will pass --ignore-setup-py, true will pass --use-setup-py +# NOTE: this is general setuptools integration, having pyproject.toml is enough, no need to generate +# setup.py if you're using Poetry, but you need to add "toml" to source.include_exts. +#p4a.setup_py = false + +# (str) extra command line arguments to pass when invoking pythonforandroid.toolchain +#p4a.extra_args = + + +# +# iOS specific +# + +# (str) Path to a custom kivy-ios folder +#ios.kivy_ios_dir = ../kivy-ios +# Alternately, specify the URL and branch of a git checkout: +ios.kivy_ios_url = https://github.com/kivy/kivy-ios +ios.kivy_ios_branch = master + +# Another platform dependency: ios-deploy +# Uncomment to use a custom checkout +#ios.ios_deploy_dir = ../ios_deploy +# Or specify URL and branch +ios.ios_deploy_url = https://github.com/phonegap/ios-deploy +ios.ios_deploy_branch = 1.10.0 + +# (bool) Whether or not to sign the code +ios.codesign.allowed = false + +# (str) Name of the certificate to use for signing the debug version +# Get a list of available identities: buildozer ios list_identities +#ios.codesign.debug = "iPhone Developer: ()" + +# (str) The development team to use for signing the debug version +#ios.codesign.development_team.debug = + +# (str) Name of the certificate to use for signing the release version +#ios.codesign.release = %(ios.codesign.debug)s + +# (str) The development team to use for signing the release version +#ios.codesign.development_team.release = + +# (str) URL pointing to .ipa file to be installed +# This option should be defined along with `display_image_url` and `full_size_image_url` options. +#ios.manifest.app_url = + +# (str) URL pointing to an icon (57x57px) to be displayed during download +# This option should be defined along with `app_url` and `full_size_image_url` options. +#ios.manifest.display_image_url = + +# (str) URL pointing to a large icon (512x512px) to be used by iTunes +# This option should be defined along with `app_url` and `display_image_url` options. +#ios.manifest.full_size_image_url = + + +[buildozer] + +# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output)) +log_level = 2 + +# (int) Display warning if buildozer is run as root (0 = False, 1 = True) +warn_on_root = 1 + +# (str) Path to build artifact storage, absolute or relative to spec file +# build_dir = ./.buildozer + +# (str) Path to build output (i.e. .apk, .aab, .ipa) storage +# bin_dir = ./bin + +# ----------------------------------------------------------------------------- +# List as sections +# +# You can define all the "list" as [section:key]. +# Each line will be considered as a option to the list. +# Let's take [app] / source.exclude_patterns. +# Instead of doing: +# +#[app] +#source.exclude_patterns = license,data/audio/*.wav,data/images/original/* +# +# This can be translated into: +# +#[app:source.exclude_patterns] +#license +#data/audio/*.wav +#data/images/original/* +# + + +# ----------------------------------------------------------------------------- +# Profiles +# +# You can extend section / key with a profile +# For example, you want to deploy a demo version of your application without +# HD content. You could first change the title to add "(demo)" in the name +# and extend the excluded directories to remove the HD content. +# +#[app@demo] +#title = My Application (demo) +# +#[app:source.exclude_patterns@demo] +#images/hd/* +# +# Then, invoke the command line with the "demo" profile: +# +#buildozer --profile demo android debug diff --git a/data/.gitignore b/data/.gitignore new file mode 100644 index 0000000..ea5ee19 --- /dev/null +++ b/data/.gitignore @@ -0,0 +1 @@ +#Files to ignore in data folder. diff --git a/data/settings.json b/data/settings.json new file mode 100644 index 0000000..e3e6263 --- /dev/null +++ b/data/settings.json @@ -0,0 +1,33 @@ +{ + "keys": { + "top": "z", + "left": "q", + "bottom": "s", + "right": "d", + "INTERACT": "spacebar" + }, + "high_score": 0, + "collection": { + "Agate": false, + "Amber": false, + "Aventurine": false, + "Amethyst": false, + "Azurite": false, + "Citrine": false, + "Diamond": false, + "Emerald": false, + "Fluorine": false, + "Garnet": false, + "Jade": false, + "Lapis lazuli": false, + "Malachite": false, + "Obsidian": false, + "Onyx": false, + "Opal": false, + "Rose quartz": false, + "Ruby": false, + "Sapphire": false, + "Tiger eye": false, + "Turquoise": false + } +} \ No newline at end of file diff --git a/lumacryte.spec b/lumacryte.spec new file mode 100644 index 0000000..a9d1277 --- /dev/null +++ b/lumacryte.spec @@ -0,0 +1,34 @@ +# -*- mode: python ; coding: utf-8 -*- +from kivy_deps import sdl2, glew +from kivy.tools.packaging.pyinstaller_hooks import get_deps_minimal, get_deps_all, hookspath, runtime_hooks +block_cipher = None + + +a = Analysis( + ['main.py'], + pathex=[], + datas=[("screens","screens"),("main.kv","."),("tools","tools")], + hookspath=hookspath(), + hooksconfig={}, + runtime_hooks=runtime_hooks(), + win_no_prefer_redirects=False, + win_private_assemblies=False, + cipher=block_cipher, + noarchive=False, + **get_deps_minimal(video=None,spelling=None, camera=None) +) +pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher) + +exe = EXE(pyz, + a.scripts, + a.binaries, + a.zipfiles, + a.datas, + name='Lumacryte', + *[Tree(p) for p in (sdl2.dep_bins + glew.dep_bins)], + debug=False, + strip=False, + upx=True, + runtime_tmpdir=None, + console=False, + icon='resources\\images\\icon.ico' ) \ No newline at end of file diff --git a/main.kv b/main.kv new file mode 100644 index 0000000..8e68eff --- /dev/null +++ b/main.kv @@ -0,0 +1,20 @@ +#:kivy 2.1.0 + +WindowManager: + LogoScreen: + name: "logo" + MenuScreen: + name: "menu" + WorldExplorerScreen: + name: "world_explorer" + SettingsScreen: + name: "settings" + GameOverScreen: + name: "game_over" + CollectionScreen: + name: "collection" + + +####################### +### Generic classes ### +####################### diff --git a/main.py b/main.py new file mode 100644 index 0000000..89c78d4 --- /dev/null +++ b/main.py @@ -0,0 +1,213 @@ +""" +Main module of the generator of dialogs. +""" + + +############### +### Imports ### +############### + + +### Python imports ### + +import os +import time + +### Kivy imports ### + +from kivy.app import App +from kivy.uix.screenmanager import ScreenManager, NoTransition, Screen +from kivy.lang import Builder +from kivy.uix.widget import Widget +from kivy.clock import Clock + + +### Module imports ### + +from tools.tools_constants import ( + PATH_KIVY_FOLDER, + PATH_IMAGES, + SPACE_KEY, + FPS, + PATH_LOGO, + DEBUG_MODE, + MOBILE_MODE +) +from tools.tools_world_explorer import ( + WorldExplorerScreen, + load_texture, + LogoTextureWidget +) +from screens import ( + MenuScreen, + SettingsScreen, + GameOverScreen, + CollectionScreen +) +from tools.tools_kivy import ( + color_label, + background_color, + Window +) +from tools.tools_sound import ( + music_mixer +) + + +def change_window_size(*args): + global WINDOW_SIZE, SCREEN_RATIO + + # Compute the size of one tile in pixel + WINDOW_SIZE = Window.size + SCREEN_RATIO = WINDOW_SIZE[0] / WINDOW_SIZE[1] + + +Window.bind(on_resize=change_window_size) +change_window_size() + +# Set the fullscreen +if not MOBILE_MODE: + # Window.fullscreen = "auto" + pass + + +############### +### General ### +############### + + +class LogoScreen(Screen): + def __init__(self, **kw): + super().__init__(**kw) + + def init_screen(self): + self.list_textures = self.load_logo_textures() + self.counter_texture = 0 + self.logo_image = LogoTextureWidget( + size_hint=(0.5, 0.5 * SCREEN_RATIO), + pos_hint={"center_x": 0.5, "center_y": 0.5}, + texture=self.list_textures[self.counter_texture]) + self.logo_image.keep_ratio = True + self.add_widget(self.logo_image) + self.loading_logo = Clock.schedule_interval(self.update, 1 / FPS) + + def load_logo_textures(self): + list_files = os.listdir(PATH_LOGO) + list_files.sort(key=lambda file: + int(file[-7:-4].replace("k", "").replace("_", "")), + reverse=True) + list_textures = [] + for file in list_files: + list_textures.append(load_texture(PATH_LOGO + file)) + return list_textures + + def update(self, *args): + time.sleep(0.0587) + if self.counter_texture < len(self.list_textures): + new_texture = self.list_textures[self.counter_texture] + self.logo_image.texture = new_texture + self.counter_texture += 1 + else: + Clock.unschedule(self.loading_logo) + self.manager.init_screen("menu") + + +class WindowManager(ScreenManager): + """ + Screen manager, which allows the navigation between the different menus. + """ + + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.gray_color = background_color + self.color_label = color_label + self.transition = NoTransition() + self.add_widget(Screen(name="opening")) + self.current = "opening" + self.list_former_screens = [] + + def init_screen(self, screen_name, *args): + # Link the keyboard + if not MOBILE_MODE: + self._keyboard = Window.request_keyboard( + self._keyboard_closed, self, 'text') + self._keyboard.bind(on_key_up=self.update_on_key_up) + + if screen_name == "world_explorer": + music_mixer.play("game_music", loop=True) + if screen_name != "logo": + Window.clearcolor = background_color + self.current = screen_name + self.get_screen(self.current).init_screen(*args) + + def update_on_key_up(self, keyboard, keycode): + """ + Update the the list of keys pressed when the key is up. + + Parameters + ---------- + keyboard + + keycode: int + Integer representing the key pressed by the user + + Returns + ------- + None + """ + if keycode[1] == SPACE_KEY and self.current == "menu": + self.init_screen("world_explorer") + + def _keyboard_closed(self): + """ + Unbind the keyboard. + + Parameters + ---------- + None + + Returns + ------- + None + """ + self._keyboard.unbind(on_key_up=self.update_on_key_up) + self._keyboard = None + + +class MainApp(App, Widget): + """ + Main class of the application. + """ + + def build(self): + """ + Build the application. + + Parameters + ---------- + None + + Returns + ------- + None + """ + Window.clearcolor = (0, 0, 0, 1) + self.icon = PATH_IMAGES + "logo.png" + + def on_start(self): + if MOBILE_MODE: + Window.update_viewport() + music_mixer.play("title_music", loop=True) + if DEBUG_MODE: + self.root_window.children[0].init_screen("menu") + else: + self.root_window.children[0].init_screen("logo") + return super().on_start() + + +# Run the application +if __name__ == "__main__": + for file_name in os.listdir(PATH_KIVY_FOLDER): + if file_name.endswith(".kv"): + Builder.load_file(PATH_KIVY_FOLDER + file_name, encoding="utf-8") + MainApp().run() diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..2180c52 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,21 @@ + +[build-system] +# requires = ["kivymd==1.1.1", "Pillow==9.5.0", "Kivy==2.1.0"] +build-backend = "buildozer" + +[tool.pylint] +recursive= "y" +load-plugins = "pylint_report" +ignore-patterns = ["draft*","venv"] + + [tool.pylint.basic] + # Add names that will always be accepted by pylint + good-names = ["i", "j", "k", "x", "y", "_"] + + [tool.pylint.reports] + output-format = "pylint_report.CustomJsonReporter" + reports = "y" + +[tool.pytest.ini_options] +addopts = "--ignore=.buildozer --cov-report html:reports/coverage --cov-report xml --cov" + diff --git a/releases/android/lumacryte-1.1.0-arm64-v8a_armeabi-v7a-debug.apk b/releases/android/lumacryte-1.1.0-arm64-v8a_armeabi-v7a-debug.apk new file mode 100644 index 0000000..bc4fa6d Binary files /dev/null and b/releases/android/lumacryte-1.1.0-arm64-v8a_armeabi-v7a-debug.apk differ diff --git a/releases/windows/Lumacryte.exe b/releases/windows/Lumacryte.exe new file mode 100644 index 0000000..68f280d Binary files /dev/null and b/releases/windows/Lumacryte.exe differ diff --git a/releases/windows/data/.gitignore b/releases/windows/data/.gitignore new file mode 100644 index 0000000..ea5ee19 --- /dev/null +++ b/releases/windows/data/.gitignore @@ -0,0 +1 @@ +#Files to ignore in data folder. diff --git a/releases/windows/data/settings.json b/releases/windows/data/settings.json new file mode 100644 index 0000000..e3e6263 --- /dev/null +++ b/releases/windows/data/settings.json @@ -0,0 +1,33 @@ +{ + "keys": { + "top": "z", + "left": "q", + "bottom": "s", + "right": "d", + "INTERACT": "spacebar" + }, + "high_score": 0, + "collection": { + "Agate": false, + "Amber": false, + "Aventurine": false, + "Amethyst": false, + "Azurite": false, + "Citrine": false, + "Diamond": false, + "Emerald": false, + "Fluorine": false, + "Garnet": false, + "Jade": false, + "Lapis lazuli": false, + "Malachite": false, + "Obsidian": false, + "Onyx": false, + "Opal": false, + "Rose quartz": false, + "Ruby": false, + "Sapphire": false, + "Tiger eye": false, + "Turquoise": false + } +} \ No newline at end of file diff --git a/releases/windows/lumacryte.zip b/releases/windows/lumacryte.zip new file mode 100644 index 0000000..b68ced5 Binary files /dev/null and b/releases/windows/lumacryte.zip differ diff --git a/releases/windows/resources/.gitignore b/releases/windows/resources/.gitignore new file mode 100644 index 0000000..d24b664 --- /dev/null +++ b/releases/windows/resources/.gitignore @@ -0,0 +1 @@ +#Files to ignore in resources folder. diff --git a/releases/windows/resources/atlas/ghost_textures.atlas b/releases/windows/resources/atlas/ghost_textures.atlas new file mode 100644 index 0000000..6c5a51c --- /dev/null +++ b/releases/windows/resources/atlas/ghost_textures.atlas @@ -0,0 +1 @@ +{"ghost_textures.png": {"back": [0, 400, 200, 200], "front": [200, 400, 200, 200], "left": [400, 400, 200, 200], "right": [0, 200, 200, 200], "left_front": [200, 200, 200, 200], "right_front": [400, 200, 200, 200], "right_back": [0, 0, 200, 200], "left_back": [200, 0, 200, 200]}} \ No newline at end of file diff --git a/releases/windows/resources/atlas/ghost_textures.png b/releases/windows/resources/atlas/ghost_textures.png new file mode 100644 index 0000000..14305cf Binary files /dev/null and b/releases/windows/resources/atlas/ghost_textures.png differ diff --git a/releases/windows/resources/atlas/map_textures.atlas b/releases/windows/resources/atlas/map_textures.atlas new file mode 100644 index 0000000..34fb212 --- /dev/null +++ b/releases/windows/resources/atlas/map_textures.atlas @@ -0,0 +1 @@ +{"map_textures.png": {"Citrine": [0, 1000, 200, 200], "beacon": [200, 1000, 200, 200], "beacon_off": [400, 1000, 200, 200], "ground": [600, 1000, 200, 200], "rock1": [800, 1000, 200, 200], "rock2": [1000, 1000, 200, 200], "rock3": [0, 800, 200, 200], "Onyx": [200, 800, 200, 200], "Obsidian": [400, 800, 200, 200], "Malachite": [600, 800, 200, 200], "Lapis lazuli": [800, 800, 200, 200], "Jade": [1000, 800, 200, 200], "Garnet": [0, 600, 200, 200], "Fluorine": [200, 600, 200, 200], "Emerald": [400, 600, 200, 200], "Azurite": [600, 600, 200, 200], "Diamond": [800, 600, 200, 200], "Aventurine": [1000, 600, 200, 200], "Amethyst": [0, 400, 200, 200], "Amber": [200, 400, 200, 200], "Agate": [400, 400, 200, 200], "Turquoise": [600, 400, 200, 200], "Tiger eye": [800, 400, 200, 200], "Sapphire": [1000, 400, 200, 200], "Ruby": [0, 200, 200, 200], "Rose quartz": [200, 200, 200, 200], "Opal": [400, 200, 200, 200], "crystal": [600, 200, 200, 200]}} \ No newline at end of file diff --git a/releases/windows/resources/atlas/map_textures.png b/releases/windows/resources/atlas/map_textures.png new file mode 100644 index 0000000..5d7b87a Binary files /dev/null and b/releases/windows/resources/atlas/map_textures.png differ diff --git a/releases/windows/resources/fonts/enchanted_land/Enchanted Land II.png b/releases/windows/resources/fonts/enchanted_land/Enchanted Land II.png new file mode 100644 index 0000000..eb0773a Binary files /dev/null and b/releases/windows/resources/fonts/enchanted_land/Enchanted Land II.png differ diff --git a/releases/windows/resources/fonts/enchanted_land/Enchanted Land.otf b/releases/windows/resources/fonts/enchanted_land/Enchanted Land.otf new file mode 100644 index 0000000..9c80d8a Binary files /dev/null and b/releases/windows/resources/fonts/enchanted_land/Enchanted Land.otf differ diff --git a/releases/windows/resources/fonts/enchanted_land/readme.txt b/releases/windows/resources/fonts/enchanted_land/readme.txt new file mode 100644 index 0000000..67e06a0 --- /dev/null +++ b/releases/windows/resources/fonts/enchanted_land/readme.txt @@ -0,0 +1,19 @@ +OTF and TTF: Enchanted Land +Dennis Ludlow 2016 all rights reserved +by Sharkshock +dennis@sharkshock.net + + +Welcome to the Enchanted Land where fun has no age limit! This display font borrows obvious inspiration from the classic signage used by the famous west coast amusement park. There are several others floating out there but this one features a clean glyph set with many European characters +and diacritic support for extended latin. The whimsical style of the caps flow with consistency and shows up in the numbers and many other marks as well. OTF features like kerning, ordinals, fractions, ligatures, alternates, and proportional numbers and punctuation for uppercase characters are +all included. All caps are NOT recommended. Use Enchanted Land for a children's project, book title, or anywhere you'd like a little magic. + + +This font like my others are free for personal use only as long as this readme file stays intact. For commercial use please contact me at dennis@sharkshock.net to discuss an end user license agreement. You can also visit www.sharkshock.net/license for more info. I also design custom fonts for +businesses, logos, and many other things. If you'd like to leave me a PayPal donation you can use my email address above. Your generosity will be most appreciated! + +tags: book, children, kids, script, amusement, park, fun, magic, serif, magical, publishing, display, font, typeface, fancy, whimsical, fantasy, enchanting, kid, rides, vacation, characters, Disney, land, logo + + +visit www.sharkshock.net for more and take a bite out of BORING design! + diff --git a/releases/windows/resources/images/back_arrow.png b/releases/windows/resources/images/back_arrow.png new file mode 100644 index 0000000..431fa66 Binary files /dev/null and b/releases/windows/resources/images/back_arrow.png differ diff --git a/releases/windows/resources/images/blank.png b/releases/windows/resources/images/blank.png new file mode 100644 index 0000000..109cec1 Binary files /dev/null and b/releases/windows/resources/images/blank.png differ diff --git a/releases/windows/resources/images/collection_background.png b/releases/windows/resources/images/collection_background.png new file mode 100644 index 0000000..9e67b79 Binary files /dev/null and b/releases/windows/resources/images/collection_background.png differ diff --git a/releases/windows/resources/images/collection_logo.png b/releases/windows/resources/images/collection_logo.png new file mode 100644 index 0000000..d195bc7 Binary files /dev/null and b/releases/windows/resources/images/collection_logo.png differ diff --git a/releases/windows/resources/images/game_over_background.png b/releases/windows/resources/images/game_over_background.png new file mode 100644 index 0000000..e818a3e Binary files /dev/null and b/releases/windows/resources/images/game_over_background.png differ diff --git a/releases/windows/resources/images/ghost_textures/back.png b/releases/windows/resources/images/ghost_textures/back.png new file mode 100644 index 0000000..64b7775 Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/back.png differ diff --git a/releases/windows/resources/images/ghost_textures/front.png b/releases/windows/resources/images/ghost_textures/front.png new file mode 100644 index 0000000..d5ae6cc Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/front.png differ diff --git a/releases/windows/resources/images/ghost_textures/left.png b/releases/windows/resources/images/ghost_textures/left.png new file mode 100644 index 0000000..2742cd3 Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/left.png differ diff --git a/releases/windows/resources/images/ghost_textures/left_back.png b/releases/windows/resources/images/ghost_textures/left_back.png new file mode 100644 index 0000000..ddb5c09 Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/left_back.png differ diff --git a/releases/windows/resources/images/ghost_textures/left_front.png b/releases/windows/resources/images/ghost_textures/left_front.png new file mode 100644 index 0000000..914adcc Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/left_front.png differ diff --git a/releases/windows/resources/images/ghost_textures/right.png b/releases/windows/resources/images/ghost_textures/right.png new file mode 100644 index 0000000..ab911f4 Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/right.png differ diff --git a/releases/windows/resources/images/ghost_textures/right_back.png b/releases/windows/resources/images/ghost_textures/right_back.png new file mode 100644 index 0000000..8426a37 Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/right_back.png differ diff --git a/releases/windows/resources/images/ghost_textures/right_front.png b/releases/windows/resources/images/ghost_textures/right_front.png new file mode 100644 index 0000000..64717e7 Binary files /dev/null and b/releases/windows/resources/images/ghost_textures/right_front.png differ diff --git a/releases/windows/resources/images/icon.ico b/releases/windows/resources/images/icon.ico new file mode 100644 index 0000000..e78469d Binary files /dev/null and b/releases/windows/resources/images/icon.ico differ diff --git a/releases/windows/resources/images/logo.png b/releases/windows/resources/images/logo.png new file mode 100644 index 0000000..b0f3924 Binary files /dev/null and b/releases/windows/resources/images/logo.png differ diff --git a/releases/windows/resources/images/map_textures/Agate.png b/releases/windows/resources/images/map_textures/Agate.png new file mode 100644 index 0000000..e534e18 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Agate.png differ diff --git a/releases/windows/resources/images/map_textures/Amber.png b/releases/windows/resources/images/map_textures/Amber.png new file mode 100644 index 0000000..a84806a Binary files /dev/null and b/releases/windows/resources/images/map_textures/Amber.png differ diff --git a/releases/windows/resources/images/map_textures/Amethyst.png b/releases/windows/resources/images/map_textures/Amethyst.png new file mode 100644 index 0000000..c50860a Binary files /dev/null and b/releases/windows/resources/images/map_textures/Amethyst.png differ diff --git a/releases/windows/resources/images/map_textures/Aventurine.png b/releases/windows/resources/images/map_textures/Aventurine.png new file mode 100644 index 0000000..f9a989e Binary files /dev/null and b/releases/windows/resources/images/map_textures/Aventurine.png differ diff --git a/releases/windows/resources/images/map_textures/Azurite.png b/releases/windows/resources/images/map_textures/Azurite.png new file mode 100644 index 0000000..33e79dc Binary files /dev/null and b/releases/windows/resources/images/map_textures/Azurite.png differ diff --git a/releases/windows/resources/images/map_textures/Citrine.png b/releases/windows/resources/images/map_textures/Citrine.png new file mode 100644 index 0000000..10efe53 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Citrine.png differ diff --git a/releases/windows/resources/images/map_textures/Diamond.png b/releases/windows/resources/images/map_textures/Diamond.png new file mode 100644 index 0000000..15120f8 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Diamond.png differ diff --git a/releases/windows/resources/images/map_textures/Emerald.png b/releases/windows/resources/images/map_textures/Emerald.png new file mode 100644 index 0000000..34dd252 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Emerald.png differ diff --git a/releases/windows/resources/images/map_textures/Fluorine.png b/releases/windows/resources/images/map_textures/Fluorine.png new file mode 100644 index 0000000..fabcfce Binary files /dev/null and b/releases/windows/resources/images/map_textures/Fluorine.png differ diff --git a/releases/windows/resources/images/map_textures/Garnet.png b/releases/windows/resources/images/map_textures/Garnet.png new file mode 100644 index 0000000..d025979 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Garnet.png differ diff --git a/releases/windows/resources/images/map_textures/Jade.png b/releases/windows/resources/images/map_textures/Jade.png new file mode 100644 index 0000000..81c0785 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Jade.png differ diff --git a/releases/windows/resources/images/map_textures/Lapis lazuli.png b/releases/windows/resources/images/map_textures/Lapis lazuli.png new file mode 100644 index 0000000..b40455b Binary files /dev/null and b/releases/windows/resources/images/map_textures/Lapis lazuli.png differ diff --git a/releases/windows/resources/images/map_textures/Malachite.png b/releases/windows/resources/images/map_textures/Malachite.png new file mode 100644 index 0000000..9ecbcd0 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Malachite.png differ diff --git a/releases/windows/resources/images/map_textures/Obsidian.png b/releases/windows/resources/images/map_textures/Obsidian.png new file mode 100644 index 0000000..43db7f3 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Obsidian.png differ diff --git a/releases/windows/resources/images/map_textures/Onyx.png b/releases/windows/resources/images/map_textures/Onyx.png new file mode 100644 index 0000000..dc9f64a Binary files /dev/null and b/releases/windows/resources/images/map_textures/Onyx.png differ diff --git a/releases/windows/resources/images/map_textures/Opal.png b/releases/windows/resources/images/map_textures/Opal.png new file mode 100644 index 0000000..966a04e Binary files /dev/null and b/releases/windows/resources/images/map_textures/Opal.png differ diff --git a/releases/windows/resources/images/map_textures/Rose quartz.png b/releases/windows/resources/images/map_textures/Rose quartz.png new file mode 100644 index 0000000..fc9dfe9 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Rose quartz.png differ diff --git a/releases/windows/resources/images/map_textures/Ruby.png b/releases/windows/resources/images/map_textures/Ruby.png new file mode 100644 index 0000000..88313ce Binary files /dev/null and b/releases/windows/resources/images/map_textures/Ruby.png differ diff --git a/releases/windows/resources/images/map_textures/Sapphire.png b/releases/windows/resources/images/map_textures/Sapphire.png new file mode 100644 index 0000000..1a863e2 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Sapphire.png differ diff --git a/releases/windows/resources/images/map_textures/Tiger eye.png b/releases/windows/resources/images/map_textures/Tiger eye.png new file mode 100644 index 0000000..5cf82d5 Binary files /dev/null and b/releases/windows/resources/images/map_textures/Tiger eye.png differ diff --git a/releases/windows/resources/images/map_textures/Turquoise.png b/releases/windows/resources/images/map_textures/Turquoise.png new file mode 100644 index 0000000..f686c0d Binary files /dev/null and b/releases/windows/resources/images/map_textures/Turquoise.png differ diff --git a/releases/windows/resources/images/map_textures/beacon.png b/releases/windows/resources/images/map_textures/beacon.png new file mode 100644 index 0000000..09204c9 Binary files /dev/null and b/releases/windows/resources/images/map_textures/beacon.png differ diff --git a/releases/windows/resources/images/map_textures/beacon_off.png b/releases/windows/resources/images/map_textures/beacon_off.png new file mode 100644 index 0000000..c8a1001 Binary files /dev/null and b/releases/windows/resources/images/map_textures/beacon_off.png differ diff --git a/releases/windows/resources/images/map_textures/crystal.png b/releases/windows/resources/images/map_textures/crystal.png new file mode 100644 index 0000000..9107f12 Binary files /dev/null and b/releases/windows/resources/images/map_textures/crystal.png differ diff --git a/releases/windows/resources/images/map_textures/ground.png b/releases/windows/resources/images/map_textures/ground.png new file mode 100644 index 0000000..40de289 Binary files /dev/null and b/releases/windows/resources/images/map_textures/ground.png differ diff --git a/releases/windows/resources/images/map_textures/rock1.png b/releases/windows/resources/images/map_textures/rock1.png new file mode 100644 index 0000000..db206be Binary files /dev/null and b/releases/windows/resources/images/map_textures/rock1.png differ diff --git a/releases/windows/resources/images/map_textures/rock2.png b/releases/windows/resources/images/map_textures/rock2.png new file mode 100644 index 0000000..44635f6 Binary files /dev/null and b/releases/windows/resources/images/map_textures/rock2.png differ diff --git a/releases/windows/resources/images/map_textures/rock3.png b/releases/windows/resources/images/map_textures/rock3.png new file mode 100644 index 0000000..d7da180 Binary files /dev/null and b/releases/windows/resources/images/map_textures/rock3.png differ diff --git a/releases/windows/resources/images/menu_background.png b/releases/windows/resources/images/menu_background.png new file mode 100644 index 0000000..a672606 Binary files /dev/null and b/releases/windows/resources/images/menu_background.png differ diff --git a/releases/windows/resources/images/settings_background.png b/releases/windows/resources/images/settings_background.png new file mode 100644 index 0000000..f0dedb3 Binary files /dev/null and b/releases/windows/resources/images/settings_background.png differ diff --git a/releases/windows/resources/images/settings_logo.png b/releases/windows/resources/images/settings_logo.png new file mode 100644 index 0000000..ee3ee06 Binary files /dev/null and b/releases/windows/resources/images/settings_logo.png differ diff --git a/releases/windows/resources/kivy/collection.kv b/releases/windows/resources/kivy/collection.kv new file mode 100644 index 0000000..bebae91 --- /dev/null +++ b/releases/windows/resources/kivy/collection.kv @@ -0,0 +1,52 @@ +#:kivy 2.1.0 +: + + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Image: + source: root.path_images + "back_arrow.png" + size_hint: None, 0.1 + pos_hint: {"x":0.025, "top": 0.975} + allow_stretch: True + width: self.height + Button: + size_hint: None, 0.1 + width: self.height + pos_hint: {"x":0.025, "top": 0.975} + background_color: (0, 0, 0, 0) + on_release: + root.manager.init_screen("menu") + + Label: + text: root.counter_precious_stones + bold: True + color: root.manager.color_label + pos_hint: {"right":1, "top":1} + size_hint: 0.1, 0.1 + font_name: root.font + font_size: 30*root.font_ratio + + RelativeLayout: + size_hint: 1, 0.9 + pos_hint: {"x":0, "y":0} + ScrollView: + id: scroll_view + do_scroll_x: False + do_scroll_y: True + bar_width: 0 + + MyScrollViewLayout: + id: my_sv_layout + cols: root.number_cols + spacing: root.spacing + padding: root.padding + height: self.minimum_height+root.label_height + pos: root.pos diff --git a/releases/windows/resources/kivy/extended_style.kv b/releases/windows/resources/kivy/extended_style.kv new file mode 100644 index 0000000..0568c6b --- /dev/null +++ b/releases/windows/resources/kivy/extended_style.kv @@ -0,0 +1,299 @@ +#:kivy 1.0 + + +######################## +### Colors variables ### +######################## + + +#:set pink_color (229 / 255, 19 / 255, 100 / 255, 1) +#:set blue_color (70 / 255, 130 / 255, 180 / 255, 1) +#:set gray_color (100 / 255, 100 / 255, 100 / 255, 1) +#:set highlight_text_color (229 / 255, 19 / 255, 100 / 255, 0.5) +#:set black_color (0, 0, 0, 1) + + +############### +### Buttons ### +############### + + +<-Button,-ToggleButton>: + + # Blue + background_normal: 'atlas://resources/kivy/images/defaulttheme/button_blue' + # Light pink + background_pressed: 'atlas://resources/kivy/images/defaulttheme/button_pink_pressed' + # Gray + background_disabled: 'atlas://resources/kivy/images/defaulttheme/button_gray_disabled' + # Pink + background_focus: 'atlas://resources/kivy/images/defaulttheme/button_pink' + state_image: (self.background_normal if self.state == 'normal' else self.background_focus) if self.state == 'normal' else self.background_focus + disabled_image: self.background_disabled + bold: True + canvas: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: self.disabled_image if self.disabled else self.state_image + Color: + rgba: 1, 1, 1, 1 + Rectangle: + texture: self.texture + size: self.texture_size + pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.) + + +<-FocusableButton>: + + # Blue + background_normal: 'atlas://resources/kivy/images/defaulttheme/button_blue' + # Light pink + background_pressed: 'atlas://resources/kivy/images/defaulttheme/button_pink_pressed' + # Gray + background_disabled: 'atlas://resources/kivy/images/defaulttheme/button_gray_disabled' + # Pink + background_focus: 'atlas://resources/kivy/images/defaulttheme/button_pink' + state_image: (self.background_focus if self.focus else self.background_normal) if self.state == 'normal' else self.background_pressed + disabled_image: self.background_disabled + bold: True + canvas: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: self.disabled_image if self.disabled else self.state_image + Color: + rgba: 1, 1, 1, 1 + Rectangle: + texture: self.texture + size: self.texture_size + pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.) + + +################## +### Text Input ### +################## + + +: + canvas.before: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: 'atlas://resources/kivy/images/defaulttheme/textinput_active' if self.focus else ('atlas://resources/kivy/images/defaulttheme/textinput_disabled_active' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/textinput') + Color: + rgba: + ((156/255,0,60/255,1) + if self.focus and not self._cursor_blink + and int(self.x + self.padding[0]) <= self._cursor_visual_pos[0] <= int(self.x + self.width - self.padding[2]) + else (0, 0, 0, 0)) + Rectangle: + pos: self._cursor_visual_pos + size: root.cursor_width, -self._cursor_visual_height + Color: + rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color) + +: + color: pink_color + allow_stretch: True + +: + color_mode: "custom" + mode: "rectangle" + line_color_focus: pink_color + line_color_normal: blue_color if not self.disabled else gray_color + normal_color: blue_color + color_active: pink_color + disabled_color: gray_color + text_color_focus: black_color + text_color_normal: blue_color + hint_text_color_normal: pink_color + hint_text_color_focus: blue_color + selection_color: highlight_text_color + + +############### +### Spinner ### +############### + + +: + background_normal: 'atlas://resources/kivy/images/defaulttheme/spinner' + background_disabled: 'atlas://resources/kivy/images/defaulttheme/spinner_disabled' + background_focus: 'atlas://resources/kivy/images/defaulttheme/spinner_pressed' + state_image: self.background_focus if self.focus else self.background_normal + disabled_image: self.background_disabled + bold: True + canvas: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: self.disabled_image if self.disabled else self.state_image + Color: + rgba: 1, 1, 1, 1 + Rectangle: + texture: self.texture + size: self.texture_size + pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.) + +: + background_normal: 'atlas://resources/kivy/images/defaulttheme/spinner' + background_disabled_normal: 'atlas://resources/kivy/images/defaulttheme/spinner_disabled' + background_down: 'atlas://resources/kivy/images/defaulttheme/spinner_pressed' + + +############## +### Slider ### +############## + + +: + canvas: + Color: + rgb: 1, 1, 1 + BorderImage: + border: self.border_horizontal if self.orientation == 'horizontal' else self.border_vertical + pos: (self.x + self.padding, self.center_y - self.background_width / 2) if self.orientation == 'horizontal' else (self.center_x - self.background_width / 2, self.y + self.padding) + size: (self.width - self.padding * 2, self.background_width) if self.orientation == 'horizontal' else (self.background_width, self.height - self.padding * 2) + source: ('atlas://resources/kivy/images/defaulttheme/sliderh_background_disabled' if self.orientation == 'horizontal' else 'atlas://resources/kivy/images/defaulttheme/sliderv_background_disabled') if self.disabled else ('atlas://resources/kivy/images/defaulttheme/sliderh_background' if self.orientation == 'horizontal' else 'atlas://resources/kivy/images/defaulttheme/sliderv_background') + Color: + rgba: root.value_track_color if self.value_track and self.orientation == 'horizontal' else [1, 1, 1, 0] + Line: + width: self.value_track_width + points: self.x + self.padding, self.center_y, self.value_pos[0], self.center_y + Color: + rgba: root.value_track_color if self.value_track and self.orientation == 'vertical' else [1, 1, 1, 0] + Line: + width: self.value_track_width + points: self.center_x, self.y + self.padding, self.center_x, self.value_pos[1] + Color: + rgb: 1, 1, 1 + Image: + pos: (root.value_pos[0] - root.cursor_width / 2, root.center_y - root.cursor_height / 2) if root.orientation == 'horizontal' else (root.center_x - root.cursor_width / 2, root.value_pos[1] - root.cursor_height / 2) + size: root.cursor_size + source: 'atlas://resources/kivy/images/defaulttheme/slider_cursor_disabled' if root.disabled else 'atlas://resources/kivy/images/defaulttheme/slider_cursor' + allow_stretch: True + keep_ratio: False + + +#################### +### Progress bar ### +#################### + + +: + canvas: + Color: + rgb: 1, 1, 1 + BorderImage: + border: (12, 12, 12, 12) + pos: self.x, self.center_y - 12 + size: self.width, 24 + source: 'atlas://resources/kivy/images/defaulttheme/progressbar_background' + BorderImage: + border: [int(min(self.width * (self.value / float(self.max)) if self.max else 0, 12))] * 4 + pos: self.x, self.center_y - 12 + size: self.width * (self.value / float(self.max)) if self.max else 0, 24 + source: 'atlas://resources/kivy/images/defaulttheme/progressbar' + + +############## +### Switch ### +############## + + +: + active_norm_pos: max(0., min(1., (int(self.active) + self.touch_distance / sp(41)))) + canvas: + Color: + rgb: 1, 1, 1 + Rectangle: + source: 'atlas://resources/kivy/images/defaulttheme/switch-background{}'.format('_disabled' if self.disabled else '') + size: sp(83), sp(32) + pos: int(self.center_x - sp(41)), int(self.center_y - sp(16)) + canvas.after: + Color: + rgb: 1, 1, 1 + Rectangle: + source: 'atlas://resources/kivy/images/defaulttheme/switch-button{}'.format('_disabled' if self.disabled else '') + size: sp(43), sp(32) + pos: int(self.center_x - sp(41) + self.active_norm_pos * sp(41)), int(self.center_y - sp(16)) + + +################ +### Checkbox ### +################ + + +: + canvas: + Color: + rgba: self.color + Rectangle: + source: (('atlas://resources/kivy/images/defaulttheme/checkbox_radio_focus_on' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_disabled_on' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_on') if self.active else ('atlas://resources/kivy/images/defaulttheme/checkbox_radio_focus_off' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_disabled_off' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_off')) if self.group else (('atlas://resources/kivy/images/defaulttheme/checkbox_focus_on' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_disabled_on' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_on') if self.active else ('atlas://resources/kivy/images/defaulttheme/checkbox_focus_off' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_disabled_off' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_off')) + size: sp(32), sp(32) + pos: int(self.center_x - sp(16)), int(self.center_y - sp(16)) + +: + pos_hint: root.pos_hint + FocusableCheckBox: + id: checkbox + pos_hint: {"x":0, "y":0} + size_hint: root.size_hint_cb + group: root.group + disabled: root.disabled_cb + on_active: + root.function_cb + Label: + text: root.text_label + color: root.color_label + size_hint: root.size_hint_label + pos_hint: {"x":0.1, "y":0} + text_size: self.size + halign: "left" + valign: "center" + +############# +### Popup ### +############# + + +: + size: root.size_popup + pos_hint: {"x":0, "y":0} + + Widget: + canvas: + Color: + rgba: root.blue_color + Rectangle: + pos: root.x, root.top + size: self.width, dp(3) + + +############### +### Tooltip ### +############### + + +: + size_hint: None, None + size: self.texture_size[0]+5, self.texture_size[1]+5 + canvas.before: + Color: + rgb: 0.2, 0.2, 0.2 + Rectangle: + size: self.size + pos: self.pos diff --git a/releases/windows/resources/kivy/game_over.kv b/releases/windows/resources/kivy/game_over.kv new file mode 100644 index 0000000..29fd209 --- /dev/null +++ b/releases/windows/resources/kivy/game_over.kv @@ -0,0 +1,53 @@ +#:kivy 2.1.0 + +: + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Label: + id: title_label + text: "Game Over" + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.5, "center_y": 0.9} + font_size: 50*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: credit_label + text: "Game created by :\n - Agathe\n - Paul" + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.2, "center_y": 0.5} + font_size: 40*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: score_label + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.8, "center_y": 0.5} + font_size: 40*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: back_to_menu + text: "Back to main menu" + font_name: root.font + font_size: 40*root.font_ratio + color: root.manager.color_label + pos_hint: {"center_x":0.5, "center_y": 0.15} + size_hint: 0.2, 0.1 + Button: + size_hint: 0.2, 0.1 + pos_hint: {"center_x":0.5, "center_y": 0.15} + background_color: (0, 0, 0, 0) + on_release: + root.manager.init_screen("menu") diff --git a/releases/windows/resources/kivy/images/close_button.png b/releases/windows/resources/kivy/images/close_button.png new file mode 100644 index 0000000..9177796 Binary files /dev/null and b/releases/windows/resources/kivy/images/close_button.png differ diff --git a/releases/windows/resources/kivy/images/defaulttheme.atlas b/releases/windows/resources/kivy/images/defaulttheme.atlas new file mode 100644 index 0000000..a2cdc0a --- /dev/null +++ b/releases/windows/resources/kivy/images/defaulttheme.atlas @@ -0,0 +1 @@ +{"defaulttheme.png": {"progressbar_background": [392, 227, 24, 24], "tab_btn_disabled": [332, 137, 32, 32], "tab_btn_pressed": [400, 137, 32, 32], "image-missing": [152, 171, 48, 48], "splitter_h": [174, 123, 32, 7], "splitter_down": [11, 10, 7, 32], "splitter_disabled_down": [2, 10, 7, 32], "vkeyboard_key_down": [2, 44, 32, 32], "vkeyboard_disabled_key_down": [434, 137, 32, 32], "selector_right": [438, 326, 64, 64], "player-background": [2, 287, 103, 103], "selector_middle": [372, 326, 64, 64], "spinner": [204, 82, 29, 37], "tab_btn_disabled_pressed": [366, 137, 32, 32], "switch-button_disabled": [375, 291, 43, 32], "textinput_disabled_active": [134, 221, 64, 64], "splitter_grip": [70, 50, 12, 26], "vkeyboard_key_normal": [36, 44, 32, 32], "button_disabled": [111, 82, 29, 37], "media-playback-stop": [302, 171, 48, 48], "splitter": [502, 137, 7, 32], "splitter_down_h": [140, 123, 32, 7], "sliderh_background_disabled": [115, 132, 41, 37], "modalview-background": [464, 456, 45, 54], "button": [80, 82, 29, 37], "splitter_disabled": [501, 87, 7, 32], "checkbox_radio_focus_on": [467, 87, 32, 32], "slider_cursor": [352, 171, 48, 48], "vkeyboard_disabled_background": [266, 221, 64, 64], "checkbox_focus_on": [331, 87, 32, 32], "sliderv_background_disabled": [41, 78, 37, 41], "button_disabled_pressed": [142, 82, 29, 37], "audio-volume-muted": [102, 171, 48, 48], "close": [487, 173, 20, 20], "action_group_disabled": [2, 121, 33, 48], "vkeyboard_background": [200, 221, 64, 64], "checkbox_off": [365, 87, 32, 32], "tab_disabled": [107, 291, 96, 32], "sliderh_background": [72, 132, 41, 37], "switch-button": [430, 253, 43, 32], "tree_closed": [418, 231, 20, 20], "bubble_btn_pressed": [454, 291, 32, 32], "selector_left": [306, 326, 64, 64], "filechooser_file": [174, 326, 64, 64], "checkbox_radio_focus_off": [433, 87, 32, 32], "checkbox_radio_on": [230, 137, 32, 32], "checkbox_on": [399, 87, 32, 32], "button_pressed": [173, 82, 29, 37], "audio-volume-high": [464, 406, 48, 48], "audio-volume-low": [2, 171, 48, 48], "progressbar": [332, 227, 32, 24], "previous_normal": [488, 291, 19, 32], "separator": [504, 342, 5, 48], "filechooser_folder": [240, 326, 64, 64], "checkbox_radio_off": [196, 137, 32, 32], "textinput_active": [68, 221, 64, 64], "textinput": [2, 221, 64, 64], "player-play-overlay": [122, 395, 117, 115], "media-playback-pause": [202, 171, 48, 48], "sliderv_background": [2, 78, 37, 41], "ring": [354, 402, 108, 108], "bubble_arrow": [490, 241, 16, 10], "slider_cursor_disabled": [402, 171, 48, 48], "checkbox_focus_off": [297, 87, 32, 32], "action_group_down": [37, 121, 33, 48], "spinner_disabled": [235, 82, 29, 37], "splitter_disabled_h": [106, 123, 32, 7], "bubble": [107, 325, 65, 65], "media-playback-start": [252, 171, 48, 48], "vkeyboard_disabled_key_normal": [468, 137, 32, 32], "overflow": [264, 137, 32, 32], "tree_opened": [440, 231, 20, 20], "action_item": [487, 195, 24, 24], "bubble_btn": [420, 291, 32, 32], "audio-volume-medium": [52, 171, 48, 48], "action_group": [452, 171, 33, 48], "spinner_pressed": [266, 82, 29, 37], "filechooser_selected": [2, 392, 118, 118], "tab": [332, 253, 96, 32], "action_bar": [158, 133, 36, 36], "action_view": [366, 227, 24, 24], "tab_btn": [298, 137, 32, 32], "switch-background": [205, 291, 83, 32], "splitter_disabled_down_h": [72, 123, 32, 7], "action_item_down": [475, 253, 32, 32], "switch-background_disabled": [290, 291, 83, 32], "textinput_disabled": [241, 399, 111, 111], "splitter_grip_h": [462, 239, 26, 12], "button_blue": [80, 43, 29, 37], "button_gray_disabled": [111, 43, 29, 37], "button_pink": [142, 43, 29, 37], "button_pink_pressed": [173, 43, 29, 37], "checkbox_disabled_on": [331, 57.5, 32, 32], "checkbox_disabled_off": [297, 57.5, 32, 32], "checkbox_radio_disabled_off":[467, 57.5, 32, 32], "checkbox_radio_disabled_off": [433, 57.5, 32, 32]}} \ No newline at end of file diff --git a/releases/windows/resources/kivy/images/defaulttheme.png b/releases/windows/resources/kivy/images/defaulttheme.png new file mode 100644 index 0000000..9e8e9ac Binary files /dev/null and b/releases/windows/resources/kivy/images/defaulttheme.png differ diff --git a/releases/windows/resources/kivy/menu.kv b/releases/windows/resources/kivy/menu.kv new file mode 100644 index 0000000..4756d9b --- /dev/null +++ b/releases/windows/resources/kivy/menu.kv @@ -0,0 +1,77 @@ +#:kivy 2.1.0 + +: + + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Label: + id: title_label + text: "LUMACRYTE" + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.5, "center_y": 0.85} + font_size: 60*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: start_label + text: "Start a new game" if root.mobile_mode else "Press space to start a new game" + size_hint: 1, 0.25 + pos_hint: {"center_x": 0.5, "center_y": 0.45} + font_size: 40*root.font_ratio + font_name: root.font + color: root.manager.color_label + Button: + size_hint: 1, 0.25 + pos_hint: {"center_x": 0.5, "center_y": 0.45} + background_color: 0, 0, 0, 0 + on_release: + root.manager.init_screen("world_explorer") + + Image: + id: settings_logo + source: root.path_images + "settings_logo.png" + size_hint: None, 0.15 + pos_hint: {"right": 0.95, "y": 0.05} + allow_stretch: True + width: self.height + Button: + id: settings_button + size_hint: None, 0.15 + pos_hint: {"right": 0.95, "y": 0.05} + background_color: (0, 0, 0, 0) + width: self.height + on_release: + root.manager.init_screen("settings") + + Label: + id: high_score_label + text: root.high_score + bold: True + color: root.manager.color_label + pos_hint: {"right":1, "y":0} + size_hint: 0.2, 0.1 + font_name: root.font + font_size: 30*root.font_ratio + + Image: + source: root.path_images + "collection_logo.png" + size_hint: None, 0.15 + pos_hint: {"x": 0.05, "y": 0.05} + allow_stretch: True + width: self.height + Button: + size_hint: None, 0.15 + pos_hint: {"x": 0.05, "y": 0.05} + background_color: (0, 0, 0, 0) + width: self.height + on_release: + root.manager.init_screen("collection") diff --git a/releases/windows/resources/kivy/settings.kv b/releases/windows/resources/kivy/settings.kv new file mode 100644 index 0000000..989fae2 --- /dev/null +++ b/releases/windows/resources/kivy/settings.kv @@ -0,0 +1,140 @@ +#:kivy 2.1.0 + +: + + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Image: + source: root.path_images + "back_arrow.png" + size_hint: None, 0.1 + pos_hint: {"x":0.025, "top": 0.975} + allow_stretch: True + width: self.height + Button: + size_hint: None, 0.1 + width: self.height + pos_hint: {"x":0.025, "top": 0.975} + background_color: (0, 0, 0, 0) + on_release: + root.manager.init_screen("menu") + + Label: + text: root.high_score + bold: True + color: root.manager.color_label + pos_hint: {"right":1, "top":1} + size_hint: 0.2, 0.1 + font_name: root.font + font_size: 30*root.font_ratio + + + # KEYBOARD CONFIGURATION + + Button: + id: top_button + text: "Move up" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.7} + color: root.manager.gray_color + font_name: root.font + font_size: 20*root.font_ratio + on_release: + root.select_next_key("top") + Button: + id: top_key_input + text: root.top_key + size_hint: 0.1, 0.1 + pos_hint: {"x":0.65, "y": 0.7} + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + color: root.manager.color_label + + Button: + id: left_button + text: "Move left" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.55} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("left") + Button: + id: left_key_input + text: root.left_key + size_hint: 0.1, 0.1 + pos_hint: {"x":0.65, "y": 0.55} + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + color: root.manager.color_label + + Button: + id: bottom_button + text: "Move down" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.4} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("bottom") + Button: + id: bottom_key_input + text: root.bottom_key + size_hint: 0.1, 0.1 + pos_hint: {"x":0.65, "y": 0.4} + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + color: root.manager.color_label + + + Button: + id: right_button + text: "Move right" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.25} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("right") + Button: + id: right_key_input + text: root.right_key + size_hint: 0.1, 0.1 + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + pos_hint: {"x":0.65, "y": 0.25} + color: root.manager.color_label + + Button: + id: interact_button + text: "Interact" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.1} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("INTERACT") + Button: + id: interact_key_input + text: root.interact_key + size_hint: 0.1, 0.1 + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + pos_hint: {"x":0.65, "y": 0.1} + color: root.manager.color_label diff --git a/releases/windows/resources/kivy/world_explorer.kv b/releases/windows/resources/kivy/world_explorer.kv new file mode 100644 index 0000000..506b6c8 --- /dev/null +++ b/releases/windows/resources/kivy/world_explorer.kv @@ -0,0 +1,3 @@ +#:kivy 2.1.0 + +: diff --git a/releases/windows/resources/maps/test_cave.txt b/releases/windows/resources/maps/test_cave.txt new file mode 100644 index 0000000..2452ee1 --- /dev/null +++ b/releases/windows/resources/maps/test_cave.txt @@ -0,0 +1,32 @@ +R R R R R R R R R G G G G G C G G R R C G G G G R G G C R R R R +R R R R R R R R R G G G G G G G R R R R G G G G R G G G R R R R +R R R R R R R R G G G R G C G G R R R R G R G G G G G G R G C R +R R R R C R R R G G G G R G G G G C R G G R R R G R G G G G G G +R R R R G G G G G G G G G R G G G G R G G R R R G C G G G R G G +R R G G C G G R R G G G C R G G G G G G G R R R G G R C G G G R +R R G G R R G G R R G G R G G R R G G G G R R R R R R G G G G G +R R G G G R G G G R G G C G G G G G G R R C R R R R R G G R G G +R G G G G R R G G R R G R G G R R G R R G G R R R R R G G G G G +R G R R R R R R R R G G C G R R R G G R G G G R R R R R G R R G +R R R R R R R R R R G G R G R R R G G G G G R R R G G G G G C G +R R G G C R R R R R G G C G G R R G G G G G R R R G G C G G G G +R R G G G G R R R R R R R R G R G R G G G G R R R R G G G G G G +R R G G G G G G R R R R R G G R G G G G G G G G C R G G R G C G +R C G G G R G R R R R R G G G G R R R R G G G G R R R R R G G G +R G G G G G G R G R R R G G G G G G R R R R R R R R R R R G G G +G G G G G G G R G G R R G G G G B G R R R R R R R R R R R R R G +G G G G G G R R G R R R R R G G G G G G R R R R R R R R R R R R +R G G G R R R R G R R R R R R G C G G G R R R R R R R R R R R R +R G G G G G G G G R R R R R R G G G G G R R R R R R R R R G R R +R G R R C G G G G R R R C G G G G G R R R R R G G G R R G G R R +R R R G G G G C R R R R R R R R R G G G R R G G G G G R G G G G +R R R G G C G G G G R R R R R G G G G G R R R C R G G R G G G G +R R G G G C G G G R R R R R R G G C G C G R R G R G G G G G G R +R R G G G G G G G R R R R R R R R R G G G G R G R R G R R G C R +R R R C G G G G G G G R R R R R R R G G G G R G G G G R R G G R +R R G G G G C G G G G R R R R R G G G G G R R G R R R C G G G R +R G G G G G C G G G G R R R R R G G G G G G G R R R R G G G G G +R G G G G R R G G G G R G R G G R G G G G R R R R R G G R G G G +R G G G G G R R R G G G G G C G G G G G G R R R R R R R R G G G +G G G R C G G C R G G G G G G G G C G G C R R R R R R R R R G G +G R R R R G G G G G G G G C G G G R G G R R R R R R R R R C G R \ No newline at end of file diff --git a/releases/windows/resources/musics/game_music.mp3 b/releases/windows/resources/musics/game_music.mp3 new file mode 100644 index 0000000..58360cc Binary files /dev/null and b/releases/windows/resources/musics/game_music.mp3 differ diff --git a/releases/windows/resources/musics/game_over_music.mp3 b/releases/windows/resources/musics/game_over_music.mp3 new file mode 100644 index 0000000..cf23c77 Binary files /dev/null and b/releases/windows/resources/musics/game_over_music.mp3 differ diff --git a/releases/windows/resources/musics/title_music.mp3 b/releases/windows/resources/musics/title_music.mp3 new file mode 100644 index 0000000..1f5dd7e Binary files /dev/null and b/releases/windows/resources/musics/title_music.mp3 differ diff --git a/releases/windows/resources/sounds/darkness.mp3 b/releases/windows/resources/sounds/darkness.mp3 new file mode 100644 index 0000000..a20829d Binary files /dev/null and b/releases/windows/resources/sounds/darkness.mp3 differ diff --git a/releases/windows/resources/sounds/death.mp3 b/releases/windows/resources/sounds/death.mp3 new file mode 100644 index 0000000..fa36e7d Binary files /dev/null and b/releases/windows/resources/sounds/death.mp3 differ diff --git a/releases/windows/resources/sounds/flic.mp3 b/releases/windows/resources/sounds/flic.mp3 new file mode 100644 index 0000000..afffe83 Binary files /dev/null and b/releases/windows/resources/sounds/flic.mp3 differ diff --git a/releases/windows/resources/sounds/get_crystal.mp3 b/releases/windows/resources/sounds/get_crystal.mp3 new file mode 100644 index 0000000..7dff128 Binary files /dev/null and b/releases/windows/resources/sounds/get_crystal.mp3 differ diff --git a/releases/windows/resources/sounds/give_crystal.mp3 b/releases/windows/resources/sounds/give_crystal.mp3 new file mode 100644 index 0000000..1866aec Binary files /dev/null and b/releases/windows/resources/sounds/give_crystal.mp3 differ diff --git a/releases/windows/resources/sounds/near_beacon.mp3 b/releases/windows/resources/sounds/near_beacon.mp3 new file mode 100644 index 0000000..1c943c8 Binary files /dev/null and b/releases/windows/resources/sounds/near_beacon.mp3 differ diff --git a/releases/windows/resources/sounds/near_crystal.mp3 b/releases/windows/resources/sounds/near_crystal.mp3 new file mode 100644 index 0000000..c9e1895 Binary files /dev/null and b/releases/windows/resources/sounds/near_crystal.mp3 differ diff --git a/releases/windows/resources/sounds/start_beacon.mp3 b/releases/windows/resources/sounds/start_beacon.mp3 new file mode 100644 index 0000000..e2789e0 Binary files /dev/null and b/releases/windows/resources/sounds/start_beacon.mp3 differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_0.png b/releases/windows/resources/start_logo/washing_machine_black_0.png new file mode 100644 index 0000000..061bac2 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_0.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_1.png b/releases/windows/resources/start_logo/washing_machine_black_1.png new file mode 100644 index 0000000..c756042 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_1.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_10.png b/releases/windows/resources/start_logo/washing_machine_black_10.png new file mode 100644 index 0000000..50a5b30 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_10.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_100.png b/releases/windows/resources/start_logo/washing_machine_black_100.png new file mode 100644 index 0000000..58aafcf Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_100.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_101.png b/releases/windows/resources/start_logo/washing_machine_black_101.png new file mode 100644 index 0000000..dd54d16 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_101.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_102.png b/releases/windows/resources/start_logo/washing_machine_black_102.png new file mode 100644 index 0000000..f92363a Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_102.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_103.png b/releases/windows/resources/start_logo/washing_machine_black_103.png new file mode 100644 index 0000000..a515329 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_103.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_104.png b/releases/windows/resources/start_logo/washing_machine_black_104.png new file mode 100644 index 0000000..93695c1 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_104.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_105.png b/releases/windows/resources/start_logo/washing_machine_black_105.png new file mode 100644 index 0000000..a43b85d Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_105.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_106.png b/releases/windows/resources/start_logo/washing_machine_black_106.png new file mode 100644 index 0000000..3d2657c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_106.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_107.png b/releases/windows/resources/start_logo/washing_machine_black_107.png new file mode 100644 index 0000000..6c43d76 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_107.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_108.png b/releases/windows/resources/start_logo/washing_machine_black_108.png new file mode 100644 index 0000000..c795ef5 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_108.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_109.png b/releases/windows/resources/start_logo/washing_machine_black_109.png new file mode 100644 index 0000000..525fcff Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_109.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_11.png b/releases/windows/resources/start_logo/washing_machine_black_11.png new file mode 100644 index 0000000..ff44f66 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_11.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_110.png b/releases/windows/resources/start_logo/washing_machine_black_110.png new file mode 100644 index 0000000..9ac08aa Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_110.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_111.png b/releases/windows/resources/start_logo/washing_machine_black_111.png new file mode 100644 index 0000000..354510e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_111.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_112.png b/releases/windows/resources/start_logo/washing_machine_black_112.png new file mode 100644 index 0000000..f4a964e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_112.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_113.png b/releases/windows/resources/start_logo/washing_machine_black_113.png new file mode 100644 index 0000000..03d8c9e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_113.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_114.png b/releases/windows/resources/start_logo/washing_machine_black_114.png new file mode 100644 index 0000000..c6d77f7 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_114.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_115.png b/releases/windows/resources/start_logo/washing_machine_black_115.png new file mode 100644 index 0000000..9a8bf2c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_115.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_116.png b/releases/windows/resources/start_logo/washing_machine_black_116.png new file mode 100644 index 0000000..8659492 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_116.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_117.png b/releases/windows/resources/start_logo/washing_machine_black_117.png new file mode 100644 index 0000000..d07cd58 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_117.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_118.png b/releases/windows/resources/start_logo/washing_machine_black_118.png new file mode 100644 index 0000000..1c43c4f Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_118.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_119.png b/releases/windows/resources/start_logo/washing_machine_black_119.png new file mode 100644 index 0000000..cb64d47 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_119.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_12.png b/releases/windows/resources/start_logo/washing_machine_black_12.png new file mode 100644 index 0000000..c506258 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_12.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_120.png b/releases/windows/resources/start_logo/washing_machine_black_120.png new file mode 100644 index 0000000..c60aa0c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_120.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_121.png b/releases/windows/resources/start_logo/washing_machine_black_121.png new file mode 100644 index 0000000..fd7fdd0 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_121.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_122.png b/releases/windows/resources/start_logo/washing_machine_black_122.png new file mode 100644 index 0000000..20b0e12 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_122.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_123.png b/releases/windows/resources/start_logo/washing_machine_black_123.png new file mode 100644 index 0000000..975f52c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_123.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_124.png b/releases/windows/resources/start_logo/washing_machine_black_124.png new file mode 100644 index 0000000..b6a86a7 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_124.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_125.png b/releases/windows/resources/start_logo/washing_machine_black_125.png new file mode 100644 index 0000000..d774743 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_125.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_126.png b/releases/windows/resources/start_logo/washing_machine_black_126.png new file mode 100644 index 0000000..ffcb85b Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_126.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_127.png b/releases/windows/resources/start_logo/washing_machine_black_127.png new file mode 100644 index 0000000..2b1a99e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_127.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_128.png b/releases/windows/resources/start_logo/washing_machine_black_128.png new file mode 100644 index 0000000..6c83a8f Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_128.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_129.png b/releases/windows/resources/start_logo/washing_machine_black_129.png new file mode 100644 index 0000000..2209d28 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_129.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_13.png b/releases/windows/resources/start_logo/washing_machine_black_13.png new file mode 100644 index 0000000..162b11b Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_13.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_130.png b/releases/windows/resources/start_logo/washing_machine_black_130.png new file mode 100644 index 0000000..36dbc07 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_130.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_131.png b/releases/windows/resources/start_logo/washing_machine_black_131.png new file mode 100644 index 0000000..e7ebbee Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_131.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_132.png b/releases/windows/resources/start_logo/washing_machine_black_132.png new file mode 100644 index 0000000..060482a Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_132.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_133.png b/releases/windows/resources/start_logo/washing_machine_black_133.png new file mode 100644 index 0000000..d5cee02 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_133.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_134.png b/releases/windows/resources/start_logo/washing_machine_black_134.png new file mode 100644 index 0000000..adafadb Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_134.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_135.png b/releases/windows/resources/start_logo/washing_machine_black_135.png new file mode 100644 index 0000000..967f7e3 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_135.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_136.png b/releases/windows/resources/start_logo/washing_machine_black_136.png new file mode 100644 index 0000000..6cefe31 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_136.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_137.png b/releases/windows/resources/start_logo/washing_machine_black_137.png new file mode 100644 index 0000000..9138979 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_137.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_138.png b/releases/windows/resources/start_logo/washing_machine_black_138.png new file mode 100644 index 0000000..394c7c8 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_138.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_14.png b/releases/windows/resources/start_logo/washing_machine_black_14.png new file mode 100644 index 0000000..bd1ce52 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_14.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_15.png b/releases/windows/resources/start_logo/washing_machine_black_15.png new file mode 100644 index 0000000..ec4879e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_15.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_16.png b/releases/windows/resources/start_logo/washing_machine_black_16.png new file mode 100644 index 0000000..c915a36 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_16.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_17.png b/releases/windows/resources/start_logo/washing_machine_black_17.png new file mode 100644 index 0000000..623b643 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_17.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_18.png b/releases/windows/resources/start_logo/washing_machine_black_18.png new file mode 100644 index 0000000..2d1d50d Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_18.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_19.png b/releases/windows/resources/start_logo/washing_machine_black_19.png new file mode 100644 index 0000000..562214b Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_19.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_2.png b/releases/windows/resources/start_logo/washing_machine_black_2.png new file mode 100644 index 0000000..38de1cb Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_2.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_20.png b/releases/windows/resources/start_logo/washing_machine_black_20.png new file mode 100644 index 0000000..298ea73 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_20.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_21.png b/releases/windows/resources/start_logo/washing_machine_black_21.png new file mode 100644 index 0000000..d348b02 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_21.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_22.png b/releases/windows/resources/start_logo/washing_machine_black_22.png new file mode 100644 index 0000000..5019c9f Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_22.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_23.png b/releases/windows/resources/start_logo/washing_machine_black_23.png new file mode 100644 index 0000000..9f1807c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_23.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_24.png b/releases/windows/resources/start_logo/washing_machine_black_24.png new file mode 100644 index 0000000..41c0ae1 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_24.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_25.png b/releases/windows/resources/start_logo/washing_machine_black_25.png new file mode 100644 index 0000000..cab49e8 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_25.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_26.png b/releases/windows/resources/start_logo/washing_machine_black_26.png new file mode 100644 index 0000000..d70d903 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_26.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_27.png b/releases/windows/resources/start_logo/washing_machine_black_27.png new file mode 100644 index 0000000..05bba81 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_27.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_28.png b/releases/windows/resources/start_logo/washing_machine_black_28.png new file mode 100644 index 0000000..8b59af5 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_28.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_29.png b/releases/windows/resources/start_logo/washing_machine_black_29.png new file mode 100644 index 0000000..51d5b4c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_29.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_3.png b/releases/windows/resources/start_logo/washing_machine_black_3.png new file mode 100644 index 0000000..4dd756f Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_3.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_30.png b/releases/windows/resources/start_logo/washing_machine_black_30.png new file mode 100644 index 0000000..bb881c8 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_30.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_31.png b/releases/windows/resources/start_logo/washing_machine_black_31.png new file mode 100644 index 0000000..b093c40 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_31.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_32.png b/releases/windows/resources/start_logo/washing_machine_black_32.png new file mode 100644 index 0000000..7935367 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_32.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_33.png b/releases/windows/resources/start_logo/washing_machine_black_33.png new file mode 100644 index 0000000..a523d37 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_33.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_34.png b/releases/windows/resources/start_logo/washing_machine_black_34.png new file mode 100644 index 0000000..7c1c54b Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_34.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_35.png b/releases/windows/resources/start_logo/washing_machine_black_35.png new file mode 100644 index 0000000..7daa2be Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_35.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_36.png b/releases/windows/resources/start_logo/washing_machine_black_36.png new file mode 100644 index 0000000..2348611 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_36.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_37.png b/releases/windows/resources/start_logo/washing_machine_black_37.png new file mode 100644 index 0000000..f67b2f0 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_37.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_38.png b/releases/windows/resources/start_logo/washing_machine_black_38.png new file mode 100644 index 0000000..067f1d2 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_38.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_39.png b/releases/windows/resources/start_logo/washing_machine_black_39.png new file mode 100644 index 0000000..e6df399 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_39.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_4.png b/releases/windows/resources/start_logo/washing_machine_black_4.png new file mode 100644 index 0000000..b1a8e67 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_4.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_40.png b/releases/windows/resources/start_logo/washing_machine_black_40.png new file mode 100644 index 0000000..5545731 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_40.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_41.png b/releases/windows/resources/start_logo/washing_machine_black_41.png new file mode 100644 index 0000000..a65b478 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_41.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_42.png b/releases/windows/resources/start_logo/washing_machine_black_42.png new file mode 100644 index 0000000..172a550 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_42.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_43.png b/releases/windows/resources/start_logo/washing_machine_black_43.png new file mode 100644 index 0000000..2165f19 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_43.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_44.png b/releases/windows/resources/start_logo/washing_machine_black_44.png new file mode 100644 index 0000000..7a8dd5a Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_44.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_45.png b/releases/windows/resources/start_logo/washing_machine_black_45.png new file mode 100644 index 0000000..57f21b2 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_45.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_46.png b/releases/windows/resources/start_logo/washing_machine_black_46.png new file mode 100644 index 0000000..efdb6fc Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_46.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_47.png b/releases/windows/resources/start_logo/washing_machine_black_47.png new file mode 100644 index 0000000..7b2da12 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_47.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_48.png b/releases/windows/resources/start_logo/washing_machine_black_48.png new file mode 100644 index 0000000..1043bc5 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_48.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_49.png b/releases/windows/resources/start_logo/washing_machine_black_49.png new file mode 100644 index 0000000..230d844 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_49.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_5.png b/releases/windows/resources/start_logo/washing_machine_black_5.png new file mode 100644 index 0000000..0a8b67e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_5.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_50.png b/releases/windows/resources/start_logo/washing_machine_black_50.png new file mode 100644 index 0000000..97b45d9 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_50.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_51.png b/releases/windows/resources/start_logo/washing_machine_black_51.png new file mode 100644 index 0000000..d317140 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_51.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_52.png b/releases/windows/resources/start_logo/washing_machine_black_52.png new file mode 100644 index 0000000..8a76ce3 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_52.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_53.png b/releases/windows/resources/start_logo/washing_machine_black_53.png new file mode 100644 index 0000000..998b1ae Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_53.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_54.png b/releases/windows/resources/start_logo/washing_machine_black_54.png new file mode 100644 index 0000000..49c0c4e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_54.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_55.png b/releases/windows/resources/start_logo/washing_machine_black_55.png new file mode 100644 index 0000000..5b78292 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_55.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_56.png b/releases/windows/resources/start_logo/washing_machine_black_56.png new file mode 100644 index 0000000..b22b2eb Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_56.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_57.png b/releases/windows/resources/start_logo/washing_machine_black_57.png new file mode 100644 index 0000000..9431080 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_57.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_58.png b/releases/windows/resources/start_logo/washing_machine_black_58.png new file mode 100644 index 0000000..2943246 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_58.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_59.png b/releases/windows/resources/start_logo/washing_machine_black_59.png new file mode 100644 index 0000000..78a7641 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_59.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_6.png b/releases/windows/resources/start_logo/washing_machine_black_6.png new file mode 100644 index 0000000..fc8b5ef Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_6.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_60.png b/releases/windows/resources/start_logo/washing_machine_black_60.png new file mode 100644 index 0000000..9659119 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_60.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_61.png b/releases/windows/resources/start_logo/washing_machine_black_61.png new file mode 100644 index 0000000..8b63f84 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_61.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_62.png b/releases/windows/resources/start_logo/washing_machine_black_62.png new file mode 100644 index 0000000..eac4247 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_62.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_63.png b/releases/windows/resources/start_logo/washing_machine_black_63.png new file mode 100644 index 0000000..349c0cd Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_63.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_64.png b/releases/windows/resources/start_logo/washing_machine_black_64.png new file mode 100644 index 0000000..95fc883 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_64.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_65.png b/releases/windows/resources/start_logo/washing_machine_black_65.png new file mode 100644 index 0000000..e96e1df Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_65.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_66.png b/releases/windows/resources/start_logo/washing_machine_black_66.png new file mode 100644 index 0000000..f341eba Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_66.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_67.png b/releases/windows/resources/start_logo/washing_machine_black_67.png new file mode 100644 index 0000000..0ee8a81 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_67.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_68.png b/releases/windows/resources/start_logo/washing_machine_black_68.png new file mode 100644 index 0000000..4cac5de Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_68.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_69.png b/releases/windows/resources/start_logo/washing_machine_black_69.png new file mode 100644 index 0000000..b93e202 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_69.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_7.png b/releases/windows/resources/start_logo/washing_machine_black_7.png new file mode 100644 index 0000000..b119aa5 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_7.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_70.png b/releases/windows/resources/start_logo/washing_machine_black_70.png new file mode 100644 index 0000000..6bcc367 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_70.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_71.png b/releases/windows/resources/start_logo/washing_machine_black_71.png new file mode 100644 index 0000000..4abf2f8 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_71.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_72.png b/releases/windows/resources/start_logo/washing_machine_black_72.png new file mode 100644 index 0000000..f58fbfa Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_72.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_73.png b/releases/windows/resources/start_logo/washing_machine_black_73.png new file mode 100644 index 0000000..4db66e7 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_73.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_74.png b/releases/windows/resources/start_logo/washing_machine_black_74.png new file mode 100644 index 0000000..28b07c3 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_74.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_75.png b/releases/windows/resources/start_logo/washing_machine_black_75.png new file mode 100644 index 0000000..a59ca5a Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_75.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_76.png b/releases/windows/resources/start_logo/washing_machine_black_76.png new file mode 100644 index 0000000..c36a610 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_76.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_77.png b/releases/windows/resources/start_logo/washing_machine_black_77.png new file mode 100644 index 0000000..f92cabc Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_77.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_78.png b/releases/windows/resources/start_logo/washing_machine_black_78.png new file mode 100644 index 0000000..5b30de7 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_78.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_79.png b/releases/windows/resources/start_logo/washing_machine_black_79.png new file mode 100644 index 0000000..af0a23c Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_79.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_8.png b/releases/windows/resources/start_logo/washing_machine_black_8.png new file mode 100644 index 0000000..bedaccc Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_8.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_80.png b/releases/windows/resources/start_logo/washing_machine_black_80.png new file mode 100644 index 0000000..c4581f5 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_80.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_81.png b/releases/windows/resources/start_logo/washing_machine_black_81.png new file mode 100644 index 0000000..d95b15e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_81.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_82.png b/releases/windows/resources/start_logo/washing_machine_black_82.png new file mode 100644 index 0000000..4516a26 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_82.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_83.png b/releases/windows/resources/start_logo/washing_machine_black_83.png new file mode 100644 index 0000000..1feb6d8 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_83.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_84.png b/releases/windows/resources/start_logo/washing_machine_black_84.png new file mode 100644 index 0000000..95da664 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_84.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_85.png b/releases/windows/resources/start_logo/washing_machine_black_85.png new file mode 100644 index 0000000..3fc37e5 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_85.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_86.png b/releases/windows/resources/start_logo/washing_machine_black_86.png new file mode 100644 index 0000000..a23f834 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_86.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_87.png b/releases/windows/resources/start_logo/washing_machine_black_87.png new file mode 100644 index 0000000..eb97e86 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_87.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_88.png b/releases/windows/resources/start_logo/washing_machine_black_88.png new file mode 100644 index 0000000..4d80c15 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_88.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_89.png b/releases/windows/resources/start_logo/washing_machine_black_89.png new file mode 100644 index 0000000..32f96af Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_89.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_9.png b/releases/windows/resources/start_logo/washing_machine_black_9.png new file mode 100644 index 0000000..9e5d5b4 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_9.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_90.png b/releases/windows/resources/start_logo/washing_machine_black_90.png new file mode 100644 index 0000000..3c8a74e Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_90.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_91.png b/releases/windows/resources/start_logo/washing_machine_black_91.png new file mode 100644 index 0000000..8de3b44 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_91.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_92.png b/releases/windows/resources/start_logo/washing_machine_black_92.png new file mode 100644 index 0000000..623c7eb Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_92.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_93.png b/releases/windows/resources/start_logo/washing_machine_black_93.png new file mode 100644 index 0000000..1210982 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_93.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_94.png b/releases/windows/resources/start_logo/washing_machine_black_94.png new file mode 100644 index 0000000..81693d7 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_94.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_95.png b/releases/windows/resources/start_logo/washing_machine_black_95.png new file mode 100644 index 0000000..f540594 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_95.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_96.png b/releases/windows/resources/start_logo/washing_machine_black_96.png new file mode 100644 index 0000000..5badd50 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_96.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_97.png b/releases/windows/resources/start_logo/washing_machine_black_97.png new file mode 100644 index 0000000..f4c271a Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_97.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_98.png b/releases/windows/resources/start_logo/washing_machine_black_98.png new file mode 100644 index 0000000..c8967d3 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_98.png differ diff --git a/releases/windows/resources/start_logo/washing_machine_black_99.png b/releases/windows/resources/start_logo/washing_machine_black_99.png new file mode 100644 index 0000000..9b6df95 Binary files /dev/null and b/releases/windows/resources/start_logo/washing_machine_black_99.png differ diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..aca6085 --- /dev/null +++ b/requirements.txt @@ -0,0 +1,6 @@ +pytest +pytest-cov +pylint +pylint-report +Pillow +kivy==2.1.0 diff --git a/resources/.gitignore b/resources/.gitignore new file mode 100644 index 0000000..d24b664 --- /dev/null +++ b/resources/.gitignore @@ -0,0 +1 @@ +#Files to ignore in resources folder. diff --git a/resources/atlas/ghost_textures.atlas b/resources/atlas/ghost_textures.atlas new file mode 100644 index 0000000..173624b --- /dev/null +++ b/resources/atlas/ghost_textures.atlas @@ -0,0 +1,52 @@ +{ + "ghost_textures.png": { + "back": [ + 0, + 200, + 100, + 100 + ], + "front": [ + 100, + 200, + 100, + 100 + ], + "left_back": [ + 200, + 200, + 100, + 100 + ], + "right_front": [ + 0, + 100, + 100, + 100 + ], + "right_back": [ + 100, + 100, + 100, + 100 + ], + "right": [ + 200, + 100, + 100, + 100 + ], + "left": [ + 0, + 0, + 100, + 100 + ], + "left_front": [ + 100, + 0, + 100, + 100 + ] + } +} \ No newline at end of file diff --git a/resources/atlas/ghost_textures.png b/resources/atlas/ghost_textures.png new file mode 100644 index 0000000..dce0e83 Binary files /dev/null and b/resources/atlas/ghost_textures.png differ diff --git a/resources/atlas/map_textures.atlas b/resources/atlas/map_textures.atlas new file mode 100644 index 0000000..69d67d1 --- /dev/null +++ b/resources/atlas/map_textures.atlas @@ -0,0 +1,172 @@ +{ + "map_textures.png": { + "Malachite": [ + 0, + 500, + 100, + 100 + ], + "Amethyst": [ + 100, + 500, + 100, + 100 + ], + "rock1": [ + 200, + 500, + 100, + 100 + ], + "Diamond": [ + 300, + 500, + 100, + 100 + ], + "Lapis lazuli": [ + 400, + 500, + 100, + 100 + ], + "Obsidian": [ + 500, + 500, + 100, + 100 + ], + "Onyx": [ + 0, + 400, + 100, + 100 + ], + "beacon_off": [ + 100, + 400, + 100, + 100 + ], + "Tiger eye": [ + 200, + 400, + 100, + 100 + ], + "rock3": [ + 300, + 400, + 100, + 100 + ], + "rock2": [ + 400, + 400, + 100, + 100 + ], + "Fluorine": [ + 500, + 400, + 100, + 100 + ], + "Sapphire": [ + 0, + 300, + 100, + 100 + ], + "ground": [ + 100, + 300, + 100, + 100 + ], + "Azurite": [ + 200, + 300, + 100, + 100 + ], + "Turquoise": [ + 300, + 300, + 100, + 100 + ], + "Opal": [ + 400, + 300, + 100, + 100 + ], + "beacon": [ + 500, + 300, + 100, + 100 + ], + "Agate": [ + 0, + 200, + 100, + 100 + ], + "Jade": [ + 100, + 200, + 100, + 100 + ], + "Amber": [ + 200, + 200, + 100, + 100 + ], + "crystal": [ + 300, + 200, + 100, + 100 + ], + "Emerald": [ + 400, + 200, + 100, + 100 + ], + "Ruby": [ + 500, + 200, + 100, + 100 + ], + "Rose quartz": [ + 0, + 100, + 100, + 100 + ], + "Citrine": [ + 100, + 100, + 100, + 100 + ], + "Aventurine": [ + 200, + 100, + 100, + 100 + ], + "Garnet": [ + 300, + 100, + 100, + 100 + ] + } +} \ No newline at end of file diff --git a/resources/atlas/map_textures.png b/resources/atlas/map_textures.png new file mode 100644 index 0000000..5f8f959 Binary files /dev/null and b/resources/atlas/map_textures.png differ diff --git a/resources/fonts/enchanted_land/Enchanted Land II.png b/resources/fonts/enchanted_land/Enchanted Land II.png new file mode 100644 index 0000000..eb0773a Binary files /dev/null and b/resources/fonts/enchanted_land/Enchanted Land II.png differ diff --git a/resources/fonts/enchanted_land/Enchanted Land.otf b/resources/fonts/enchanted_land/Enchanted Land.otf new file mode 100644 index 0000000..9c80d8a Binary files /dev/null and b/resources/fonts/enchanted_land/Enchanted Land.otf differ diff --git a/resources/fonts/enchanted_land/readme.txt b/resources/fonts/enchanted_land/readme.txt new file mode 100644 index 0000000..67e06a0 --- /dev/null +++ b/resources/fonts/enchanted_land/readme.txt @@ -0,0 +1,19 @@ +OTF and TTF: Enchanted Land +Dennis Ludlow 2016 all rights reserved +by Sharkshock +dennis@sharkshock.net + + +Welcome to the Enchanted Land where fun has no age limit! This display font borrows obvious inspiration from the classic signage used by the famous west coast amusement park. There are several others floating out there but this one features a clean glyph set with many European characters +and diacritic support for extended latin. The whimsical style of the caps flow with consistency and shows up in the numbers and many other marks as well. OTF features like kerning, ordinals, fractions, ligatures, alternates, and proportional numbers and punctuation for uppercase characters are +all included. All caps are NOT recommended. Use Enchanted Land for a children's project, book title, or anywhere you'd like a little magic. + + +This font like my others are free for personal use only as long as this readme file stays intact. For commercial use please contact me at dennis@sharkshock.net to discuss an end user license agreement. You can also visit www.sharkshock.net/license for more info. I also design custom fonts for +businesses, logos, and many other things. If you'd like to leave me a PayPal donation you can use my email address above. Your generosity will be most appreciated! + +tags: book, children, kids, script, amusement, park, fun, magic, serif, magical, publishing, display, font, typeface, fancy, whimsical, fantasy, enchanting, kid, rides, vacation, characters, Disney, land, logo + + +visit www.sharkshock.net for more and take a bite out of BORING design! + diff --git a/resources/images/back_arrow.png b/resources/images/back_arrow.png new file mode 100644 index 0000000..431fa66 Binary files /dev/null and b/resources/images/back_arrow.png differ diff --git a/resources/images/blank.png b/resources/images/blank.png new file mode 100644 index 0000000..109cec1 Binary files /dev/null and b/resources/images/blank.png differ diff --git a/resources/images/collection_background.png b/resources/images/collection_background.png new file mode 100644 index 0000000..9e67b79 Binary files /dev/null and b/resources/images/collection_background.png differ diff --git a/resources/images/collection_logo.png b/resources/images/collection_logo.png new file mode 100644 index 0000000..d195bc7 Binary files /dev/null and b/resources/images/collection_logo.png differ diff --git a/resources/images/game_over_background.png b/resources/images/game_over_background.png new file mode 100644 index 0000000..e818a3e Binary files /dev/null and b/resources/images/game_over_background.png differ diff --git a/resources/images/ghost_textures/back.png b/resources/images/ghost_textures/back.png new file mode 100644 index 0000000..64b7775 Binary files /dev/null and b/resources/images/ghost_textures/back.png differ diff --git a/resources/images/ghost_textures/front.png b/resources/images/ghost_textures/front.png new file mode 100644 index 0000000..d5ae6cc Binary files /dev/null and b/resources/images/ghost_textures/front.png differ diff --git a/resources/images/ghost_textures/left.png b/resources/images/ghost_textures/left.png new file mode 100644 index 0000000..2742cd3 Binary files /dev/null and b/resources/images/ghost_textures/left.png differ diff --git a/resources/images/ghost_textures/left_back.png b/resources/images/ghost_textures/left_back.png new file mode 100644 index 0000000..ddb5c09 Binary files /dev/null and b/resources/images/ghost_textures/left_back.png differ diff --git a/resources/images/ghost_textures/left_front.png b/resources/images/ghost_textures/left_front.png new file mode 100644 index 0000000..914adcc Binary files /dev/null and b/resources/images/ghost_textures/left_front.png differ diff --git a/resources/images/ghost_textures/right.png b/resources/images/ghost_textures/right.png new file mode 100644 index 0000000..ab911f4 Binary files /dev/null and b/resources/images/ghost_textures/right.png differ diff --git a/resources/images/ghost_textures/right_back.png b/resources/images/ghost_textures/right_back.png new file mode 100644 index 0000000..8426a37 Binary files /dev/null and b/resources/images/ghost_textures/right_back.png differ diff --git a/resources/images/ghost_textures/right_front.png b/resources/images/ghost_textures/right_front.png new file mode 100644 index 0000000..64717e7 Binary files /dev/null and b/resources/images/ghost_textures/right_front.png differ diff --git a/resources/images/icon.ico b/resources/images/icon.ico new file mode 100644 index 0000000..e78469d Binary files /dev/null and b/resources/images/icon.ico differ diff --git a/resources/images/logo.png b/resources/images/logo.png new file mode 100644 index 0000000..b0f3924 Binary files /dev/null and b/resources/images/logo.png differ diff --git a/resources/images/map_textures/Agate.png b/resources/images/map_textures/Agate.png new file mode 100644 index 0000000..e534e18 Binary files /dev/null and b/resources/images/map_textures/Agate.png differ diff --git a/resources/images/map_textures/Amber.png b/resources/images/map_textures/Amber.png new file mode 100644 index 0000000..a84806a Binary files /dev/null and b/resources/images/map_textures/Amber.png differ diff --git a/resources/images/map_textures/Amethyst.png b/resources/images/map_textures/Amethyst.png new file mode 100644 index 0000000..c50860a Binary files /dev/null and b/resources/images/map_textures/Amethyst.png differ diff --git a/resources/images/map_textures/Aventurine.png b/resources/images/map_textures/Aventurine.png new file mode 100644 index 0000000..f9a989e Binary files /dev/null and b/resources/images/map_textures/Aventurine.png differ diff --git a/resources/images/map_textures/Azurite.png b/resources/images/map_textures/Azurite.png new file mode 100644 index 0000000..33e79dc Binary files /dev/null and b/resources/images/map_textures/Azurite.png differ diff --git a/resources/images/map_textures/Citrine.png b/resources/images/map_textures/Citrine.png new file mode 100644 index 0000000..10efe53 Binary files /dev/null and b/resources/images/map_textures/Citrine.png differ diff --git a/resources/images/map_textures/Diamond.png b/resources/images/map_textures/Diamond.png new file mode 100644 index 0000000..15120f8 Binary files /dev/null and b/resources/images/map_textures/Diamond.png differ diff --git a/resources/images/map_textures/Emerald.png b/resources/images/map_textures/Emerald.png new file mode 100644 index 0000000..34dd252 Binary files /dev/null and b/resources/images/map_textures/Emerald.png differ diff --git a/resources/images/map_textures/Fluorine.png b/resources/images/map_textures/Fluorine.png new file mode 100644 index 0000000..fabcfce Binary files /dev/null and b/resources/images/map_textures/Fluorine.png differ diff --git a/resources/images/map_textures/Garnet.png b/resources/images/map_textures/Garnet.png new file mode 100644 index 0000000..d025979 Binary files /dev/null and b/resources/images/map_textures/Garnet.png differ diff --git a/resources/images/map_textures/Jade.png b/resources/images/map_textures/Jade.png new file mode 100644 index 0000000..81c0785 Binary files /dev/null and b/resources/images/map_textures/Jade.png differ diff --git a/resources/images/map_textures/Lapis lazuli.png b/resources/images/map_textures/Lapis lazuli.png new file mode 100644 index 0000000..b40455b Binary files /dev/null and b/resources/images/map_textures/Lapis lazuli.png differ diff --git a/resources/images/map_textures/Malachite.png b/resources/images/map_textures/Malachite.png new file mode 100644 index 0000000..9ecbcd0 Binary files /dev/null and b/resources/images/map_textures/Malachite.png differ diff --git a/resources/images/map_textures/Obsidian.png b/resources/images/map_textures/Obsidian.png new file mode 100644 index 0000000..43db7f3 Binary files /dev/null and b/resources/images/map_textures/Obsidian.png differ diff --git a/resources/images/map_textures/Onyx.png b/resources/images/map_textures/Onyx.png new file mode 100644 index 0000000..dc9f64a Binary files /dev/null and b/resources/images/map_textures/Onyx.png differ diff --git a/resources/images/map_textures/Opal.png b/resources/images/map_textures/Opal.png new file mode 100644 index 0000000..966a04e Binary files /dev/null and b/resources/images/map_textures/Opal.png differ diff --git a/resources/images/map_textures/Rose quartz.png b/resources/images/map_textures/Rose quartz.png new file mode 100644 index 0000000..fc9dfe9 Binary files /dev/null and b/resources/images/map_textures/Rose quartz.png differ diff --git a/resources/images/map_textures/Ruby.png b/resources/images/map_textures/Ruby.png new file mode 100644 index 0000000..88313ce Binary files /dev/null and b/resources/images/map_textures/Ruby.png differ diff --git a/resources/images/map_textures/Sapphire.png b/resources/images/map_textures/Sapphire.png new file mode 100644 index 0000000..1a863e2 Binary files /dev/null and b/resources/images/map_textures/Sapphire.png differ diff --git a/resources/images/map_textures/Tiger eye.png b/resources/images/map_textures/Tiger eye.png new file mode 100644 index 0000000..5cf82d5 Binary files /dev/null and b/resources/images/map_textures/Tiger eye.png differ diff --git a/resources/images/map_textures/Turquoise.png b/resources/images/map_textures/Turquoise.png new file mode 100644 index 0000000..f686c0d Binary files /dev/null and b/resources/images/map_textures/Turquoise.png differ diff --git a/resources/images/map_textures/beacon.png b/resources/images/map_textures/beacon.png new file mode 100644 index 0000000..09204c9 Binary files /dev/null and b/resources/images/map_textures/beacon.png differ diff --git a/resources/images/map_textures/beacon_off.png b/resources/images/map_textures/beacon_off.png new file mode 100644 index 0000000..c8a1001 Binary files /dev/null and b/resources/images/map_textures/beacon_off.png differ diff --git a/resources/images/map_textures/crystal.png b/resources/images/map_textures/crystal.png new file mode 100644 index 0000000..9107f12 Binary files /dev/null and b/resources/images/map_textures/crystal.png differ diff --git a/resources/images/map_textures/ground.png b/resources/images/map_textures/ground.png new file mode 100644 index 0000000..40de289 Binary files /dev/null and b/resources/images/map_textures/ground.png differ diff --git a/resources/images/map_textures/rock1.png b/resources/images/map_textures/rock1.png new file mode 100644 index 0000000..db206be Binary files /dev/null and b/resources/images/map_textures/rock1.png differ diff --git a/resources/images/map_textures/rock2.png b/resources/images/map_textures/rock2.png new file mode 100644 index 0000000..44635f6 Binary files /dev/null and b/resources/images/map_textures/rock2.png differ diff --git a/resources/images/map_textures/rock3.png b/resources/images/map_textures/rock3.png new file mode 100644 index 0000000..d7da180 Binary files /dev/null and b/resources/images/map_textures/rock3.png differ diff --git a/resources/images/menu_background.png b/resources/images/menu_background.png new file mode 100644 index 0000000..a672606 Binary files /dev/null and b/resources/images/menu_background.png differ diff --git a/resources/images/settings_background.png b/resources/images/settings_background.png new file mode 100644 index 0000000..f0dedb3 Binary files /dev/null and b/resources/images/settings_background.png differ diff --git a/resources/images/settings_logo.png b/resources/images/settings_logo.png new file mode 100644 index 0000000..ee3ee06 Binary files /dev/null and b/resources/images/settings_logo.png differ diff --git a/resources/images/splashscreen.png b/resources/images/splashscreen.png new file mode 100644 index 0000000..2a2eca6 Binary files /dev/null and b/resources/images/splashscreen.png differ diff --git a/resources/kivy/collection.kv b/resources/kivy/collection.kv new file mode 100644 index 0000000..bebae91 --- /dev/null +++ b/resources/kivy/collection.kv @@ -0,0 +1,52 @@ +#:kivy 2.1.0 +: + + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Image: + source: root.path_images + "back_arrow.png" + size_hint: None, 0.1 + pos_hint: {"x":0.025, "top": 0.975} + allow_stretch: True + width: self.height + Button: + size_hint: None, 0.1 + width: self.height + pos_hint: {"x":0.025, "top": 0.975} + background_color: (0, 0, 0, 0) + on_release: + root.manager.init_screen("menu") + + Label: + text: root.counter_precious_stones + bold: True + color: root.manager.color_label + pos_hint: {"right":1, "top":1} + size_hint: 0.1, 0.1 + font_name: root.font + font_size: 30*root.font_ratio + + RelativeLayout: + size_hint: 1, 0.9 + pos_hint: {"x":0, "y":0} + ScrollView: + id: scroll_view + do_scroll_x: False + do_scroll_y: True + bar_width: 0 + + MyScrollViewLayout: + id: my_sv_layout + cols: root.number_cols + spacing: root.spacing + padding: root.padding + height: self.minimum_height+root.label_height + pos: root.pos diff --git a/resources/kivy/extended_style.kv b/resources/kivy/extended_style.kv new file mode 100644 index 0000000..0568c6b --- /dev/null +++ b/resources/kivy/extended_style.kv @@ -0,0 +1,299 @@ +#:kivy 1.0 + + +######################## +### Colors variables ### +######################## + + +#:set pink_color (229 / 255, 19 / 255, 100 / 255, 1) +#:set blue_color (70 / 255, 130 / 255, 180 / 255, 1) +#:set gray_color (100 / 255, 100 / 255, 100 / 255, 1) +#:set highlight_text_color (229 / 255, 19 / 255, 100 / 255, 0.5) +#:set black_color (0, 0, 0, 1) + + +############### +### Buttons ### +############### + + +<-Button,-ToggleButton>: + + # Blue + background_normal: 'atlas://resources/kivy/images/defaulttheme/button_blue' + # Light pink + background_pressed: 'atlas://resources/kivy/images/defaulttheme/button_pink_pressed' + # Gray + background_disabled: 'atlas://resources/kivy/images/defaulttheme/button_gray_disabled' + # Pink + background_focus: 'atlas://resources/kivy/images/defaulttheme/button_pink' + state_image: (self.background_normal if self.state == 'normal' else self.background_focus) if self.state == 'normal' else self.background_focus + disabled_image: self.background_disabled + bold: True + canvas: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: self.disabled_image if self.disabled else self.state_image + Color: + rgba: 1, 1, 1, 1 + Rectangle: + texture: self.texture + size: self.texture_size + pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.) + + +<-FocusableButton>: + + # Blue + background_normal: 'atlas://resources/kivy/images/defaulttheme/button_blue' + # Light pink + background_pressed: 'atlas://resources/kivy/images/defaulttheme/button_pink_pressed' + # Gray + background_disabled: 'atlas://resources/kivy/images/defaulttheme/button_gray_disabled' + # Pink + background_focus: 'atlas://resources/kivy/images/defaulttheme/button_pink' + state_image: (self.background_focus if self.focus else self.background_normal) if self.state == 'normal' else self.background_pressed + disabled_image: self.background_disabled + bold: True + canvas: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: self.disabled_image if self.disabled else self.state_image + Color: + rgba: 1, 1, 1, 1 + Rectangle: + texture: self.texture + size: self.texture_size + pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.) + + +################## +### Text Input ### +################## + + +: + canvas.before: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: 'atlas://resources/kivy/images/defaulttheme/textinput_active' if self.focus else ('atlas://resources/kivy/images/defaulttheme/textinput_disabled_active' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/textinput') + Color: + rgba: + ((156/255,0,60/255,1) + if self.focus and not self._cursor_blink + and int(self.x + self.padding[0]) <= self._cursor_visual_pos[0] <= int(self.x + self.width - self.padding[2]) + else (0, 0, 0, 0)) + Rectangle: + pos: self._cursor_visual_pos + size: root.cursor_width, -self._cursor_visual_height + Color: + rgba: self.disabled_foreground_color if self.disabled else (self.hint_text_color if not self.text else self.foreground_color) + +: + color: pink_color + allow_stretch: True + +: + color_mode: "custom" + mode: "rectangle" + line_color_focus: pink_color + line_color_normal: blue_color if not self.disabled else gray_color + normal_color: blue_color + color_active: pink_color + disabled_color: gray_color + text_color_focus: black_color + text_color_normal: blue_color + hint_text_color_normal: pink_color + hint_text_color_focus: blue_color + selection_color: highlight_text_color + + +############### +### Spinner ### +############### + + +: + background_normal: 'atlas://resources/kivy/images/defaulttheme/spinner' + background_disabled: 'atlas://resources/kivy/images/defaulttheme/spinner_disabled' + background_focus: 'atlas://resources/kivy/images/defaulttheme/spinner_pressed' + state_image: self.background_focus if self.focus else self.background_normal + disabled_image: self.background_disabled + bold: True + canvas: + Color: + rgba: self.background_color + BorderImage: + border: self.border + pos: self.pos + size: self.size + source: self.disabled_image if self.disabled else self.state_image + Color: + rgba: 1, 1, 1, 1 + Rectangle: + texture: self.texture + size: self.texture_size + pos: int(self.center_x - self.texture_size[0] / 2.), int(self.center_y - self.texture_size[1] / 2.) + +: + background_normal: 'atlas://resources/kivy/images/defaulttheme/spinner' + background_disabled_normal: 'atlas://resources/kivy/images/defaulttheme/spinner_disabled' + background_down: 'atlas://resources/kivy/images/defaulttheme/spinner_pressed' + + +############## +### Slider ### +############## + + +: + canvas: + Color: + rgb: 1, 1, 1 + BorderImage: + border: self.border_horizontal if self.orientation == 'horizontal' else self.border_vertical + pos: (self.x + self.padding, self.center_y - self.background_width / 2) if self.orientation == 'horizontal' else (self.center_x - self.background_width / 2, self.y + self.padding) + size: (self.width - self.padding * 2, self.background_width) if self.orientation == 'horizontal' else (self.background_width, self.height - self.padding * 2) + source: ('atlas://resources/kivy/images/defaulttheme/sliderh_background_disabled' if self.orientation == 'horizontal' else 'atlas://resources/kivy/images/defaulttheme/sliderv_background_disabled') if self.disabled else ('atlas://resources/kivy/images/defaulttheme/sliderh_background' if self.orientation == 'horizontal' else 'atlas://resources/kivy/images/defaulttheme/sliderv_background') + Color: + rgba: root.value_track_color if self.value_track and self.orientation == 'horizontal' else [1, 1, 1, 0] + Line: + width: self.value_track_width + points: self.x + self.padding, self.center_y, self.value_pos[0], self.center_y + Color: + rgba: root.value_track_color if self.value_track and self.orientation == 'vertical' else [1, 1, 1, 0] + Line: + width: self.value_track_width + points: self.center_x, self.y + self.padding, self.center_x, self.value_pos[1] + Color: + rgb: 1, 1, 1 + Image: + pos: (root.value_pos[0] - root.cursor_width / 2, root.center_y - root.cursor_height / 2) if root.orientation == 'horizontal' else (root.center_x - root.cursor_width / 2, root.value_pos[1] - root.cursor_height / 2) + size: root.cursor_size + source: 'atlas://resources/kivy/images/defaulttheme/slider_cursor_disabled' if root.disabled else 'atlas://resources/kivy/images/defaulttheme/slider_cursor' + allow_stretch: True + keep_ratio: False + + +#################### +### Progress bar ### +#################### + + +: + canvas: + Color: + rgb: 1, 1, 1 + BorderImage: + border: (12, 12, 12, 12) + pos: self.x, self.center_y - 12 + size: self.width, 24 + source: 'atlas://resources/kivy/images/defaulttheme/progressbar_background' + BorderImage: + border: [int(min(self.width * (self.value / float(self.max)) if self.max else 0, 12))] * 4 + pos: self.x, self.center_y - 12 + size: self.width * (self.value / float(self.max)) if self.max else 0, 24 + source: 'atlas://resources/kivy/images/defaulttheme/progressbar' + + +############## +### Switch ### +############## + + +: + active_norm_pos: max(0., min(1., (int(self.active) + self.touch_distance / sp(41)))) + canvas: + Color: + rgb: 1, 1, 1 + Rectangle: + source: 'atlas://resources/kivy/images/defaulttheme/switch-background{}'.format('_disabled' if self.disabled else '') + size: sp(83), sp(32) + pos: int(self.center_x - sp(41)), int(self.center_y - sp(16)) + canvas.after: + Color: + rgb: 1, 1, 1 + Rectangle: + source: 'atlas://resources/kivy/images/defaulttheme/switch-button{}'.format('_disabled' if self.disabled else '') + size: sp(43), sp(32) + pos: int(self.center_x - sp(41) + self.active_norm_pos * sp(41)), int(self.center_y - sp(16)) + + +################ +### Checkbox ### +################ + + +: + canvas: + Color: + rgba: self.color + Rectangle: + source: (('atlas://resources/kivy/images/defaulttheme/checkbox_radio_focus_on' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_disabled_on' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_on') if self.active else ('atlas://resources/kivy/images/defaulttheme/checkbox_radio_focus_off' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_disabled_off' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_radio_off')) if self.group else (('atlas://resources/kivy/images/defaulttheme/checkbox_focus_on' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_disabled_on' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_on') if self.active else ('atlas://resources/kivy/images/defaulttheme/checkbox_focus_off' if self.focus else 'atlas://resources/kivy/images/defaulttheme/checkbox_disabled_off' if self.disabled else 'atlas://resources/kivy/images/defaulttheme/checkbox_off')) + size: sp(32), sp(32) + pos: int(self.center_x - sp(16)), int(self.center_y - sp(16)) + +: + pos_hint: root.pos_hint + FocusableCheckBox: + id: checkbox + pos_hint: {"x":0, "y":0} + size_hint: root.size_hint_cb + group: root.group + disabled: root.disabled_cb + on_active: + root.function_cb + Label: + text: root.text_label + color: root.color_label + size_hint: root.size_hint_label + pos_hint: {"x":0.1, "y":0} + text_size: self.size + halign: "left" + valign: "center" + +############# +### Popup ### +############# + + +: + size: root.size_popup + pos_hint: {"x":0, "y":0} + + Widget: + canvas: + Color: + rgba: root.blue_color + Rectangle: + pos: root.x, root.top + size: self.width, dp(3) + + +############### +### Tooltip ### +############### + + +: + size_hint: None, None + size: self.texture_size[0]+5, self.texture_size[1]+5 + canvas.before: + Color: + rgb: 0.2, 0.2, 0.2 + Rectangle: + size: self.size + pos: self.pos diff --git a/resources/kivy/game_over.kv b/resources/kivy/game_over.kv new file mode 100644 index 0000000..29fd209 --- /dev/null +++ b/resources/kivy/game_over.kv @@ -0,0 +1,53 @@ +#:kivy 2.1.0 + +: + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Label: + id: title_label + text: "Game Over" + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.5, "center_y": 0.9} + font_size: 50*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: credit_label + text: "Game created by :\n - Agathe\n - Paul" + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.2, "center_y": 0.5} + font_size: 40*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: score_label + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.8, "center_y": 0.5} + font_size: 40*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: back_to_menu + text: "Back to main menu" + font_name: root.font + font_size: 40*root.font_ratio + color: root.manager.color_label + pos_hint: {"center_x":0.5, "center_y": 0.15} + size_hint: 0.2, 0.1 + Button: + size_hint: 0.2, 0.1 + pos_hint: {"center_x":0.5, "center_y": 0.15} + background_color: (0, 0, 0, 0) + on_release: + root.manager.init_screen("menu") diff --git a/resources/kivy/images/close_button.png b/resources/kivy/images/close_button.png new file mode 100644 index 0000000..9177796 Binary files /dev/null and b/resources/kivy/images/close_button.png differ diff --git a/resources/kivy/images/defaulttheme.atlas b/resources/kivy/images/defaulttheme.atlas new file mode 100644 index 0000000..a2cdc0a --- /dev/null +++ b/resources/kivy/images/defaulttheme.atlas @@ -0,0 +1 @@ +{"defaulttheme.png": {"progressbar_background": [392, 227, 24, 24], "tab_btn_disabled": [332, 137, 32, 32], "tab_btn_pressed": [400, 137, 32, 32], "image-missing": [152, 171, 48, 48], "splitter_h": [174, 123, 32, 7], "splitter_down": [11, 10, 7, 32], "splitter_disabled_down": [2, 10, 7, 32], "vkeyboard_key_down": [2, 44, 32, 32], "vkeyboard_disabled_key_down": [434, 137, 32, 32], "selector_right": [438, 326, 64, 64], "player-background": [2, 287, 103, 103], "selector_middle": [372, 326, 64, 64], "spinner": [204, 82, 29, 37], "tab_btn_disabled_pressed": [366, 137, 32, 32], "switch-button_disabled": [375, 291, 43, 32], "textinput_disabled_active": [134, 221, 64, 64], "splitter_grip": [70, 50, 12, 26], "vkeyboard_key_normal": [36, 44, 32, 32], "button_disabled": [111, 82, 29, 37], "media-playback-stop": [302, 171, 48, 48], "splitter": [502, 137, 7, 32], "splitter_down_h": [140, 123, 32, 7], "sliderh_background_disabled": [115, 132, 41, 37], "modalview-background": [464, 456, 45, 54], "button": [80, 82, 29, 37], "splitter_disabled": [501, 87, 7, 32], "checkbox_radio_focus_on": [467, 87, 32, 32], "slider_cursor": [352, 171, 48, 48], "vkeyboard_disabled_background": [266, 221, 64, 64], "checkbox_focus_on": [331, 87, 32, 32], "sliderv_background_disabled": [41, 78, 37, 41], "button_disabled_pressed": [142, 82, 29, 37], "audio-volume-muted": [102, 171, 48, 48], "close": [487, 173, 20, 20], "action_group_disabled": [2, 121, 33, 48], "vkeyboard_background": [200, 221, 64, 64], "checkbox_off": [365, 87, 32, 32], "tab_disabled": [107, 291, 96, 32], "sliderh_background": [72, 132, 41, 37], "switch-button": [430, 253, 43, 32], "tree_closed": [418, 231, 20, 20], "bubble_btn_pressed": [454, 291, 32, 32], "selector_left": [306, 326, 64, 64], "filechooser_file": [174, 326, 64, 64], "checkbox_radio_focus_off": [433, 87, 32, 32], "checkbox_radio_on": [230, 137, 32, 32], "checkbox_on": [399, 87, 32, 32], "button_pressed": [173, 82, 29, 37], "audio-volume-high": [464, 406, 48, 48], "audio-volume-low": [2, 171, 48, 48], "progressbar": [332, 227, 32, 24], "previous_normal": [488, 291, 19, 32], "separator": [504, 342, 5, 48], "filechooser_folder": [240, 326, 64, 64], "checkbox_radio_off": [196, 137, 32, 32], "textinput_active": [68, 221, 64, 64], "textinput": [2, 221, 64, 64], "player-play-overlay": [122, 395, 117, 115], "media-playback-pause": [202, 171, 48, 48], "sliderv_background": [2, 78, 37, 41], "ring": [354, 402, 108, 108], "bubble_arrow": [490, 241, 16, 10], "slider_cursor_disabled": [402, 171, 48, 48], "checkbox_focus_off": [297, 87, 32, 32], "action_group_down": [37, 121, 33, 48], "spinner_disabled": [235, 82, 29, 37], "splitter_disabled_h": [106, 123, 32, 7], "bubble": [107, 325, 65, 65], "media-playback-start": [252, 171, 48, 48], "vkeyboard_disabled_key_normal": [468, 137, 32, 32], "overflow": [264, 137, 32, 32], "tree_opened": [440, 231, 20, 20], "action_item": [487, 195, 24, 24], "bubble_btn": [420, 291, 32, 32], "audio-volume-medium": [52, 171, 48, 48], "action_group": [452, 171, 33, 48], "spinner_pressed": [266, 82, 29, 37], "filechooser_selected": [2, 392, 118, 118], "tab": [332, 253, 96, 32], "action_bar": [158, 133, 36, 36], "action_view": [366, 227, 24, 24], "tab_btn": [298, 137, 32, 32], "switch-background": [205, 291, 83, 32], "splitter_disabled_down_h": [72, 123, 32, 7], "action_item_down": [475, 253, 32, 32], "switch-background_disabled": [290, 291, 83, 32], "textinput_disabled": [241, 399, 111, 111], "splitter_grip_h": [462, 239, 26, 12], "button_blue": [80, 43, 29, 37], "button_gray_disabled": [111, 43, 29, 37], "button_pink": [142, 43, 29, 37], "button_pink_pressed": [173, 43, 29, 37], "checkbox_disabled_on": [331, 57.5, 32, 32], "checkbox_disabled_off": [297, 57.5, 32, 32], "checkbox_radio_disabled_off":[467, 57.5, 32, 32], "checkbox_radio_disabled_off": [433, 57.5, 32, 32]}} \ No newline at end of file diff --git a/resources/kivy/images/defaulttheme.png b/resources/kivy/images/defaulttheme.png new file mode 100644 index 0000000..9e8e9ac Binary files /dev/null and b/resources/kivy/images/defaulttheme.png differ diff --git a/resources/kivy/menu.kv b/resources/kivy/menu.kv new file mode 100644 index 0000000..4756d9b --- /dev/null +++ b/resources/kivy/menu.kv @@ -0,0 +1,77 @@ +#:kivy 2.1.0 + +: + + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Label: + id: title_label + text: "LUMACRYTE" + size_hint: 1, 0.5 + pos_hint: {"center_x": 0.5, "center_y": 0.85} + font_size: 60*root.font_ratio + font_name: root.font + color: root.manager.color_label + + Label: + id: start_label + text: "Start a new game" if root.mobile_mode else "Press space to start a new game" + size_hint: 1, 0.25 + pos_hint: {"center_x": 0.5, "center_y": 0.45} + font_size: 40*root.font_ratio + font_name: root.font + color: root.manager.color_label + Button: + size_hint: 1, 0.25 + pos_hint: {"center_x": 0.5, "center_y": 0.45} + background_color: 0, 0, 0, 0 + on_release: + root.manager.init_screen("world_explorer") + + Image: + id: settings_logo + source: root.path_images + "settings_logo.png" + size_hint: None, 0.15 + pos_hint: {"right": 0.95, "y": 0.05} + allow_stretch: True + width: self.height + Button: + id: settings_button + size_hint: None, 0.15 + pos_hint: {"right": 0.95, "y": 0.05} + background_color: (0, 0, 0, 0) + width: self.height + on_release: + root.manager.init_screen("settings") + + Label: + id: high_score_label + text: root.high_score + bold: True + color: root.manager.color_label + pos_hint: {"right":1, "y":0} + size_hint: 0.2, 0.1 + font_name: root.font + font_size: 30*root.font_ratio + + Image: + source: root.path_images + "collection_logo.png" + size_hint: None, 0.15 + pos_hint: {"x": 0.05, "y": 0.05} + allow_stretch: True + width: self.height + Button: + size_hint: None, 0.15 + pos_hint: {"x": 0.05, "y": 0.05} + background_color: (0, 0, 0, 0) + width: self.height + on_release: + root.manager.init_screen("collection") diff --git a/resources/kivy/settings.kv b/resources/kivy/settings.kv new file mode 100644 index 0000000..989fae2 --- /dev/null +++ b/resources/kivy/settings.kv @@ -0,0 +1,140 @@ +#:kivy 2.1.0 + +: + + Image: + id: back_image + source: root.path_back_image + size_hint: None,None + width: root.width_back_image + height: root.height_back_image + pos_hint: {"center_x":0.5,"center_y":0.5} + allow_stretch: True + keep_ratio: True + + Image: + source: root.path_images + "back_arrow.png" + size_hint: None, 0.1 + pos_hint: {"x":0.025, "top": 0.975} + allow_stretch: True + width: self.height + Button: + size_hint: None, 0.1 + width: self.height + pos_hint: {"x":0.025, "top": 0.975} + background_color: (0, 0, 0, 0) + on_release: + root.manager.init_screen("menu") + + Label: + text: root.high_score + bold: True + color: root.manager.color_label + pos_hint: {"right":1, "top":1} + size_hint: 0.2, 0.1 + font_name: root.font + font_size: 30*root.font_ratio + + + # KEYBOARD CONFIGURATION + + Button: + id: top_button + text: "Move up" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.7} + color: root.manager.gray_color + font_name: root.font + font_size: 20*root.font_ratio + on_release: + root.select_next_key("top") + Button: + id: top_key_input + text: root.top_key + size_hint: 0.1, 0.1 + pos_hint: {"x":0.65, "y": 0.7} + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + color: root.manager.color_label + + Button: + id: left_button + text: "Move left" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.55} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("left") + Button: + id: left_key_input + text: root.left_key + size_hint: 0.1, 0.1 + pos_hint: {"x":0.65, "y": 0.55} + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + color: root.manager.color_label + + Button: + id: bottom_button + text: "Move down" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.4} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("bottom") + Button: + id: bottom_key_input + text: root.bottom_key + size_hint: 0.1, 0.1 + pos_hint: {"x":0.65, "y": 0.4} + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + color: root.manager.color_label + + + Button: + id: right_button + text: "Move right" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.25} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("right") + Button: + id: right_key_input + text: root.right_key + size_hint: 0.1, 0.1 + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + pos_hint: {"x":0.65, "y": 0.25} + color: root.manager.color_label + + Button: + id: interact_button + text: "Interact" + size_hint: 0.15, 0.1 + pos_hint: {"x":0.45, "y":0.1} + color: root.manager.gray_color + font_size: 20*root.font_ratio + font_name: root.font + on_release: + root.select_next_key("INTERACT") + Button: + id: interact_key_input + text: root.interact_key + size_hint: 0.1, 0.1 + disabled: True + font_name: root.font + font_size: 20*root.font_ratio + pos_hint: {"x":0.65, "y": 0.1} + color: root.manager.color_label diff --git a/resources/kivy/world_explorer.kv b/resources/kivy/world_explorer.kv new file mode 100644 index 0000000..506b6c8 --- /dev/null +++ b/resources/kivy/world_explorer.kv @@ -0,0 +1,3 @@ +#:kivy 2.1.0 + +: diff --git a/resources/maps/test_cave.txt b/resources/maps/test_cave.txt new file mode 100644 index 0000000..2452ee1 --- /dev/null +++ b/resources/maps/test_cave.txt @@ -0,0 +1,32 @@ +R R R R R R R R R G G G G G C G G R R C G G G G R G G C R R R R +R R R R R R R R R G G G G G G G R R R R G G G G R G G G R R R R +R R R R R R R R G G G R G C G G R R R R G R G G G G G G R G C R +R R R R C R R R G G G G R G G G G C R G G R R R G R G G G G G G +R R R R G G G G G G G G G R G G G G R G G R R R G C G G G R G G +R R G G C G G R R G G G C R G G G G G G G R R R G G R C G G G R +R R G G R R G G R R G G R G G R R G G G G R R R R R R G G G G G +R R G G G R G G G R G G C G G G G G G R R C R R R R R G G R G G +R G G G G R R G G R R G R G G R R G R R G G R R R R R G G G G G +R G R R R R R R R R G G C G R R R G G R G G G R R R R R G R R G +R R R R R R R R R R G G R G R R R G G G G G R R R G G G G G C G +R R G G C R R R R R G G C G G R R G G G G G R R R G G C G G G G +R R G G G G R R R R R R R R G R G R G G G G R R R R G G G G G G +R R G G G G G G R R R R R G G R G G G G G G G G C R G G R G C G +R C G G G R G R R R R R G G G G R R R R G G G G R R R R R G G G +R G G G G G G R G R R R G G G G G G R R R R R R R R R R R G G G +G G G G G G G R G G R R G G G G B G R R R R R R R R R R R R R G +G G G G G G R R G R R R R R G G G G G G R R R R R R R R R R R R +R G G G R R R R G R R R R R R G C G G G R R R R R R R R R R R R +R G G G G G G G G R R R R R R G G G G G R R R R R R R R R G R R +R G R R C G G G G R R R C G G G G G R R R R R G G G R R G G R R +R R R G G G G C R R R R R R R R R G G G R R G G G G G R G G G G +R R R G G C G G G G R R R R R G G G G G R R R C R G G R G G G G +R R G G G C G G G R R R R R R G G C G C G R R G R G G G G G G R +R R G G G G G G G R R R R R R R R R G G G G R G R R G R R G C R +R R R C G G G G G G G R R R R R R R G G G G R G G G G R R G G R +R R G G G G C G G G G R R R R R G G G G G R R G R R R C G G G R +R G G G G G C G G G G R R R R R G G G G G G G R R R R G G G G G +R G G G G R R G G G G R G R G G R G G G G R R R R R G G R G G G +R G G G G G R R R G G G G G C G G G G G G R R R R R R R R G G G +G G G R C G G C R G G G G G G G G C G G C R R R R R R R R R G G +G R R R R G G G G G G G G C G G G R G G R R R R R R R R R C G R \ No newline at end of file diff --git a/resources/musics/game_music.mp3 b/resources/musics/game_music.mp3 new file mode 100644 index 0000000..58360cc Binary files /dev/null and b/resources/musics/game_music.mp3 differ diff --git a/resources/musics/game_over_music.mp3 b/resources/musics/game_over_music.mp3 new file mode 100644 index 0000000..cf23c77 Binary files /dev/null and b/resources/musics/game_over_music.mp3 differ diff --git a/resources/musics/title_music.mp3 b/resources/musics/title_music.mp3 new file mode 100644 index 0000000..1f5dd7e Binary files /dev/null and b/resources/musics/title_music.mp3 differ diff --git a/resources/sounds/darkness.mp3 b/resources/sounds/darkness.mp3 new file mode 100644 index 0000000..a20829d Binary files /dev/null and b/resources/sounds/darkness.mp3 differ diff --git a/resources/sounds/death.mp3 b/resources/sounds/death.mp3 new file mode 100644 index 0000000..fa36e7d Binary files /dev/null and b/resources/sounds/death.mp3 differ diff --git a/resources/sounds/flic.mp3 b/resources/sounds/flic.mp3 new file mode 100644 index 0000000..afffe83 Binary files /dev/null and b/resources/sounds/flic.mp3 differ diff --git a/resources/sounds/get_crystal.mp3 b/resources/sounds/get_crystal.mp3 new file mode 100644 index 0000000..7dff128 Binary files /dev/null and b/resources/sounds/get_crystal.mp3 differ diff --git a/resources/sounds/give_crystal.mp3 b/resources/sounds/give_crystal.mp3 new file mode 100644 index 0000000..1866aec Binary files /dev/null and b/resources/sounds/give_crystal.mp3 differ diff --git a/resources/sounds/near_beacon.mp3 b/resources/sounds/near_beacon.mp3 new file mode 100644 index 0000000..1c943c8 Binary files /dev/null and b/resources/sounds/near_beacon.mp3 differ diff --git a/resources/sounds/near_crystal.mp3 b/resources/sounds/near_crystal.mp3 new file mode 100644 index 0000000..c9e1895 Binary files /dev/null and b/resources/sounds/near_crystal.mp3 differ diff --git a/resources/sounds/start_beacon.mp3 b/resources/sounds/start_beacon.mp3 new file mode 100644 index 0000000..e2789e0 Binary files /dev/null and b/resources/sounds/start_beacon.mp3 differ diff --git a/resources/start_logo/washing_machine_black_0.png b/resources/start_logo/washing_machine_black_0.png new file mode 100644 index 0000000..061bac2 Binary files /dev/null and b/resources/start_logo/washing_machine_black_0.png differ diff --git a/resources/start_logo/washing_machine_black_1.png b/resources/start_logo/washing_machine_black_1.png new file mode 100644 index 0000000..c756042 Binary files /dev/null and b/resources/start_logo/washing_machine_black_1.png differ diff --git a/resources/start_logo/washing_machine_black_10.png b/resources/start_logo/washing_machine_black_10.png new file mode 100644 index 0000000..50a5b30 Binary files /dev/null and b/resources/start_logo/washing_machine_black_10.png differ diff --git a/resources/start_logo/washing_machine_black_100.png b/resources/start_logo/washing_machine_black_100.png new file mode 100644 index 0000000..58aafcf Binary files /dev/null and b/resources/start_logo/washing_machine_black_100.png differ diff --git a/resources/start_logo/washing_machine_black_101.png b/resources/start_logo/washing_machine_black_101.png new file mode 100644 index 0000000..dd54d16 Binary files /dev/null and b/resources/start_logo/washing_machine_black_101.png differ diff --git a/resources/start_logo/washing_machine_black_102.png b/resources/start_logo/washing_machine_black_102.png new file mode 100644 index 0000000..f92363a Binary files /dev/null and b/resources/start_logo/washing_machine_black_102.png differ diff --git a/resources/start_logo/washing_machine_black_103.png b/resources/start_logo/washing_machine_black_103.png new file mode 100644 index 0000000..a515329 Binary files /dev/null and b/resources/start_logo/washing_machine_black_103.png differ diff --git a/resources/start_logo/washing_machine_black_104.png b/resources/start_logo/washing_machine_black_104.png new file mode 100644 index 0000000..93695c1 Binary files /dev/null and b/resources/start_logo/washing_machine_black_104.png differ diff --git a/resources/start_logo/washing_machine_black_105.png b/resources/start_logo/washing_machine_black_105.png new file mode 100644 index 0000000..a43b85d Binary files /dev/null and b/resources/start_logo/washing_machine_black_105.png differ diff --git a/resources/start_logo/washing_machine_black_106.png b/resources/start_logo/washing_machine_black_106.png new file mode 100644 index 0000000..3d2657c Binary files /dev/null and b/resources/start_logo/washing_machine_black_106.png differ diff --git a/resources/start_logo/washing_machine_black_107.png b/resources/start_logo/washing_machine_black_107.png new file mode 100644 index 0000000..6c43d76 Binary files /dev/null and b/resources/start_logo/washing_machine_black_107.png differ diff --git a/resources/start_logo/washing_machine_black_108.png b/resources/start_logo/washing_machine_black_108.png new file mode 100644 index 0000000..c795ef5 Binary files /dev/null and b/resources/start_logo/washing_machine_black_108.png differ diff --git a/resources/start_logo/washing_machine_black_109.png b/resources/start_logo/washing_machine_black_109.png new file mode 100644 index 0000000..525fcff Binary files /dev/null and b/resources/start_logo/washing_machine_black_109.png differ diff --git a/resources/start_logo/washing_machine_black_11.png b/resources/start_logo/washing_machine_black_11.png new file mode 100644 index 0000000..ff44f66 Binary files /dev/null and b/resources/start_logo/washing_machine_black_11.png differ diff --git a/resources/start_logo/washing_machine_black_110.png b/resources/start_logo/washing_machine_black_110.png new file mode 100644 index 0000000..9ac08aa Binary files /dev/null and b/resources/start_logo/washing_machine_black_110.png differ diff --git a/resources/start_logo/washing_machine_black_111.png b/resources/start_logo/washing_machine_black_111.png new file mode 100644 index 0000000..354510e Binary files /dev/null and b/resources/start_logo/washing_machine_black_111.png differ diff --git a/resources/start_logo/washing_machine_black_112.png b/resources/start_logo/washing_machine_black_112.png new file mode 100644 index 0000000..f4a964e Binary files /dev/null and b/resources/start_logo/washing_machine_black_112.png differ diff --git a/resources/start_logo/washing_machine_black_113.png b/resources/start_logo/washing_machine_black_113.png new file mode 100644 index 0000000..03d8c9e Binary files /dev/null and b/resources/start_logo/washing_machine_black_113.png differ diff --git a/resources/start_logo/washing_machine_black_114.png b/resources/start_logo/washing_machine_black_114.png new file mode 100644 index 0000000..c6d77f7 Binary files /dev/null and b/resources/start_logo/washing_machine_black_114.png differ diff --git a/resources/start_logo/washing_machine_black_115.png b/resources/start_logo/washing_machine_black_115.png new file mode 100644 index 0000000..9a8bf2c Binary files /dev/null and b/resources/start_logo/washing_machine_black_115.png differ diff --git a/resources/start_logo/washing_machine_black_116.png b/resources/start_logo/washing_machine_black_116.png new file mode 100644 index 0000000..8659492 Binary files /dev/null and b/resources/start_logo/washing_machine_black_116.png differ diff --git a/resources/start_logo/washing_machine_black_117.png b/resources/start_logo/washing_machine_black_117.png new file mode 100644 index 0000000..d07cd58 Binary files /dev/null and b/resources/start_logo/washing_machine_black_117.png differ diff --git a/resources/start_logo/washing_machine_black_118.png b/resources/start_logo/washing_machine_black_118.png new file mode 100644 index 0000000..1c43c4f Binary files /dev/null and b/resources/start_logo/washing_machine_black_118.png differ diff --git a/resources/start_logo/washing_machine_black_119.png b/resources/start_logo/washing_machine_black_119.png new file mode 100644 index 0000000..cb64d47 Binary files /dev/null and b/resources/start_logo/washing_machine_black_119.png differ diff --git a/resources/start_logo/washing_machine_black_12.png b/resources/start_logo/washing_machine_black_12.png new file mode 100644 index 0000000..c506258 Binary files /dev/null and b/resources/start_logo/washing_machine_black_12.png differ diff --git a/resources/start_logo/washing_machine_black_120.png b/resources/start_logo/washing_machine_black_120.png new file mode 100644 index 0000000..c60aa0c Binary files /dev/null and b/resources/start_logo/washing_machine_black_120.png differ diff --git a/resources/start_logo/washing_machine_black_121.png b/resources/start_logo/washing_machine_black_121.png new file mode 100644 index 0000000..fd7fdd0 Binary files /dev/null and b/resources/start_logo/washing_machine_black_121.png differ diff --git a/resources/start_logo/washing_machine_black_122.png b/resources/start_logo/washing_machine_black_122.png new file mode 100644 index 0000000..20b0e12 Binary files /dev/null and b/resources/start_logo/washing_machine_black_122.png differ diff --git a/resources/start_logo/washing_machine_black_123.png b/resources/start_logo/washing_machine_black_123.png new file mode 100644 index 0000000..975f52c Binary files /dev/null and b/resources/start_logo/washing_machine_black_123.png differ diff --git a/resources/start_logo/washing_machine_black_124.png b/resources/start_logo/washing_machine_black_124.png new file mode 100644 index 0000000..b6a86a7 Binary files /dev/null and b/resources/start_logo/washing_machine_black_124.png differ diff --git a/resources/start_logo/washing_machine_black_125.png b/resources/start_logo/washing_machine_black_125.png new file mode 100644 index 0000000..d774743 Binary files /dev/null and b/resources/start_logo/washing_machine_black_125.png differ diff --git a/resources/start_logo/washing_machine_black_126.png b/resources/start_logo/washing_machine_black_126.png new file mode 100644 index 0000000..ffcb85b Binary files /dev/null and b/resources/start_logo/washing_machine_black_126.png differ diff --git a/resources/start_logo/washing_machine_black_127.png b/resources/start_logo/washing_machine_black_127.png new file mode 100644 index 0000000..2b1a99e Binary files /dev/null and b/resources/start_logo/washing_machine_black_127.png differ diff --git a/resources/start_logo/washing_machine_black_128.png b/resources/start_logo/washing_machine_black_128.png new file mode 100644 index 0000000..6c83a8f Binary files /dev/null and b/resources/start_logo/washing_machine_black_128.png differ diff --git a/resources/start_logo/washing_machine_black_129.png b/resources/start_logo/washing_machine_black_129.png new file mode 100644 index 0000000..2209d28 Binary files /dev/null and b/resources/start_logo/washing_machine_black_129.png differ diff --git a/resources/start_logo/washing_machine_black_13.png b/resources/start_logo/washing_machine_black_13.png new file mode 100644 index 0000000..162b11b Binary files /dev/null and b/resources/start_logo/washing_machine_black_13.png differ diff --git a/resources/start_logo/washing_machine_black_130.png b/resources/start_logo/washing_machine_black_130.png new file mode 100644 index 0000000..36dbc07 Binary files /dev/null and b/resources/start_logo/washing_machine_black_130.png differ diff --git a/resources/start_logo/washing_machine_black_131.png b/resources/start_logo/washing_machine_black_131.png new file mode 100644 index 0000000..e7ebbee Binary files /dev/null and b/resources/start_logo/washing_machine_black_131.png differ diff --git a/resources/start_logo/washing_machine_black_132.png b/resources/start_logo/washing_machine_black_132.png new file mode 100644 index 0000000..060482a Binary files /dev/null and b/resources/start_logo/washing_machine_black_132.png differ diff --git a/resources/start_logo/washing_machine_black_133.png b/resources/start_logo/washing_machine_black_133.png new file mode 100644 index 0000000..d5cee02 Binary files /dev/null and b/resources/start_logo/washing_machine_black_133.png differ diff --git a/resources/start_logo/washing_machine_black_134.png b/resources/start_logo/washing_machine_black_134.png new file mode 100644 index 0000000..adafadb Binary files /dev/null and b/resources/start_logo/washing_machine_black_134.png differ diff --git a/resources/start_logo/washing_machine_black_135.png b/resources/start_logo/washing_machine_black_135.png new file mode 100644 index 0000000..967f7e3 Binary files /dev/null and b/resources/start_logo/washing_machine_black_135.png differ diff --git a/resources/start_logo/washing_machine_black_136.png b/resources/start_logo/washing_machine_black_136.png new file mode 100644 index 0000000..6cefe31 Binary files /dev/null and b/resources/start_logo/washing_machine_black_136.png differ diff --git a/resources/start_logo/washing_machine_black_137.png b/resources/start_logo/washing_machine_black_137.png new file mode 100644 index 0000000..9138979 Binary files /dev/null and b/resources/start_logo/washing_machine_black_137.png differ diff --git a/resources/start_logo/washing_machine_black_138.png b/resources/start_logo/washing_machine_black_138.png new file mode 100644 index 0000000..394c7c8 Binary files /dev/null and b/resources/start_logo/washing_machine_black_138.png differ diff --git a/resources/start_logo/washing_machine_black_14.png b/resources/start_logo/washing_machine_black_14.png new file mode 100644 index 0000000..bd1ce52 Binary files /dev/null and b/resources/start_logo/washing_machine_black_14.png differ diff --git a/resources/start_logo/washing_machine_black_15.png b/resources/start_logo/washing_machine_black_15.png new file mode 100644 index 0000000..ec4879e Binary files /dev/null and b/resources/start_logo/washing_machine_black_15.png differ diff --git a/resources/start_logo/washing_machine_black_16.png b/resources/start_logo/washing_machine_black_16.png new file mode 100644 index 0000000..c915a36 Binary files /dev/null and b/resources/start_logo/washing_machine_black_16.png differ diff --git a/resources/start_logo/washing_machine_black_17.png b/resources/start_logo/washing_machine_black_17.png new file mode 100644 index 0000000..623b643 Binary files /dev/null and b/resources/start_logo/washing_machine_black_17.png differ diff --git a/resources/start_logo/washing_machine_black_18.png b/resources/start_logo/washing_machine_black_18.png new file mode 100644 index 0000000..2d1d50d Binary files /dev/null and b/resources/start_logo/washing_machine_black_18.png differ diff --git a/resources/start_logo/washing_machine_black_19.png b/resources/start_logo/washing_machine_black_19.png new file mode 100644 index 0000000..562214b Binary files /dev/null and b/resources/start_logo/washing_machine_black_19.png differ diff --git a/resources/start_logo/washing_machine_black_2.png b/resources/start_logo/washing_machine_black_2.png new file mode 100644 index 0000000..38de1cb Binary files /dev/null and b/resources/start_logo/washing_machine_black_2.png differ diff --git a/resources/start_logo/washing_machine_black_20.png b/resources/start_logo/washing_machine_black_20.png new file mode 100644 index 0000000..298ea73 Binary files /dev/null and b/resources/start_logo/washing_machine_black_20.png differ diff --git a/resources/start_logo/washing_machine_black_21.png b/resources/start_logo/washing_machine_black_21.png new file mode 100644 index 0000000..d348b02 Binary files /dev/null and b/resources/start_logo/washing_machine_black_21.png differ diff --git a/resources/start_logo/washing_machine_black_22.png b/resources/start_logo/washing_machine_black_22.png new file mode 100644 index 0000000..5019c9f Binary files /dev/null and b/resources/start_logo/washing_machine_black_22.png differ diff --git a/resources/start_logo/washing_machine_black_23.png b/resources/start_logo/washing_machine_black_23.png new file mode 100644 index 0000000..9f1807c Binary files /dev/null and b/resources/start_logo/washing_machine_black_23.png differ diff --git a/resources/start_logo/washing_machine_black_24.png b/resources/start_logo/washing_machine_black_24.png new file mode 100644 index 0000000..41c0ae1 Binary files /dev/null and b/resources/start_logo/washing_machine_black_24.png differ diff --git a/resources/start_logo/washing_machine_black_25.png b/resources/start_logo/washing_machine_black_25.png new file mode 100644 index 0000000..cab49e8 Binary files /dev/null and b/resources/start_logo/washing_machine_black_25.png differ diff --git a/resources/start_logo/washing_machine_black_26.png b/resources/start_logo/washing_machine_black_26.png new file mode 100644 index 0000000..d70d903 Binary files /dev/null and b/resources/start_logo/washing_machine_black_26.png differ diff --git a/resources/start_logo/washing_machine_black_27.png b/resources/start_logo/washing_machine_black_27.png new file mode 100644 index 0000000..05bba81 Binary files /dev/null and b/resources/start_logo/washing_machine_black_27.png differ diff --git a/resources/start_logo/washing_machine_black_28.png b/resources/start_logo/washing_machine_black_28.png new file mode 100644 index 0000000..8b59af5 Binary files /dev/null and b/resources/start_logo/washing_machine_black_28.png differ diff --git a/resources/start_logo/washing_machine_black_29.png b/resources/start_logo/washing_machine_black_29.png new file mode 100644 index 0000000..51d5b4c Binary files /dev/null and b/resources/start_logo/washing_machine_black_29.png differ diff --git a/resources/start_logo/washing_machine_black_3.png b/resources/start_logo/washing_machine_black_3.png new file mode 100644 index 0000000..4dd756f Binary files /dev/null and b/resources/start_logo/washing_machine_black_3.png differ diff --git a/resources/start_logo/washing_machine_black_30.png b/resources/start_logo/washing_machine_black_30.png new file mode 100644 index 0000000..bb881c8 Binary files /dev/null and b/resources/start_logo/washing_machine_black_30.png differ diff --git a/resources/start_logo/washing_machine_black_31.png b/resources/start_logo/washing_machine_black_31.png new file mode 100644 index 0000000..b093c40 Binary files /dev/null and b/resources/start_logo/washing_machine_black_31.png differ diff --git a/resources/start_logo/washing_machine_black_32.png b/resources/start_logo/washing_machine_black_32.png new file mode 100644 index 0000000..7935367 Binary files /dev/null and b/resources/start_logo/washing_machine_black_32.png differ diff --git a/resources/start_logo/washing_machine_black_33.png b/resources/start_logo/washing_machine_black_33.png new file mode 100644 index 0000000..a523d37 Binary files /dev/null and b/resources/start_logo/washing_machine_black_33.png differ diff --git a/resources/start_logo/washing_machine_black_34.png b/resources/start_logo/washing_machine_black_34.png new file mode 100644 index 0000000..7c1c54b Binary files /dev/null and b/resources/start_logo/washing_machine_black_34.png differ diff --git a/resources/start_logo/washing_machine_black_35.png b/resources/start_logo/washing_machine_black_35.png new file mode 100644 index 0000000..7daa2be Binary files /dev/null and b/resources/start_logo/washing_machine_black_35.png differ diff --git a/resources/start_logo/washing_machine_black_36.png b/resources/start_logo/washing_machine_black_36.png new file mode 100644 index 0000000..2348611 Binary files /dev/null and b/resources/start_logo/washing_machine_black_36.png differ diff --git a/resources/start_logo/washing_machine_black_37.png b/resources/start_logo/washing_machine_black_37.png new file mode 100644 index 0000000..f67b2f0 Binary files /dev/null and b/resources/start_logo/washing_machine_black_37.png differ diff --git a/resources/start_logo/washing_machine_black_38.png b/resources/start_logo/washing_machine_black_38.png new file mode 100644 index 0000000..067f1d2 Binary files /dev/null and b/resources/start_logo/washing_machine_black_38.png differ diff --git a/resources/start_logo/washing_machine_black_39.png b/resources/start_logo/washing_machine_black_39.png new file mode 100644 index 0000000..e6df399 Binary files /dev/null and b/resources/start_logo/washing_machine_black_39.png differ diff --git a/resources/start_logo/washing_machine_black_4.png b/resources/start_logo/washing_machine_black_4.png new file mode 100644 index 0000000..b1a8e67 Binary files /dev/null and b/resources/start_logo/washing_machine_black_4.png differ diff --git a/resources/start_logo/washing_machine_black_40.png b/resources/start_logo/washing_machine_black_40.png new file mode 100644 index 0000000..5545731 Binary files /dev/null and b/resources/start_logo/washing_machine_black_40.png differ diff --git a/resources/start_logo/washing_machine_black_41.png b/resources/start_logo/washing_machine_black_41.png new file mode 100644 index 0000000..a65b478 Binary files /dev/null and b/resources/start_logo/washing_machine_black_41.png differ diff --git a/resources/start_logo/washing_machine_black_42.png b/resources/start_logo/washing_machine_black_42.png new file mode 100644 index 0000000..172a550 Binary files /dev/null and b/resources/start_logo/washing_machine_black_42.png differ diff --git a/resources/start_logo/washing_machine_black_43.png b/resources/start_logo/washing_machine_black_43.png new file mode 100644 index 0000000..2165f19 Binary files /dev/null and b/resources/start_logo/washing_machine_black_43.png differ diff --git a/resources/start_logo/washing_machine_black_44.png b/resources/start_logo/washing_machine_black_44.png new file mode 100644 index 0000000..7a8dd5a Binary files /dev/null and b/resources/start_logo/washing_machine_black_44.png differ diff --git a/resources/start_logo/washing_machine_black_45.png b/resources/start_logo/washing_machine_black_45.png new file mode 100644 index 0000000..57f21b2 Binary files /dev/null and b/resources/start_logo/washing_machine_black_45.png differ diff --git a/resources/start_logo/washing_machine_black_46.png b/resources/start_logo/washing_machine_black_46.png new file mode 100644 index 0000000..efdb6fc Binary files /dev/null and b/resources/start_logo/washing_machine_black_46.png differ diff --git a/resources/start_logo/washing_machine_black_47.png b/resources/start_logo/washing_machine_black_47.png new file mode 100644 index 0000000..7b2da12 Binary files /dev/null and b/resources/start_logo/washing_machine_black_47.png differ diff --git a/resources/start_logo/washing_machine_black_48.png b/resources/start_logo/washing_machine_black_48.png new file mode 100644 index 0000000..1043bc5 Binary files /dev/null and b/resources/start_logo/washing_machine_black_48.png differ diff --git a/resources/start_logo/washing_machine_black_49.png b/resources/start_logo/washing_machine_black_49.png new file mode 100644 index 0000000..230d844 Binary files /dev/null and b/resources/start_logo/washing_machine_black_49.png differ diff --git a/resources/start_logo/washing_machine_black_5.png b/resources/start_logo/washing_machine_black_5.png new file mode 100644 index 0000000..0a8b67e Binary files /dev/null and b/resources/start_logo/washing_machine_black_5.png differ diff --git a/resources/start_logo/washing_machine_black_50.png b/resources/start_logo/washing_machine_black_50.png new file mode 100644 index 0000000..97b45d9 Binary files /dev/null and b/resources/start_logo/washing_machine_black_50.png differ diff --git a/resources/start_logo/washing_machine_black_51.png b/resources/start_logo/washing_machine_black_51.png new file mode 100644 index 0000000..d317140 Binary files /dev/null and b/resources/start_logo/washing_machine_black_51.png differ diff --git a/resources/start_logo/washing_machine_black_52.png b/resources/start_logo/washing_machine_black_52.png new file mode 100644 index 0000000..8a76ce3 Binary files /dev/null and b/resources/start_logo/washing_machine_black_52.png differ diff --git a/resources/start_logo/washing_machine_black_53.png b/resources/start_logo/washing_machine_black_53.png new file mode 100644 index 0000000..998b1ae Binary files /dev/null and b/resources/start_logo/washing_machine_black_53.png differ diff --git a/resources/start_logo/washing_machine_black_54.png b/resources/start_logo/washing_machine_black_54.png new file mode 100644 index 0000000..49c0c4e Binary files /dev/null and b/resources/start_logo/washing_machine_black_54.png differ diff --git a/resources/start_logo/washing_machine_black_55.png b/resources/start_logo/washing_machine_black_55.png new file mode 100644 index 0000000..5b78292 Binary files /dev/null and b/resources/start_logo/washing_machine_black_55.png differ diff --git a/resources/start_logo/washing_machine_black_56.png b/resources/start_logo/washing_machine_black_56.png new file mode 100644 index 0000000..b22b2eb Binary files /dev/null and b/resources/start_logo/washing_machine_black_56.png differ diff --git a/resources/start_logo/washing_machine_black_57.png b/resources/start_logo/washing_machine_black_57.png new file mode 100644 index 0000000..9431080 Binary files /dev/null and b/resources/start_logo/washing_machine_black_57.png differ diff --git a/resources/start_logo/washing_machine_black_58.png b/resources/start_logo/washing_machine_black_58.png new file mode 100644 index 0000000..2943246 Binary files /dev/null and b/resources/start_logo/washing_machine_black_58.png differ diff --git a/resources/start_logo/washing_machine_black_59.png b/resources/start_logo/washing_machine_black_59.png new file mode 100644 index 0000000..78a7641 Binary files /dev/null and b/resources/start_logo/washing_machine_black_59.png differ diff --git a/resources/start_logo/washing_machine_black_6.png b/resources/start_logo/washing_machine_black_6.png new file mode 100644 index 0000000..fc8b5ef Binary files /dev/null and b/resources/start_logo/washing_machine_black_6.png differ diff --git a/resources/start_logo/washing_machine_black_60.png b/resources/start_logo/washing_machine_black_60.png new file mode 100644 index 0000000..9659119 Binary files /dev/null and b/resources/start_logo/washing_machine_black_60.png differ diff --git a/resources/start_logo/washing_machine_black_61.png b/resources/start_logo/washing_machine_black_61.png new file mode 100644 index 0000000..8b63f84 Binary files /dev/null and b/resources/start_logo/washing_machine_black_61.png differ diff --git a/resources/start_logo/washing_machine_black_62.png b/resources/start_logo/washing_machine_black_62.png new file mode 100644 index 0000000..eac4247 Binary files /dev/null and b/resources/start_logo/washing_machine_black_62.png differ diff --git a/resources/start_logo/washing_machine_black_63.png b/resources/start_logo/washing_machine_black_63.png new file mode 100644 index 0000000..349c0cd Binary files /dev/null and b/resources/start_logo/washing_machine_black_63.png differ diff --git a/resources/start_logo/washing_machine_black_64.png b/resources/start_logo/washing_machine_black_64.png new file mode 100644 index 0000000..95fc883 Binary files /dev/null and b/resources/start_logo/washing_machine_black_64.png differ diff --git a/resources/start_logo/washing_machine_black_65.png b/resources/start_logo/washing_machine_black_65.png new file mode 100644 index 0000000..e96e1df Binary files /dev/null and b/resources/start_logo/washing_machine_black_65.png differ diff --git a/resources/start_logo/washing_machine_black_66.png b/resources/start_logo/washing_machine_black_66.png new file mode 100644 index 0000000..f341eba Binary files /dev/null and b/resources/start_logo/washing_machine_black_66.png differ diff --git a/resources/start_logo/washing_machine_black_67.png b/resources/start_logo/washing_machine_black_67.png new file mode 100644 index 0000000..0ee8a81 Binary files /dev/null and b/resources/start_logo/washing_machine_black_67.png differ diff --git a/resources/start_logo/washing_machine_black_68.png b/resources/start_logo/washing_machine_black_68.png new file mode 100644 index 0000000..4cac5de Binary files /dev/null and b/resources/start_logo/washing_machine_black_68.png differ diff --git a/resources/start_logo/washing_machine_black_69.png b/resources/start_logo/washing_machine_black_69.png new file mode 100644 index 0000000..b93e202 Binary files /dev/null and b/resources/start_logo/washing_machine_black_69.png differ diff --git a/resources/start_logo/washing_machine_black_7.png b/resources/start_logo/washing_machine_black_7.png new file mode 100644 index 0000000..b119aa5 Binary files /dev/null and b/resources/start_logo/washing_machine_black_7.png differ diff --git a/resources/start_logo/washing_machine_black_70.png b/resources/start_logo/washing_machine_black_70.png new file mode 100644 index 0000000..6bcc367 Binary files /dev/null and b/resources/start_logo/washing_machine_black_70.png differ diff --git a/resources/start_logo/washing_machine_black_71.png b/resources/start_logo/washing_machine_black_71.png new file mode 100644 index 0000000..4abf2f8 Binary files /dev/null and b/resources/start_logo/washing_machine_black_71.png differ diff --git a/resources/start_logo/washing_machine_black_72.png b/resources/start_logo/washing_machine_black_72.png new file mode 100644 index 0000000..f58fbfa Binary files /dev/null and b/resources/start_logo/washing_machine_black_72.png differ diff --git a/resources/start_logo/washing_machine_black_73.png b/resources/start_logo/washing_machine_black_73.png new file mode 100644 index 0000000..4db66e7 Binary files /dev/null and b/resources/start_logo/washing_machine_black_73.png differ diff --git a/resources/start_logo/washing_machine_black_74.png b/resources/start_logo/washing_machine_black_74.png new file mode 100644 index 0000000..28b07c3 Binary files /dev/null and b/resources/start_logo/washing_machine_black_74.png differ diff --git a/resources/start_logo/washing_machine_black_75.png b/resources/start_logo/washing_machine_black_75.png new file mode 100644 index 0000000..a59ca5a Binary files /dev/null and b/resources/start_logo/washing_machine_black_75.png differ diff --git a/resources/start_logo/washing_machine_black_76.png b/resources/start_logo/washing_machine_black_76.png new file mode 100644 index 0000000..c36a610 Binary files /dev/null and b/resources/start_logo/washing_machine_black_76.png differ diff --git a/resources/start_logo/washing_machine_black_77.png b/resources/start_logo/washing_machine_black_77.png new file mode 100644 index 0000000..f92cabc Binary files /dev/null and b/resources/start_logo/washing_machine_black_77.png differ diff --git a/resources/start_logo/washing_machine_black_78.png b/resources/start_logo/washing_machine_black_78.png new file mode 100644 index 0000000..5b30de7 Binary files /dev/null and b/resources/start_logo/washing_machine_black_78.png differ diff --git a/resources/start_logo/washing_machine_black_79.png b/resources/start_logo/washing_machine_black_79.png new file mode 100644 index 0000000..af0a23c Binary files /dev/null and b/resources/start_logo/washing_machine_black_79.png differ diff --git a/resources/start_logo/washing_machine_black_8.png b/resources/start_logo/washing_machine_black_8.png new file mode 100644 index 0000000..bedaccc Binary files /dev/null and b/resources/start_logo/washing_machine_black_8.png differ diff --git a/resources/start_logo/washing_machine_black_80.png b/resources/start_logo/washing_machine_black_80.png new file mode 100644 index 0000000..c4581f5 Binary files /dev/null and b/resources/start_logo/washing_machine_black_80.png differ diff --git a/resources/start_logo/washing_machine_black_81.png b/resources/start_logo/washing_machine_black_81.png new file mode 100644 index 0000000..d95b15e Binary files /dev/null and b/resources/start_logo/washing_machine_black_81.png differ diff --git a/resources/start_logo/washing_machine_black_82.png b/resources/start_logo/washing_machine_black_82.png new file mode 100644 index 0000000..4516a26 Binary files /dev/null and b/resources/start_logo/washing_machine_black_82.png differ diff --git a/resources/start_logo/washing_machine_black_83.png b/resources/start_logo/washing_machine_black_83.png new file mode 100644 index 0000000..1feb6d8 Binary files /dev/null and b/resources/start_logo/washing_machine_black_83.png differ diff --git a/resources/start_logo/washing_machine_black_84.png b/resources/start_logo/washing_machine_black_84.png new file mode 100644 index 0000000..95da664 Binary files /dev/null and b/resources/start_logo/washing_machine_black_84.png differ diff --git a/resources/start_logo/washing_machine_black_85.png b/resources/start_logo/washing_machine_black_85.png new file mode 100644 index 0000000..3fc37e5 Binary files /dev/null and b/resources/start_logo/washing_machine_black_85.png differ diff --git a/resources/start_logo/washing_machine_black_86.png b/resources/start_logo/washing_machine_black_86.png new file mode 100644 index 0000000..a23f834 Binary files /dev/null and b/resources/start_logo/washing_machine_black_86.png differ diff --git a/resources/start_logo/washing_machine_black_87.png b/resources/start_logo/washing_machine_black_87.png new file mode 100644 index 0000000..eb97e86 Binary files /dev/null and b/resources/start_logo/washing_machine_black_87.png differ diff --git a/resources/start_logo/washing_machine_black_88.png b/resources/start_logo/washing_machine_black_88.png new file mode 100644 index 0000000..4d80c15 Binary files /dev/null and b/resources/start_logo/washing_machine_black_88.png differ diff --git a/resources/start_logo/washing_machine_black_89.png b/resources/start_logo/washing_machine_black_89.png new file mode 100644 index 0000000..32f96af Binary files /dev/null and b/resources/start_logo/washing_machine_black_89.png differ diff --git a/resources/start_logo/washing_machine_black_9.png b/resources/start_logo/washing_machine_black_9.png new file mode 100644 index 0000000..9e5d5b4 Binary files /dev/null and b/resources/start_logo/washing_machine_black_9.png differ diff --git a/resources/start_logo/washing_machine_black_90.png b/resources/start_logo/washing_machine_black_90.png new file mode 100644 index 0000000..3c8a74e Binary files /dev/null and b/resources/start_logo/washing_machine_black_90.png differ diff --git a/resources/start_logo/washing_machine_black_91.png b/resources/start_logo/washing_machine_black_91.png new file mode 100644 index 0000000..8de3b44 Binary files /dev/null and b/resources/start_logo/washing_machine_black_91.png differ diff --git a/resources/start_logo/washing_machine_black_92.png b/resources/start_logo/washing_machine_black_92.png new file mode 100644 index 0000000..623c7eb Binary files /dev/null and b/resources/start_logo/washing_machine_black_92.png differ diff --git a/resources/start_logo/washing_machine_black_93.png b/resources/start_logo/washing_machine_black_93.png new file mode 100644 index 0000000..1210982 Binary files /dev/null and b/resources/start_logo/washing_machine_black_93.png differ diff --git a/resources/start_logo/washing_machine_black_94.png b/resources/start_logo/washing_machine_black_94.png new file mode 100644 index 0000000..81693d7 Binary files /dev/null and b/resources/start_logo/washing_machine_black_94.png differ diff --git a/resources/start_logo/washing_machine_black_95.png b/resources/start_logo/washing_machine_black_95.png new file mode 100644 index 0000000..f540594 Binary files /dev/null and b/resources/start_logo/washing_machine_black_95.png differ diff --git a/resources/start_logo/washing_machine_black_96.png b/resources/start_logo/washing_machine_black_96.png new file mode 100644 index 0000000..5badd50 Binary files /dev/null and b/resources/start_logo/washing_machine_black_96.png differ diff --git a/resources/start_logo/washing_machine_black_97.png b/resources/start_logo/washing_machine_black_97.png new file mode 100644 index 0000000..f4c271a Binary files /dev/null and b/resources/start_logo/washing_machine_black_97.png differ diff --git a/resources/start_logo/washing_machine_black_98.png b/resources/start_logo/washing_machine_black_98.png new file mode 100644 index 0000000..c8967d3 Binary files /dev/null and b/resources/start_logo/washing_machine_black_98.png differ diff --git a/resources/start_logo/washing_machine_black_99.png b/resources/start_logo/washing_machine_black_99.png new file mode 100644 index 0000000..9b6df95 Binary files /dev/null and b/resources/start_logo/washing_machine_black_99.png differ diff --git a/screens/__init__.py b/screens/__init__.py new file mode 100644 index 0000000..47b28f2 --- /dev/null +++ b/screens/__init__.py @@ -0,0 +1,4 @@ +from screens.menu import MenuScreen +from screens.settings import SettingsScreen +from screens.game_over import GameOverScreen +from screens.collection import CollectionScreen \ No newline at end of file diff --git a/screens/collection.py b/screens/collection.py new file mode 100644 index 0000000..f29170e --- /dev/null +++ b/screens/collection.py @@ -0,0 +1,115 @@ +""" +Module for the collection menu +""" + + +############### +### Imports ### +############### + + +from kivy.uix.screenmanager import Screen +from kivy.uix.image import Image +from kivy.uix.label import Label +from kivy.uix.relativelayout import RelativeLayout +from kivy.properties import StringProperty, ObjectProperty, NumericProperty +from tools.tools_constants import ( + PATH_TITLE_FONT, + DICT_TREASURE_STONES, + my_collection, + PATH_IMAGES, + Window +) +from tools.tools_world_explorer import ( + load_textures_from_atlas +) + + +################ +### Constant ### +################ + + +global_spacing = { + "horizontal": Window.size[0] / 50, + "vertical": Window.size[1] / 50 +} + + +############# +### Class ### +############# + + +class CollectionScreen(Screen): + def __init__(self, **kw): + super().__init__(**kw) + + font = PATH_TITLE_FONT + path_images = PATH_IMAGES + counter_precious_stones = StringProperty("") + number_cols = 7 + spacing = global_spacing["horizontal"] + label_height = 40 * 7 * Window.size[1] / 2340 + padding = [0.05 * Window.size[0], 0, 0.05 * Window.size[0], 0] + path_back_image = PATH_IMAGES + "collection_background.png" + font_ratio = NumericProperty(0) + width_back_image = ObjectProperty(Window.size[0]) + height_back_image = ObjectProperty(Window.size[0] * 392 / 632) + + def init_screen(self): + self.font_ratio = Window.size[0]/800 + self.width_back_image = Window.size[0] + self.height_back_image = Window.size[0] * 392 / 632 + self.label_height = 40 * 7 * Window.size[1] / 2340 + self.padding = [0.05 * Window.size[0], 0, 0.05 * Window.size[0], 0] + self.ids.my_sv_layout.reset_screen() + number_precious_stones = 0 + for stone in my_collection.dict_collection: + if my_collection.dict_collection[stone]: + number_precious_stones += 1 + number_total_precious_stones = len( + my_collection.dict_collection.keys()) + self.counter_precious_stones = str(number_precious_stones) + " / " + str( + number_total_precious_stones) + self.build_scroll_view() + + def build_scroll_view(self): + TEXTURE_DICT = load_textures_from_atlas("map_textures") + image_dimension = (Window.size[0] - 2 * self.padding[0] - self.spacing * ( + self.number_cols - 1)) / self.number_cols + height_layout = image_dimension + self.label_height + for code_precious_stone in DICT_TREASURE_STONES: + name_image = DICT_TREASURE_STONES[code_precious_stone] + if my_collection.dict_collection[name_image]: + relative_layout = RelativeLayout( + size_hint=(None, None), + height=height_layout, + width=image_dimension + ) + # Label for the name of the gallery + name_displayed = name_image + if name_image == "Tiger eye": + name_displayed = "Tiger's eye" + name_label = Label( + size_hint=(None, None), + width=image_dimension, + height=self.label_height, + color=self.manager.color_label, + text=name_displayed, + pos_hint={"x": 0, "y": 0}, + font_name=self.font, + font_size=25*self.font_ratio + ) + relative_layout.add_widget(name_label) + # Image + image = Image( + size_hint=(None, None), + width=image_dimension, + height=image_dimension, + texture=TEXTURE_DICT[DICT_TREASURE_STONES[code_precious_stone]], + allow_stretch=True, + y=self.label_height + ) + relative_layout.add_widget(image) + self.ids.my_sv_layout.add_widget(relative_layout) diff --git a/screens/game_over.py b/screens/game_over.py new file mode 100644 index 0000000..29ea5fe --- /dev/null +++ b/screens/game_over.py @@ -0,0 +1,43 @@ +""" +Module for the game over screen +""" + + +from kivy.uix.screenmanager import Screen +from kivy.clock import Clock +from tools.tools_constants import ( + PATH_TITLE_FONT, + PATH_IMAGES, + FPS, + OPACITY_RATE, + Window +) +from kivy.properties import StringProperty, ObjectProperty, NumericProperty +from tools.tools_sound import music_mixer + + +class GameOverScreen(Screen): + def __init__(self, **kw): + super().__init__(**kw) + + font = PATH_TITLE_FONT + path_back_image = PATH_IMAGES + "game_over_background.png" + width_back_image = ObjectProperty(Window.size[0]) + height_back_image = ObjectProperty(Window.size[0] * 392 / 632) + opacity_state = - 1 + font_ratio = NumericProperty(0) + score_str = StringProperty("") + + def init_screen(self, *args): + self.font_ratio = Window.size[0]/800 + self.width_back_image = Window.size[0] + self.height_back_image = Window.size[0] * 392 / 632 + music_mixer.play("game_over_music", loop=True) + score_str = f"Score: {int(args[0])}" + self.ids.score_label.text = score_str + Clock.schedule_interval(self.update, 1 / FPS) + + def update(self, *args): + self.ids.back_to_menu.opacity += self.opacity_state * OPACITY_RATE + if self.ids.back_to_menu.opacity < 0 or self.ids.back_to_menu.opacity > 1: + self.opacity_state = -self.opacity_state diff --git a/screens/menu.py b/screens/menu.py new file mode 100644 index 0000000..769744f --- /dev/null +++ b/screens/menu.py @@ -0,0 +1,69 @@ +""" +Module for the main menu +""" + + +from kivy.uix.screenmanager import Screen +from kivy.clock import Clock +from kivy.properties import ( + StringProperty, + BooleanProperty, + ObjectProperty, + NumericProperty +) + +from tools.tools_constants import ( + PATH_IMAGES, + FPS, + OPACITY_RATE, + PATH_TITLE_FONT, + MOBILE_MODE, + my_collection, + Window +) +from tools.tools_sound import music_mixer + + +class MenuScreen(Screen): + def __init__(self, **kw): + super().__init__(**kw) + + self.opacity_state = -1 + + path_images = PATH_IMAGES + font = PATH_TITLE_FONT + path_back_image = PATH_IMAGES + "menu_background.png" + font_ratio = NumericProperty(0) + width_back_image = ObjectProperty(Window.size[0]) + height_back_image = ObjectProperty(Window.size[0] * 392 / 632) + mobile_mode = BooleanProperty(True) + high_score = StringProperty("") + + def init_screen(self): + self.mobile_mode = MOBILE_MODE + self.font_ratio = Window.size[0]/800 + self.width_back_image = Window.size[0] + self.height_back_image = Window.size[0] * 392 / 632 + self.high_score = "High score: " + str(my_collection.high_score) + if music_mixer.musics["title_music"].state != "play": + music_mixer.play("title_music", loop=True) + + try: + if MOBILE_MODE: + self.remove_widget(self.ids.settings_logo) + self.remove_widget(self.ids.settings_button) + else: + self.remove_widget(self.ids.high_score_label) + except: + pass + + try: + Clock.unschedule(self.update) + except: + pass + Clock.schedule_interval(self.update, 1 / FPS) + + def update(self, *args): + self.ids.start_label.opacity += self.opacity_state * OPACITY_RATE + if self.ids.start_label.opacity < 0 or self.ids.start_label.opacity > 1: + self.opacity_state = -self.opacity_state diff --git a/screens/settings.py b/screens/settings.py new file mode 100644 index 0000000..bc0d8cd --- /dev/null +++ b/screens/settings.py @@ -0,0 +1,114 @@ +""" +Module for the settings menu +""" + + +from kivy.uix.screenmanager import Screen +from kivy.properties import StringProperty, ObjectProperty, NumericProperty +from tools.tools_constants import ( + PATH_TITLE_FONT, + DICT_KEYS, + INTERACT, + PATH_SETTINGS, + SETTINGS, + PATH_IMAGES, + my_collection, + Window +) +from tools.tools_basis import ( + save_json_file +) + + +class SettingsScreen(Screen): + def __init__(self, **kw): + super().__init__(**kw) + + path_images = PATH_IMAGES + font = PATH_TITLE_FONT + high_score = StringProperty("") + top_key = StringProperty() + left_key = StringProperty("") + bottom_key = StringProperty("") + right_key = StringProperty("") + interact_key = StringProperty("") + path_back_image = PATH_IMAGES + "settings_background.png" + font_ratio = NumericProperty(0) + width_back_image = ObjectProperty(Window.size[0]) + height_back_image = ObjectProperty(Window.size[0] * 392 / 632) + + def init_screen(self): + self.font_ratio = Window.size[0]/800 + self.width_back_image = Window.size[0] + self.height_back_image = Window.size[0] * 392 / 632 + self.high_score = "High score: " + str(my_collection.high_score) + self.top_key = DICT_KEYS["top"] + self.left_key = DICT_KEYS["left"] + self.bottom_key = DICT_KEYS["bottom"] + self.right_key = DICT_KEYS["right"] + self.interact_key = DICT_KEYS[INTERACT] + self._keyboard = Window.request_keyboard( + self._keyboard_closed, self, 'text') + self._keyboard.bind(on_key_up=self.update_on_key_up) + self.current_button = None + + def select_next_key(self, type_input): + dict_buttons = { + "top": [self.ids.top_button, self.ids.top_key_input], + "left": [self.ids.left_button, self.ids.left_key_input], + "bottom": [self.ids.bottom_button, self.ids.bottom_key_input], + "right": [self.ids.right_button, self.ids.right_key_input], + INTERACT: [self.ids.interact_button, self.ids.interact_key_input] + } + for key in dict_buttons: + if key == type_input: + self.current_button = dict_buttons[key][0] + dict_buttons[key][1].text = "Press new key" + else: + dict_buttons[key][1].text = DICT_KEYS[key] + + def update_on_key_up(self, keyboard, keycode): + """ + Update the the list of keys pressed when the key is up. + + Parameters + ---------- + keyboard + + keycode: int + Integer representing the key pressed by the user + + Returns + ------- + None + """ + global DICT_KEYS, SETTINGS + dict_widgets = { + self.ids.top_button: [self.ids.top_key_input, "top"], + self.ids.left_button: [self.ids.left_key_input, "left"], + self.ids.bottom_button: [self.ids.bottom_key_input, "bottom"], + self.ids.right_button: [self.ids.right_key_input, "right"], + self.ids.interact_button: [self.ids.interact_key_input, INTERACT], + } + if self.current_button is not None: + dict_widgets[self.current_button][0].text = keycode[1] + DICT_KEYS[dict_widgets[self.current_button][1]] = keycode[1] + SETTINGS["keys"] = DICT_KEYS + save_json_file(PATH_SETTINGS, SETTINGS) + self.current_button = None + + def _keyboard_closed(self): + """ + Unbind the keyboard. + + Parameters + ---------- + None + + Returns + ------- + None + """ + if self._keyboard is not None: + self._keyboard.unbind(on_key_up=self.update_on_key_up) + self._keyboard = None diff --git a/tools/__init__.py b/tools/__init__.py new file mode 100644 index 0000000..3e7866d --- /dev/null +++ b/tools/__init__.py @@ -0,0 +1,20 @@ +""" +Tools package of the application. + +Modules +------- +tools_basis + Module containing basis functions. + +tools_constants + Module referencing the main constants of the application. + +tools_kivy + Module for general Kivy widgets and functions. + +tools_settings + Module dealing with the settings of the application. +""" + +from tools.tools_basis import * +from tools.tools_constants import * diff --git a/tools/tools_basis.py b/tools/tools_basis.py new file mode 100644 index 0000000..9d6408b --- /dev/null +++ b/tools/tools_basis.py @@ -0,0 +1,64 @@ +""" +Module containing basis functions. + +Functions +--------- +load_json_file + Load a json file, according the specified path. + +save_json_file + Save the content of the given dictionnary inside the specified json file. +""" + + +############### +### Imports ### +############### + + +### Python imports ### + +import json + + +################# +### Functions ### +################# + + +def load_json_file(file_path: str) -> dict: + """ + Load a json file, according the specified path. + + Parameters + ---------- + file_path : str + Path of the json file + + Returns + ------- + dict + Content of the json file + """ + with open(file_path, "r", encoding="utf-8") as file: + res = json.load(file) + return res + +def save_json_file(file_path: str, dict_to_save: dict) -> None: + """ + Save the content of the given dictionnary inside the specified json file. + + Parameters + ---------- + file_path : str + Path of the json file + + dict_to_save : dict + Dictionnary to save + + Returns + ------- + None + """ + with open(file_path, "w", encoding="utf-8") as file: + json.dump(dict_to_save, file, indent=4) diff --git a/tools/tools_constants.py b/tools/tools_constants.py new file mode 100644 index 0000000..e724d01 --- /dev/null +++ b/tools/tools_constants.py @@ -0,0 +1,317 @@ +""" +Module referencing the main constants of the application. + +Constants +--------- +__version__ : str + Version of the application. + +MOBILE_MODE : bool + Whether the application is launched on mobile or not. + +APPLICATION_NAME : str + Name of the application. + +PATH_DATA_FOLDER : str + Path to the data folder. + +PATH_SETTINGS : str + Path to the json file of settings. + +PATH_RESOURCES_FOLDER : str + Path to the resources folder. + +PATH_LANGUAGE : str + Path to the folder where are stored the json files of language. + +PATH_APP_IMAGES : str + Path to the folder where are stored the images for the application. + +PATH_KIVY_FOLDER : str + Path to the folder where are stored the different kv files. + +DICT_LANGUAGE_FONT : dict + Dictionary associating the code of language to the font. + +DICT_LANGUAGE_CORRESPONDANCE : dict + Dictionary associating the language to its code. +""" + + +############### +### Imports ### +############### + + +import math + +### Kivy imports ### + +from kivy import platform +from kivy.config import Config +from kivy.graphics import Color +from kivy.core.window import Window + + +from tools.tools_basis import ( + load_json_file, + save_json_file +) + + +################# +### Constants ### +################# + + +### Version ### + +__version__ = "1.1.0" + +### Mode ### + +MOBILE_MODE = platform == "android" +# MOBILE_MODE = True +DEBUG_MODE = False + +### Kivy parameters ### + +FPS = 30 +OPACITY_RATE = 0.02 +MSAA_LEVEL = 4 + +Config.set("graphics", "maxfps", FPS) +Config.set("graphics", "multisamples", MSAA_LEVEL) + +### Paths ### + +APPLICATION_NAME = "world_explorer" + +PATH_DATA_FOLDER = "data/" +PATH_SETTINGS = PATH_DATA_FOLDER + "settings.json" + +PATH_RESOURCES_FOLDER = "resources/" +PATH_LANGUAGE = PATH_RESOURCES_FOLDER + "languages/" +PATH_IMAGES = PATH_RESOURCES_FOLDER + "images/" +PATH_MAP_TEXTURES = PATH_IMAGES + "map_textures/" +PATH_ATLAS = PATH_RESOURCES_FOLDER + "atlas/" +PATH_KIVY_FOLDER = PATH_RESOURCES_FOLDER + "kivy/" +PATH_MAPS = PATH_RESOURCES_FOLDER + "maps/" +PATH_CHARACTER_IMAGES = PATH_IMAGES + "ghost_textures/" +PATH_LOGO = PATH_RESOURCES_FOLDER + "start_logo/" +PATH_SOUNDS = PATH_RESOURCES_FOLDER + "sounds/" +PATH_MUSICS = PATH_RESOURCES_FOLDER + "musics/" +PATH_FONTS = PATH_RESOURCES_FOLDER + "fonts/" +PATH_TITLE_FONT = PATH_FONTS + "enchanted_land/Enchanted Land.otf" + +### Language ### + +DICT_LANGUAGE_FONT = { + "french": "Roboto", + "english": "Roboto", + "german": "Roboto", + "italian": "Roboto", + "spanish": "Roboto", + "japanese": "resources/fonts/ShinGoPr5.otf" +} + +DICT_LANGUAGE_CORRESPONDANCE = { + "french": "Français", + "english": "English", + "german": "Deutsch", + "italian": "Italiano", + "spanish": "Español", + "japanese": "Japanese" +} + +################ +### SETTINGS ### +################ + + +MOVE = "MOVE" +STOP = "STOP" +INTERACT = "INTERACT" + +SPACE_KEY = "spacebar" +SETTINGS = load_json_file(PATH_SETTINGS) +INTERACT_KEY = SETTINGS["keys"][INTERACT] +DICT_KEYS = SETTINGS["keys"] + + +class MyCollection(): + def __init__(self) -> None: + self.dict_collection = SETTINGS["collection"] + self.high_score = SETTINGS["high_score"] + + def find_new_stone(self, stone_name): + self.dict_collection[DICT_TREASURE_STONES[stone_name]] = True + SETTINGS["collection"] = self.dict_collection + save_json_file(PATH_SETTINGS, SETTINGS) + + def update_high_score(self, score): + if self.high_score < score: + self.high_score = score + SETTINGS["high_score"] = self.high_score + save_json_file(PATH_SETTINGS, SETTINGS) + + +my_collection = MyCollection() + +###################### +### World explorer ### +###################### + + +### Display ### + +# Display parameters +CASES_ON_WIDTH = 8 +CHARACTER_SCALE = 0.75 +AUTOREMOVE_DELAY = 5 + +INC_TILE_SIZE_RATIO = 1.005 + + +# Dictionary of textures +DICT_TILES_TEXTURE = { + "G": ["ground"], + "R": ["rock1", "rock2", "rock3"], + "C": ["crystal"], + "b": ["beacon"], + "B": ["beacon_off"], + "O": ["blank"] +} + +DICT_TREASURE_STONES = { + "Ag": "Agate", + "Am": "Amber", + "Ay": "Amethyst", + "Av": "Aventurine", + "Az": "Azurite", + "Ci": "Citrine", + "Di": "Diamond", + "Em": "Emerald", + "Fl": "Fluorine", + "Ga": "Garnet", + "Ja": "Jade", + "Ll": "Lapis lazuli", + "Ma": "Malachite", + "Ob": "Obsidian", + "On": "Onyx", + "Op": "Opal", + "Qu": "Rose quartz", + "Ru": "Ruby", + "Sa": "Sapphire", + "Ti": "Tiger eye", + "Tu": "Turquoise" +} + +### Movements ### + +SQUARE_TWO = math.sqrt(2) + +# Speed of the character when moving +SPEED = 0.08 + +DICT_ORIENTATIONS = { + "top": "back", + "bottom": "front", + "right": "right", + "left": "left" +} +DICT_DISPLAY_ORIENTATIONS = { + "top": "back", + "bottom": "front", + "right": "right", + "left": "left", + "left_bottom": "left_front", + "right_bottom": "right_front", + "left_top": "left_back", + "right_top": "right_back", +} + +# Dictionary indicating the different interactions between elements +DICT_TILES_MOVEMENT = { + "G": [MOVE], + "C": [INTERACT, MOVE], + "R": [STOP], + "B": [INTERACT, STOP], + "b": [INTERACT, STOP], + None: [STOP], + "Ag": [INTERACT, MOVE], + "Am": [INTERACT, MOVE], + "Ay": [INTERACT, MOVE], + "Av": [INTERACT, MOVE], + "Az": [INTERACT, MOVE], + "Ci": [INTERACT, MOVE], + "Di": [INTERACT, MOVE], + "Em": [INTERACT, MOVE], + "Fl": [INTERACT, MOVE], + "Ga": [INTERACT, MOVE], + "Ja": [INTERACT, MOVE], + "Ll": [INTERACT, MOVE], + "Ma": [INTERACT, MOVE], + "Ob": [INTERACT, MOVE], + "On": [INTERACT, MOVE], + "Op": [INTERACT, MOVE], + "Qu": [INTERACT, MOVE], + "Ru": [INTERACT, MOVE], + "Sa": [INTERACT, MOVE], + "Ti": [INTERACT, MOVE], + "Tu": [INTERACT, MOVE] +} + +MAX_TIME_IN_DARK = 10 +CHARACTER_MOVEMENT = 5 + + +################ +### Tutorial ### +################ + + +WAIT_FRAMES = 15 +FRAMES_LATERAL = 5 + + +###################### +### Map generation ### +###################### + + +MAP_SIZE = 10 +CRYSTAL_PROBABILITY = 0.04 +PRECIOUS_STONE_PROBABILITY = 0.02 +NUMBER_CASES_DIGGER = 4 +NUMBER_TRIALS = 6 + + +############## +### Colors ### +############## + +NB_DARK_CIRCLES = 8 +DARKNESS_LIST = [Color(0.0, 0.0, 0.0, 1.0 - i * 0.7 / (NB_DARK_CIRCLES - 1)) + for i in range(NB_DARK_CIRCLES)] + +DARKNESS_COLOR_BACK = Color(0.0, 0.0, 0.0, 0.3) +MAX_CRYSTALS = 2 +RATE_DIMINUTION_LIGHT = 0.02 +RATE_DIMINUTION_LIGHT_AUGMENTATION = 0.0025 +RATE_AUGMENTATION_LIGHT_DISPLAY = 1.0 # per crystal +START_BEACON_CASES = 3 +MAX_INTENSITY = 100 + +############# +### Sound ### +############# + +SOUND_VOLUME = 0.5 +MUSIC_VOLUME = 0.5 + +SOUND_RADIUS_CRYSTAL = 3 +SOUND_RADIUS_BEACON = 3 +PROBABILITY_WATER_DROPS = 0.005 + +GAME_OVER_FREEZE_TIME = 2 diff --git a/tools/tools_effect.py b/tools/tools_effect.py new file mode 100644 index 0000000..187f5e7 --- /dev/null +++ b/tools/tools_effect.py @@ -0,0 +1,60 @@ +""" +Module to create visual effects with kivy +""" + +from kivy.uix.widget import Widget +from kivy.graphics import Line, Rectangle + + +from tools.tools_constants import ( + DARKNESS_LIST, + DARKNESS_COLOR_BACK, + NB_DARK_CIRCLES, + MAP_SIZE, + Window, + CASES_ON_WIDTH +) + + +def change_window_size(*args): + global WINDOW_SIZE, SCREEN_RATIO, TILE_SIZE + + # Compute the size of one tile in pixel + WINDOW_SIZE = Window.size + SCREEN_RATIO = WINDOW_SIZE[0] / WINDOW_SIZE[1] + TILE_SIZE = WINDOW_SIZE[0] / CASES_ON_WIDTH + + +Window.bind(on_resize=change_window_size) +change_window_size() + + +class AmbientDarkness(Widget): + def __init__(self, **kwargs): + super().__init__(**kwargs) + self.canvas.add(DARKNESS_COLOR_BACK) + self.canvas.add(Rectangle(pos=(0, 0), size=( + WINDOW_SIZE[0], WINDOW_SIZE[1]))) + + +class CircleDarkness(Widget): + def __init__(self, radius, **kwargs): + super().__init__(**kwargs) + self.radius = radius + self.radius_line = MAP_SIZE * TILE_SIZE * 2 + self.update() + self.draw() + + def change_radius(self, new_radius): + self.radius = new_radius + self.update() + + def update(self): + self.line_width = self.radius_line - self.radius * TILE_SIZE + + def draw(self): + self.canvas.clear() + for i in range(NB_DARK_CIRCLES): + self.canvas.add(DARKNESS_LIST[i]) + self.canvas.add( + Line(circle=(self.x, self.y, self.radius_line), width=self.line_width + TILE_SIZE * 0.5 * i / (NB_DARK_CIRCLES - 1))) diff --git a/tools/tools_kivy.py b/tools/tools_kivy.py new file mode 100644 index 0000000..7b52c61 --- /dev/null +++ b/tools/tools_kivy.py @@ -0,0 +1,409 @@ +""" +Module for general Kivy widgets and functions. +""" + +############### +### Imports ### +############### + + +### Kivy imports ### + +from kivy.metrics import dp +from kivy.uix.button import Button +from kivy.uix.image import Image +from kivy.uix.textinput import TextInput +from kivy.uix.label import Label +from kivy.uix.progressbar import ProgressBar +from kivy.uix.checkbox import CheckBox +from kivy.uix.spinner import Spinner +from kivy.uix.popup import Popup +from kivy.uix.floatlayout import FloatLayout +from kivy.uix.gridlayout import GridLayout +from kivy.uix.behaviors import FocusBehavior +from kivy.core.window import Window +from kivy.clock import Clock +from kivy.properties import StringProperty, ObjectProperty +from kivy.compat import string_types +from kivy.factory import Factory + +### Python imports ### + +from functools import partial + +### Modules imports ### + +from tools.tools_constants import ( + PATH_KIVY_FOLDER +) +my_language = {} + + +######################## +### Global Variables ### +######################## + + +### Kivy theme ### + +window_size = Window.size +#window_size = (900, 500) +size_popup = (int(window_size[0] / 1.2), int(window_size[1] / 2)) +global_spacing = { + "horizontal": window_size[0] / 50, + "vertical": window_size[1] / 50 +} +background_color = (70 / 255, 65 / 255, 62 / 255, 1) +color_label = (254 / 255, 195 / 255, 3 / 255, 1) +color_label_popup = (1, 1, 1, 1) +blue_color = (70 / 255, 130 / 255, 180 / 255, 1) +pink_color = (229 / 255, 19 / 255, 100 / 255, 1) +highlight_text_color = (229 / 255, 19 / 255, 100 / 255, 0.5) + +scale_image = 3 * window_size[1] / 2340 + + +##################### +### Popup windows ### +##################### + + +def blank_function(*args, **kwargs): + """ + Function that does nothing + """ + pass + + +class ImprovedPopupLayout(FloatLayout): + """ + Class used to make the background of the popup with the pink line + """ + + def __init__(self, **kwargs): + super().__init__(**kwargs) + pink_color = pink_color + blue_color = blue_color + size_popup = size_popup + + +class ImprovedPopup(Popup): + """ + Class used to easily create popups + """ + + def __init__(self, title="Popup", size_hint=(None, None), auto_dismiss=False, add_content=[], size=size_popup, font="Roboto"): + + # Initialisation du layout contenant les objets du popup + self.layout = ImprovedPopupLayout() + # Initialisation du popup par héritage + super().__init__(title=title, size_hint=size_hint, + auto_dismiss=auto_dismiss, content=self.layout, size=size, title_font=font) + # Ajout du bouton de fermeture + self.add_close_button() + # Ajout des composants voulus + correspondance_list = [ + ("label", self.add_label), + ("text_input", self.add_text_input), + ("spinner", self.add_spinner), + ("progress_bar", self.add_progress_bar), + ("button", self.add_button), + ("widget", self.add_other_widget) + ] + for instruction in add_content: + for i in range(len(correspondance_list)): + if instruction[0] == correspondance_list[i][0]: + correspondance_list[i][1](**instruction[1]) + # Ouverture du popup + self.open() + + def add_close_button(self): + pos_hint = {"right": 1, "y": 1 + 8 / self.height} + size = (dp(32), dp(32)) + size_hint = (None, None) + close_button = Button( + background_color=(0, 0, 0, 0), + pos_hint=pos_hint, + size_hint=size_hint, + size=size + ) + close_button.on_release = self.dismiss + close_button_image = Image( + source=PATH_KIVY_FOLDER + "images/close_button.png", + pos_hint=pos_hint, + size_hint=size_hint, + size=size + ) + self.layout.add_widget(close_button) + self.layout.add_widget(close_button_image) + + def add_label(self, text="", size_hint=(0.6, 0.2), pos_hint={"x": 0.2, "top": 0.9}, bool_text_size=False, **kwargs): + label = Label( + text=text, + size_hint=size_hint, + pos_hint=pos_hint, + shorten=False, + text_size=( + int(size_hint[0] * Window.size[0] * 0.95), None), + **kwargs) + if bool_text_size: + label.text_size = label.size + label.halign = "left" + label.valign = "center" + else: + label.halign = "center" + self.layout.add_widget(label) + return label + + def add_text_input(self, text="", pos_hint={"x": 0.1, "top": 0.7}, size_hint=(0.8, 0.2), multiline=False, **kwargs): + text_input = TextInput(text=text, + size_hint=size_hint, + pos_hint=pos_hint, + selection_color=highlight_text_color, + multiline=multiline, **kwargs) + self.layout.add_widget(text_input) + + def add_spinner(self, text="Spinner", values=["Spin 1", "Spin 2"], size_hint=(0.6, 0.2), pos_hint={"x": 0.2, "top": 0.7}, halign="center", **kwargs): + spinner = Spinner(text=text, + values=values, + size_hint=size_hint, + pos_hint=pos_hint, + halign=halign, **kwargs) + self.layout.add_widget(spinner) + + def add_progress_bar(self, max=100, pos_hint={"center_x": 0.5, "top": 0.85}, size_hint=(0.5, 0.25), **kwargs): + progress_bar = ProgressBar( + max=max, + pos_hint=pos_hint, + size_hint=size_hint, + **kwargs) + # Set progress_bar as property in order to change its value later on + self.progress_bar = progress_bar + self.layout.add_widget(progress_bar) + return progress_bar + + def add_button(self, text="", disabled=False, size_hint=(0.8, 0.2), pos_hint={"x": 0.1, "top": 0.45}, halign="center", on_release=blank_function, **kwargs): + button = FocusableButton( + text=text, + size_hint=size_hint, + pos_hint=pos_hint, + halign=halign, + disabled=disabled, + **kwargs) + button.on_release = on_release + self.layout.add_widget(button) + return button + + def add_checkbox(self, text="", color_label=color_label_popup, + size_hint_cb=(0.05, 0.05), pos_hint={"x": 0.1, "y": 0}, + group=None, size_hint_label=(0.05, 0.1), + function_cb=blank_function, + disabled=False, **kwargs): + checkbox = LabelledCheckBox( + text_label=text, + color_label=color_label, + size_hint_label=size_hint_label, + size_hint_cb=size_hint_cb, + pos_hint=pos_hint, + group=group, + function_cb=function_cb, + disabled=disabled, + **kwargs) + self.layout.add_widget(checkbox) + return checkbox + + def add_other_widget(self, widget_class, **kwargs): + widget = widget_class(**kwargs) + self.layout.add_widget(widget) + return widget + + +# def create_standard_popup(title_popup, message, button_message=my_language.dict_buttons["close"]): +# popup_content = [ +# ("label", { +# "text": message, +# "pos_hint": {"x": 0.1, "y": 0.6}, +# "size_hint": (0.8, 0.15) +# }) +# ] +# popup = ImprovedPopup( +# title=title_popup, +# add_content=popup_content) +# button = popup.add_button( +# text=button_message, +# pos_hint={"x": 0.2, "y": 0.25}, +# size_hint=(0.6, 0.15) +# ) +# button.on_release = popup.dismiss +# button.focus = True + + +#################### +### Scroll views ### +#################### + + +class MyScrollViewLayout(GridLayout): + """ + Class corresponding to the layout inside the scroll view + """ + + def __init__(self, **kwargs): + super(MyScrollViewLayout, self).__init__(**kwargs) + self.size_hint_y = (None) + self.bind(minimum_height=self.setter('height')) + + def reset_screen(self): + list_widgets = self.children[:] + for element in list_widgets: + self.remove_widget(element) + + +####################### +### Focusable items ### +####################### + + +class FocusableSpinner(FocusBehavior, Spinner): + def __init__(self, **kwargs): + super().__init__(**kwargs) + + def on_is_open(self, instance, value): + if self.is_open: + self._dropdown.clear_widgets() + for value in self.values: + btn = FocusableButton( + text=value, + size_hint_y=None, + height=self.height, + font_name=self.font_name + ) + btn.on_release = partial(self.on_button_press, btn) + self._dropdown.add_widget(btn) + return super().on_is_open(instance, value) + + def on_button_press(self, button): + self._dropdown.select(button.text) + + def keyboard_on_key_down(self, window, keycode, text, modifiers): + key = keycode[-1] + if key in ("spacebar", "enter"): + self.is_open = not self.is_open + if self.is_open: + self._dropdown.children[0].children[-1].focus = True + + return super(FocusableSpinner, self).keyboard_on_key_down(window, keycode, text, modifiers) + + +class ToolTip(Label): + pass + + +class FocusableButton(FocusBehavior, Button): + tooltip_text = StringProperty('') + tooltip_cls = ObjectProperty(ToolTip) + + def __init__(self, scroll_to=False, **kwargs): + self._tooltip = None + self.scroll_to = scroll_to + super().__init__(**kwargs) + fbind = self.fbind + fbind('tooltip_cls', self._build_tooltip) + fbind('tooltip_text', self._update_tooltip) + Window.bind(mouse_pos=self.on_mouse_pos) + self._build_tooltip() + + def _build_tooltip(self, *largs): + if self._tooltip: + self._tooltip = None + cls = self.tooltip_cls + if isinstance(cls, string_types): + cls = Factory.get(cls) + self._tooltip = cls() + self._update_tooltip() + + def _update_tooltip(self, *largs): + self._tooltip.text = self.tooltip_text + + def keyboard_on_key_down(self, window, keycode, text, modifiers): + key = keycode[-1] + if key in ("spacebar", "enter"): + self.on_release() + + return super(FocusableButton, self).keyboard_on_key_down(window, keycode, text, modifiers) + + def on_mouse_pos(self, *args): + if self.tooltip_text != "": + if not self.get_root_window(): + return + pos = args[1] + self._tooltip.pos = pos + # cancel scheduled event since I moved the cursor + Clock.unschedule(self.display_tooltip) + self.close_tooltip() # close if it's opened + if self.collide_point(*self.to_widget(*pos)): + Clock.schedule_once(self.display_tooltip, 1) + + def close_tooltip(self, *args): + Window.remove_widget(self._tooltip) + + def display_tooltip(self, *args): + Window.add_widget(self._tooltip) + + def _on_focus(self, instance, value, *largs): + if self.scroll_to: + if (self.parent.number_lines + 1) * self.parent.size_line > self.parent.parent.height: + self.parent.parent.scroll_to(self) + return super()._on_focus(instance, value, *largs) + + +class FocusableCheckBox(FocusBehavior, CheckBox): + def __init__(self, scroll_to=False, **kwargs): + self.scroll_to = scroll_to + super().__init__(**kwargs) + + def keyboard_on_key_down(self, window, keycode, text, modifiers): + key = keycode[-1] + if key in ("spacebar", "enter"): + self.active = not self.active + return super(FocusableCheckBox, self).keyboard_on_key_down(window, keycode, text, modifiers) + + def _on_focus(self, instance, value, *largs): + if self.scroll_to: + if (self.parent.number_lines + 1) * self.parent.size_line > self.parent.parent.height: + self.parent.parent.scroll_to(self) + return super()._on_focus(instance, value, *largs) + + +class LabelledCheckBox(FloatLayout): + def __init__(self, text_label="", + size_hint_label=(0.05, 0.1), + color_label=(0, 0, 0, 1), + pos_hint={"x": 0, "y": 0}, + size_hint_cb=(0.05, 0.05), + function_cb=blank_function, + disabled=False, + group=None, **kwargs): + self.text_label = text_label + self.size_hint_label = size_hint_label + self.color_label = color_label + self.pos_hint = pos_hint + self.size_hint_cb = size_hint_cb + self.function_cb = function_cb + self.group = group + self.disabled_cb = disabled + super().__init__(**kwargs) + + +class FocusableTextInput(TextInput): + def __init__(self, scroll_to=False, **kwargs): + self.scroll_to = scroll_to + self.write_tab = False + super().__init__(**kwargs) + self.last_value = self.text + + def _on_focus(self, instance, value, *largs): + if self.scroll_to: + if (self.parent.number_lines + 1) * self.parent.size_line > self.parent.parent.height: + self.parent.parent.scroll_to(self) + return super()._on_focus(instance, value, *largs) diff --git a/tools/tools_kivy_mobile.py b/tools/tools_kivy_mobile.py new file mode 100644 index 0000000..ef439d9 --- /dev/null +++ b/tools/tools_kivy_mobile.py @@ -0,0 +1,197 @@ +""" + +""" + + +############### +### Imports ### +############### + +### Python imports ### + +from math import sin, cos, asin, acos, sqrt, pi, pow, ceil + +### Kivy imports ### + +from kivy.graphics import Rectangle, Color, Line +from kivy.uix.relativelayout import RelativeLayout +from kivy.uix.widget import Widget + +### Module imports ### + +from tools.tools_constants import ( + Window +) + + +def change_window_size(*args): + global WINDOW_SIZE, SCREEN_RATIO + + # Compute the size of one tile in pixel + WINDOW_SIZE = Window.size + SCREEN_RATIO = WINDOW_SIZE[0] / WINDOW_SIZE[1] + + +Window.bind(on_resize=change_window_size) +change_window_size() + + +def apply_boundaries(x, min_x, max_x): + if x > max_x: + return max_x + if x < min_x: + return min_x + return x + + +def norm(x, y): + return sqrt(pow(x, 2) + pow(y, 2)) + + +TRANSPARENT_WHITE = Color(1.0, 1.0, 1.0, .5) +HIGH_TRANSPARENT_WHITE = Color(1.0, 1.0, 1.0, .3) + +##################################### +### Classes for controls on mobil ### +##################################### + + +class MobileJoystick(): + def __init__(self, layout: RelativeLayout): + self.center_x = 0.15 + self.center_y = 0.2 + self.width = 0.12 + self.height = 0.12 + self.extension_factor = 2 + self.is_active = False + self.widget = Widget(pos_hint={"center_x": self.center_x, "center_y": self.center_y}, size_hint=( + self.width * self.extension_factor, self.height * self.extension_factor * SCREEN_RATIO)) + layout.add_widget(self.widget) + self.back_to_zero() + self.widget.bind(on_touch_move=self.on_touch_move) + self.widget.bind(on_touch_down=self.on_touch_down) + self.widget.bind(on_touch_up=self.on_touch_up) + self.draw() + + def on_touch_move(self, el, touch): + if touch.x < WINDOW_SIZE[0] // 2: + self.x = touch.x + self.y = touch.y + + def on_touch_down(self, el, touch): + if touch.x < WINDOW_SIZE[0] // 2: + self.is_active = True + + def on_touch_up(self, el, touch): + if touch.x < WINDOW_SIZE[0] // 2: + self.is_active = False + self.back_to_zero() + self.draw() + + def back_to_zero(self): + self.x = self.center_x * WINDOW_SIZE[0] + self.y = self.center_y * WINDOW_SIZE[1] + + def draw(self): + self.widget.pos_hint = { + "center_x": self.center_x, "center_y": self.center_y} + self.widget.size_hint = (self.width * self.extension_factor, + self.height * self.extension_factor * SCREEN_RATIO) + self.widget.canvas.clear() + # Réglage de la couleur + self.widget.canvas.add(TRANSPARENT_WHITE) + # Affichage du cercle extérieur + self.main_center_x = self.center_x * WINDOW_SIZE[0] + self.main_center_y = self.center_y * WINDOW_SIZE[1] + main_radius = self.width * WINDOW_SIZE[1] + self.norme_cercle = main_radius + self.widget.canvas.add( + Line(circle=(self.main_center_x, self.main_center_y, main_radius), width=5)) + # Affichage du cercle intérieur + max_x = self.main_center_x + main_radius + min_x = self.main_center_x - main_radius + self.in_center_x = apply_boundaries(self.x, min_x, max_x) + max_y = self.main_center_y + main_radius + min_y = self.main_center_y - main_radius + self.in_center_y = apply_boundaries(self.y, min_y, max_y) + in_radius = main_radius // 2 + self.widget.canvas.add( + Line(circle=(self.in_center_x, self.in_center_y, in_radius), width=3)) + + def get_direction(self): + if not (self.is_active): + return 0, 0 + else: + diff_x = apply_boundaries( + self.x - self.main_center_x, -self.norme_cercle, self.norme_cercle) + diff_y = apply_boundaries( + self.y - self.main_center_y, -self.norme_cercle, self.norme_cercle) + norme = norm(diff_x, diff_y) + if norme > 0: + return diff_x / norme, diff_y / norme + else: + return 0, 0 + + def recursive_update(self): + self.draw() + + +class MobileButton(): + def __init__(self, layout: RelativeLayout): + self.center_x = 0.85 + self.center_y = 0.2 + self.width = 0.12 + self.height = 0.12 + self.extension_factor = 2 + self.is_active = False + self.last_state = True + self.widget = Widget(pos_hint={"center_x": self.center_x, "center_y": self.center_y}, size_hint=( + self.width * self.extension_factor, self.height * self.extension_factor * SCREEN_RATIO)) + layout.add_widget(self.widget) + self.widget.bind(on_touch_move=self.on_touch_move) + self.widget.bind(on_touch_down=self.on_touch_down) + self.widget.bind(on_touch_up=self.on_touch_up) + self.draw() + + def get_state(self): + return self.is_active + + def on_touch_move(self, el, touch): + if touch.x > WINDOW_SIZE[0] // 2: + if self.widget.collide_point(touch.x, touch.y): + self.is_active = True + else: + self.is_active = False + + def on_touch_down(self, el, touch): + if touch.x > WINDOW_SIZE[0] // 2: + if self.widget.collide_point(touch.x, touch.y): + self.is_active = True + + def on_touch_up(self, el, touch): + if touch.x > WINDOW_SIZE[0] // 2: + if self.widget.collide_point(touch.x, touch.y): + self.is_active = False + + def draw(self): + self.widget.pos_hint = { + "center_x": self.center_x, "center_y": self.center_y} + self.widget.size_hint = (self.width * self.extension_factor, + self.height * self.extension_factor * SCREEN_RATIO) + if self.last_state != self.is_active: + self.widget.canvas.clear() + # Réglage de la couleur + if self.is_active == True: + self.widget.canvas.add(HIGH_TRANSPARENT_WHITE) + else: + self.widget.canvas.add(TRANSPARENT_WHITE) + # Affichage du cercle extérieur + self.main_center_x = self.center_x * WINDOW_SIZE[0] + self.main_center_y = self.center_y * WINDOW_SIZE[1] + main_radius = self.width * WINDOW_SIZE[1] + self.widget.canvas.add( + Line(circle=(self.main_center_x, self.main_center_y, main_radius), width=5)) + self.last_state = self.is_active + + def recursive_update(self): + self.draw() diff --git a/tools/tools_map.py b/tools/tools_map.py new file mode 100644 index 0000000..826f1cd --- /dev/null +++ b/tools/tools_map.py @@ -0,0 +1,203 @@ +import random as rd +import copy +from collections import deque + + +from tools.tools_constants import ( + MAP_SIZE, + CRYSTAL_PROBABILITY, + NUMBER_CASES_DIGGER, + DICT_ORIENTATIONS, + NUMBER_TRIALS, + PRECIOUS_STONE_PROBABILITY, + DICT_TREASURE_STONES, + my_collection +) + +def get_position_from_direction(direction, position): + if direction == DICT_ORIENTATIONS["top"]: + return (position[0], position[1]+1) + if direction == DICT_ORIENTATIONS["bottom"]: + return (position[0], position[1]-1) + if direction == DICT_ORIENTATIONS["right"]: + return (position[0]+1, position[1]) + if direction == DICT_ORIENTATIONS["left"]: + return (position[0]-1, position[1]) + +def choose_random_direction(): + direction = rd.choice(list(DICT_ORIENTATIONS.values())) + return direction + +def check_position_valid(position, list_elements): + if position in list_elements: + return False + if position[0] < 0 or position[0] >= MAP_SIZE: + return False + if position[1] < 0 or position[1] >= MAP_SIZE: + return False + return True + +def dig_ways(list_elements, grid_map, number_cases_digger): + for position in list_elements: + for counter in range(number_cases_digger): + counter_trials = 0 + while counter_trials < NUMBER_TRIALS: + direction = choose_random_direction() + new_position = get_position_from_direction(direction, position) + if check_position_valid(new_position, list_elements): + grid_map[new_position[1]][new_position[0]] = "G" + position = new_position + break + counter_trials += 1 + if counter_trials == NUMBER_TRIALS: + break + return grid_map + +def create_new_map(list_precious_stones, has_beacon=False): + """ + Create a map + """ + + # Initialisation with only rocks + grid_map = [] + + # Place the rocks everywhere + for counter_y in range(MAP_SIZE): + list_y = [] + for counter_x in range(MAP_SIZE): + list_y.append("R") + grid_map.append(list_y) + + # Where all important elements are stored + list_elements = [] + + # Place the crystals + for counter_y in range(MAP_SIZE): + for counter_x in range(MAP_SIZE): + if rd.random() <= CRYSTAL_PROBABILITY: + grid_map[counter_y][counter_x] = "C" + list_elements.append((counter_x, counter_y)) + + # Place the precious stones + for counter_y in range(MAP_SIZE): + for counter_x in range(MAP_SIZE): + if rd.random() <= PRECIOUS_STONE_PROBABILITY: + precious_stone_code = rd.choice(list(DICT_TREASURE_STONES.keys())) + if precious_stone_code not in list_precious_stones and ( + not my_collection.dict_collection[ + DICT_TREASURE_STONES[precious_stone_code]]): + grid_map[counter_y][counter_x] = precious_stone_code + list_elements.append((counter_x, counter_y)) + list_precious_stones.append(precious_stone_code) + + # Add all sides of the screen to unlock the ways + list_positions_sides = [ + (MAP_SIZE//2, 0), + (MAP_SIZE//2, MAP_SIZE-1), + (0, MAP_SIZE//2), + (MAP_SIZE-1, MAP_SIZE//2) + ] + for position in list_positions_sides: + list_elements.append(position) + grid_map[position[1]][position[0]] = "G" + + # Place the beacon + if has_beacon: + beacon_position = (MAP_SIZE//2, MAP_SIZE//2) + list_joinable_elements = [] + grid_map[beacon_position[1]][beacon_position[0]] = "B" + if beacon_position not in list_elements: + list_elements.append(beacon_position) + for side_position in list_positions_sides: + list_joinable_elements.append([beacon_position, side_position]) + + # Each case around the beacon is free + grid_map[MAP_SIZE//2][MAP_SIZE//2 + 1] = "G" + grid_map[MAP_SIZE//2][MAP_SIZE//2 - 1] = "C" + list_elements.append((MAP_SIZE//2 - 1, MAP_SIZE//2)) + grid_map[MAP_SIZE//2 + 1][MAP_SIZE//2 + 1] = "G" + grid_map[MAP_SIZE//2 - 1][MAP_SIZE//2 + 1] = "G" + grid_map[MAP_SIZE//2 + 1][MAP_SIZE//2 - 1] = "G" + grid_map[MAP_SIZE//2 - 1][MAP_SIZE//2 - 1] = "G" + grid_map[MAP_SIZE//2 + 1][MAP_SIZE//2] = "G" + grid_map[MAP_SIZE//2 - 1][MAP_SIZE//2] = "G" + + # Create the path by digging the way + is_joinable = False + number_cases_digger = NUMBER_CASES_DIGGER + while not is_joinable: + new_grid_map = dig_ways( + list_elements=list_elements, + grid_map=copy.deepcopy(grid_map), + number_cases_digger=number_cases_digger) + + # Only the map with the beacon interests us + if not has_beacon: + break + + for element in list_joinable_elements: + is_joinable = are_points_joinable( + grid=new_grid_map, + pointA=element[0], + pointB=element[1] + ) + if not is_joinable: + break + + number_cases_digger += 1 + return new_grid_map, list_precious_stones + + +def are_points_joinable(grid, pointA, pointB): + rows = len(grid) + cols = len(grid[0]) + + queue = deque() + visited = set() + + xA, yA = pointA + xB, yB = pointB + + queue.append((xA, yA)) + visited.add((xA, yA)) + + while queue: + x, y = queue.popleft() + if x == xB and y == yB: + return True + neighbors = get_neighbors(x, y, rows, cols) + for nx, ny in neighbors: + if (nx, ny) not in visited and grid[nx][ny] in ('G', 'C'): + queue.append((nx, ny)) + visited.add((nx, ny)) + + return False + +def get_neighbors(x, y, rows, cols): + neighbors = [] + # Up + if x - 1 >= 0: + neighbors.append((x - 1, y)) + # Down + if x + 1 < rows: + neighbors.append((x + 1, y)) + # Left + if y - 1 >= 0: + neighbors.append((x, y - 1)) + # Right + if y + 1 < cols: + neighbors.append((x, y + 1)) + + return neighbors + +def grid_to_string(grid): + rows = len(grid) + cols = len(grid[0]) + + string = "" + for i in range(rows): + for j in range(cols): + string += grid[i][j] + " " + string += "\n" + + return string diff --git a/tools/tools_sound.py b/tools/tools_sound.py new file mode 100644 index 0000000..2c8c370 --- /dev/null +++ b/tools/tools_sound.py @@ -0,0 +1,159 @@ +""" +Module to manage musics and sound effects +""" + +############### +### Imports ### +############### + +import os + +from math import exp + +from kivy.core.audio import SoundLoader + +from tools.tools_constants import ( + FPS, + SOUND_VOLUME, + MUSIC_VOLUME, + PATH_SOUNDS, + PATH_MUSICS +) + +############### +### Classes ### +############### + +class MusicMixer(): + """ + Classe destinée à gérer la musique dans le jeu + Une seule musique peut être jouée à la fois. + """ + + def __init__(self, dict_music): + self.musics = dict_music + + def change_volume(self, name, new_volume): + self.musics[name].volume = new_volume + + def play(self, name, loop=False, timecode=0, stop_other_sounds=True): + if stop_other_sounds: + self.stop() + self.musics[name].play() + if timecode != 0: + # Ne marche pas + self.musics[name].seek(1) + self.musics[name].loop = loop + + def stop(self): + for key in self.musics: + if self.musics[key].state == "play": + self.musics[key].stop() + +class DynamicMusicMixer(MusicMixer): + """ + Classe destinée à jouer des bruitages sur lesquels on peut appliquer des effets en jeu. + """ + + def __init__(self, dict_music): + super().__init__(dict_music) + self.instructions = [] + dico_frame_state = {} + for key in dict_music: + dico_frame_state[key] = 0 + self.dico_frame_state = dico_frame_state + + def fade_out(self, name, duration, mode="linear"): + if mode == "exp": + self.instructions.append(("exp_fade_out", name, duration)) + else: + self.instructions.append(("fade_out", name, duration)) + + def recursive_update(self): + pop_list = [] + # Parcours des instructions à effectuer + for instruction in self.instructions: + new_volume = None + # Calcul de l'instruction + if instruction[0] == "fade_out": + key, duration = instruction[1], instruction[2] + volume = self.musics[key].volume + frame_to_fade = FPS * duration + fade_diff = SOUND_VOLUME / frame_to_fade + new_volume = volume - fade_diff + elif instruction[0] == "exp_fade_out": + key, duration = instruction[1], instruction[2] + frame_to_fade = FPS * duration + t = 60 * self.dico_frame_state[key] / frame_to_fade + self.dico_frame_state[key] += 1 + new_volume = exp_fade_out(t) * SOUND_VOLUME + # Application du changement de volume + if new_volume is not None: + if new_volume > 0: + self.musics[key].volume = new_volume + else: + self.musics[key].volume = 0 + self.musics[key].stop() + self.musics[key].volume = SOUND_VOLUME + self.dico_frame_state[key] = 0 + pop_list.append(instruction) + # Enlève les instructions terminées + for el in pop_list: + self.instructions.remove(el) + +class SoundMixer(): + """ + Classe destinée à gérer les bruitages dans le jeu + Elle est capable de jouer plusieurs fois le même son en même temps + """ + + def __init__(self, dict_sound, volume, sound_limit=10): + self.sounds = {} + self.sound_limit = sound_limit + for key in dict_sound: + self.sounds[key] = [SoundLoader.load(dict_sound[key]) + for i in range(sound_limit)] + for i in range(sound_limit): + self.sounds[key][i].volume = volume + + def play(self, name): + i = 0 + while i < self.sound_limit and self.sounds[name][i].state == "play": + i += 1 + if i < self.sound_limit: + self.sounds[name][i].play() + else: + print("Unable to play the desired sound, channel saturation") + +################# +### Functions ### +################# + +def exp_fade_out(t): + return 1 - exp((t - 60) * 0.15) + + +def load_sounds(folder, volume): + """Fonction pour charger tous les sons d'un coup. + Prend en entrée un dictionnaire avec le nom de chaque son et sa position. + Renvoie un dictionnaire avec le nom de chaque son et le son lui-même. + """ + dico = {} + for file in os.listdir(folder): + name_file = file.split(".")[0] + dico[name_file] = SoundLoader.load(folder + file) + dico[name_file].volume = volume + return dico + +############### +### Process ### +############### + + +# Load the dictionnaries +MUSIC_DICT = load_sounds(PATH_MUSICS, MUSIC_VOLUME) +SOUND_DICT = load_sounds(PATH_SOUNDS, SOUND_VOLUME) + +# Create the mixer +music_mixer = DynamicMusicMixer(MUSIC_DICT) +sound_mixer = DynamicMusicMixer(SOUND_DICT) diff --git a/tools/tools_world_explorer.py b/tools/tools_world_explorer.py new file mode 100644 index 0000000..d01a44e --- /dev/null +++ b/tools/tools_world_explorer.py @@ -0,0 +1,1349 @@ +""" +World explorer tools module + +It allows to create a map based on a grid where a character can move and explore. +""" + + +############### +### Imports ### +############### + +### Python import ### + +from math import floor, sqrt +import random as rd +import math + + +### Kivy imports ### + +from kivy.clock import Clock +from kivy.atlas import Atlas +from kivy.uix.screenmanager import Screen +from kivy.uix.image import Image +from kivy.uix.relativelayout import RelativeLayout +from kivy.uix.label import Label +from kivy.uix.progressbar import ProgressBar + +### Module imports ### + +from tools.tools_constants import ( + PATH_ATLAS, + PATH_IMAGES, + DICT_TILES_TEXTURE, + SPEED, + CASES_ON_WIDTH, + INTERACT, + WAIT_FRAMES, + FRAMES_LATERAL, + MOBILE_MODE, + FPS, + PATH_MAPS, + DICT_TILES_MOVEMENT, + MOVE, + DICT_ORIENTATIONS, + SQUARE_TWO, + DEBUG_MODE, + MAX_CRYSTALS, + RATE_DIMINUTION_LIGHT, + MAX_INTENSITY, + RATE_AUGMENTATION_LIGHT_DISPLAY, + MAP_SIZE, + GAME_OVER_FREEZE_TIME, + SOUND_RADIUS_CRYSTAL, + START_BEACON_CASES, + PROBABILITY_WATER_DROPS, + MAX_TIME_IN_DARK, + CHARACTER_MOVEMENT, + PATH_SETTINGS, + DICT_TREASURE_STONES, + RATE_DIMINUTION_LIGHT_AUGMENTATION, + DICT_DISPLAY_ORIENTATIONS, + my_collection, + SOUND_RADIUS_BEACON, + Window, + INC_TILE_SIZE_RATIO, + CHARACTER_SCALE +) +from tools.tools_kivy_mobile import ( + MobileJoystick, + MobileButton +) +from tools.tools_map import ( + create_new_map +) +from tools.tools_effect import ( + AmbientDarkness, + CircleDarkness +) +from tools.tools_sound import ( + sound_mixer, + music_mixer +) +from tools.tools_basis import ( + load_json_file +) + + +def change_window_size(*args): + global WINDOW_SIZE, SCREEN_RATIO, TILE_SIZE, TILE_SIZE_HINT, CHARACTER_SIZE,\ + CASES_ON_HEIGHT, CASES_ON_WIDTH, CASES_ON_HALF_HEIGHT, CASES_ON_HALF_WIDTH,\ + CASES_ON_HALF_TUPLE + + # Compute the size of one tile in pixel + WINDOW_SIZE = Window.size + SCREEN_RATIO = WINDOW_SIZE[0] / WINDOW_SIZE[1] + TILE_SIZE = WINDOW_SIZE[0] / CASES_ON_WIDTH + TILE_SIZE_HINT = (INC_TILE_SIZE_RATIO * TILE_SIZE / + WINDOW_SIZE[0], INC_TILE_SIZE_RATIO * TILE_SIZE / WINDOW_SIZE[1]) + CHARACTER_SIZE = CHARACTER_SCALE * TILE_SIZE + + # Compute the number of cases that fit in height + CASES_ON_HEIGHT = int(CASES_ON_WIDTH / SCREEN_RATIO) + 1 + + CASES_ON_HALF_HEIGHT = CASES_ON_HEIGHT // 2 + 2 + CASES_ON_HALF_WIDTH = CASES_ON_WIDTH // 2 + 2 + CASES_ON_HALF_TUPLE = [CASES_ON_HALF_WIDTH, CASES_ON_HALF_HEIGHT] + + +Window.bind(on_resize=change_window_size) +change_window_size() + + +############### +### Classes ### +############### + + +class GridMap(): + def __init__(self) -> None: + self.tiles = {} + self.map_size = None + self.offset_list = [] + + def add_submap(self, grid_map_list, offset_tuple): + if self.map_size is None: + self.map_size = (len(grid_map_list[0]), len(grid_map_list)) + elif self.map_size != (len(grid_map_list[0]), len(grid_map_list)): + return ValueError("The size does not correspond to the current size used") + + x_offset, y_offset = ( + offset_tuple[0] * self.map_size[0], + offset_tuple[1] * self.map_size[1] + ) + + self.offset_list.append(offset_tuple) + + for j in range(len(grid_map_list)): + for i in range(len(grid_map_list[0])): + self.tiles[(i + x_offset, j + y_offset) + ] = grid_map_list[len(grid_map_list) - 1 - j][i] + + def get_texture(self, position): + if position not in self.tiles: + return "O" + return self.tiles[position] + + def replace_texture(self, position, new_texture): + self.tiles[position] = new_texture + + def get_tile_type(self, position): + if position not in self.tiles: + return None + return self.tiles[position] + + def set_tile_type(self, position, value): + self.tiles[position] = value + + def __str__(self) -> str: + res = "" + keys = self.tiles.keys() + x_keys = [key[0] for key in keys] + y_keys = [key[1] for key in keys] + x_min_id = min(x_keys) + x_max_id = max(x_keys) + y_min_id = min(y_keys) + y_max_id = max(y_keys) + for j in range(y_max_id, y_min_id - 1, -1): + for i in range(x_min_id, x_max_id + 1): + if (i, j) in self.tiles: + res += self.tiles[(i, j)] + " " + else: + res += " " + res += "\n" + return res + + def __repr__(self) -> str: + return self.__str__() + + +class LogoTextureWidget(Image): + def __init__(self, texture, **kwargs): + super().__init__(**kwargs) + self.allow_stretch = True + self.keep_ratio = False + self.texture = texture + + +class TextureWidget(Image): + """ + An image widget where the texture is direcltly set. + """ + + def __init__(self, name_texture, position=None, **kwargs): + super().__init__(**kwargs) + self.allow_stretch = True + self.keep_ratio = False + self.name_texture = name_texture + if name_texture in DICT_TILES_TEXTURE.keys(): + self.texture = TEXTURE_DICT[ + rd.choice(DICT_TILES_TEXTURE[name_texture])] + elif name_texture in DICT_TREASURE_STONES.keys(): + self.texture = TEXTURE_DICT[ + DICT_TREASURE_STONES[name_texture]] + else: + self.texture = TEXTURE_DICT[name_texture] + self.position = position + self.letter_tile = name_texture + + def set_texture(self, texture): + self.texture = texture + + +class WorldExplorerScreen(Screen): + """ + Class to define a world explorer screen + """ + + def __init__(self, **kwargs): + super().__init__(**kwargs) + + # Create the grid variables + self.grid_map = GridMap() + + # Create the map variables + self.x_char_on_map = 0.0 + self.y_char_on_map = 0.0 + self.x_char_on_screen = 0.0 + self.y_char_on_screen = 0.0 + self.x_map_on_screen = 0.0 + self.y_map_on_screen = 0.0 + self.prec_map_center_grid_pos = (0, 0) + + self.character_orientation = "bottom" + self.display_orientation = "bottom" + + self.score = 0 + self.number_crystals = [0, 0] + self.beacon_life = 10 + + # Create a list to contain the widgets for texture maps + self.textures_map_list = [] + self.textures_map_to_remove_list = [] + + self.is_game_over = False + self.game_over_timer = 0 + self.in_darkness_count = 0 + + def init_screen(self): + """ + Init the screen when loaded. + + Parameters + ---------- + None + + Returns + ------- + None + """ + + self.font_ratio = Window.size[0] / 800 + + # Choose the possible directions for the next beacons + self.beacon_x_change = 1 - 2 * rd.randint(0, 1) + self.beacon_y_change = 1 - 2 * rd.randint(0, 1) + + self.count_frame = 0 + self.rate_diminution_light = RATE_DIMINUTION_LIGHT + + self.is_game_over = False + self.game_over_timer = 0 + self.in_darkness_count = 0 + SETTINGS = load_json_file(PATH_SETTINGS) + self.INTERACT_KEY = SETTINGS["keys"][INTERACT] + self.DICT_KEYS = SETTINGS["keys"] + + self.display_indicators() + + # Update the positions and display according to the FPS frequency + Clock.schedule_interval(self.display_tutorial, 3 / FPS) + + # Store the map informations + self.build_grid_map() + + # Set the default position + self.x_char_on_map = self.grid_map.map_size[0] / 2 + 0.5 - 1 + self.y_char_on_map = self.grid_map.map_size[1] / 2 + 0.5 + self.update_map_on_screen_position() + self.prec_map_center_grid_pos = self.get_map_center_grid_pos() + + # Create the character and display it on the screen + self.character = TextureWidget( + name_texture="front", + x=self.x_char_on_screen - CHARACTER_SIZE / 2, + y=self.y_char_on_screen - CHARACTER_SIZE / 2, + size_hint=(CHARACTER_SIZE / WINDOW_SIZE[0], CHARACTER_SIZE / WINDOW_SIZE[1])) + self.add_widget(self.character) + self.character_state = 1 + self.crystal_1 = Image( + texture=TEXTURE_DICT[DICT_TILES_TEXTURE["C"][0]], + x=self.x_char_on_screen, + y=self.y_char_on_screen - 3 * CHARACTER_SIZE / 4, + size_hint=(None, None), + width=TILE_SIZE // 4, + keep_ratio=True, + opacity=0) + self.add_widget(self.crystal_1) + self.crystal_1_name = "" + self.crystal_2 = Image( + texture=TEXTURE_DICT[DICT_TILES_TEXTURE["C"][0]], + x=self.x_char_on_screen - CHARACTER_SIZE // 2, + y=self.y_char_on_screen - 4 * CHARACTER_SIZE / 5, + size_hint=(None, None), + width=TILE_SIZE // 4, + keep_ratio=True, + opacity=0) + self.add_widget(self.crystal_2) + self.crystal_2_name = "" + + # Create the textures for the map + x_min_value, x_max_value = self.compute_min_max_display_values(0) + y_min_value, y_max_value = self.compute_min_max_display_values(1) + for x in range(x_min_value, x_max_value + 1): + for y in range(y_min_value, y_max_value + 1): + self.add_texture_to_map((x, y)) + + self.darkness_circle = CircleDarkness( + 3, x=WINDOW_SIZE[0] / 2, y=WINDOW_SIZE[1] / 2) + self.add_widget(self.darkness_circle, 0) + + self.ambient_darkness = AmbientDarkness() + self.add_widget(self.ambient_darkness) + + self.beacon_position = (MAP_SIZE // 2, MAP_SIZE // 2 - 0.5) + self.list_keydown = [] + self.list_keyup = [] + self.take_crystal = False + self.have_taken_crystal = False + self.local_counter_tutorial = 0 + + self.beacon_map_history = [(0, 0)] + + self.is_beacon_near = False + + def display_indicators(self): + # Add a FPS counter for the debug mode + if DEBUG_MODE: + self.fps_label = Label( + text="60", + pos_hint={"x": 0, "y": 0}, + size_hint=(0.05, 0.05), + font_size=10 * self.font_ratio) + self.add_widget(self.fps_label) + + # Label for the number of crystals + pos_hint = {"right": 0.95, "y": 0} + if MOBILE_MODE: + pos_hint = {"right": 0.95, "top": 0.95} + self.number_crystals_label = Label( + text="0 / " + str(MAX_CRYSTALS), + pos_hint=pos_hint, + size_hint=(0.075, 0.05 * SCREEN_RATIO), + bold=True, + font_size=10 * self.font_ratio + ) + self.add_widget(self.number_crystals_label) + + # Image for the number of crystals + pos_hint = {"right": 0.98, "y": 0.01} + if MOBILE_MODE: + pos_hint = {"right": 0.98, "top": 0.94} + self.number_crystals_image = Image( + texture=TEXTURE_DICT[DICT_TILES_TEXTURE["C"][0]], + pos_hint=pos_hint, + size_hint=(None, None), + width=0.03 * WINDOW_SIZE[0] + ) + self.number_crystals_image.height = self.number_crystals_image.width + self.add_widget(self.number_crystals_image) + + # Progress bar of the life of the beacon + self.progress_bar_beacon = ProgressBar( + value=self.beacon_life, + max=MAX_INTENSITY, + pos_hint={"x": 0.025, "top": 1}, + size_hint=(0.95, 0.05) + ) + self.add_widget(self.progress_bar_beacon) + + def build_grid_map(self): + + x_or_y_direction = rd.randint(0, 1) + + beacon_direction = (x_or_y_direction * self.beacon_x_change, + (1 - x_or_y_direction) * self.beacon_y_change) + + # Add the map in the center + center_map, self.list_precious_stones = create_new_map( + list_precious_stones=[], has_beacon=True) + self.grid_map.add_submap(center_map, (0, 0)) + + # Add the map with the other beacon + for position in [(0, 1), (0, -1), (1, 0), (-1, 0), (1, 1), (-1, -1), (1, -1), (-1, 1)]: + if position == beacon_direction: + new_map, self.list_precious_stones = create_new_map( + list_precious_stones=self.list_precious_stones, has_beacon=True) + self.grid_map.add_submap(new_map, position) + else: + new_map, self.list_precious_stones = create_new_map( + list_precious_stones=self.list_precious_stones, has_beacon=False) + self.grid_map.add_submap(new_map, position) + + def expand_grid_map(self): + # Scan maps around + grid_offset = (self.prec_map_center_grid_pos[0] // MAP_SIZE, + self.prec_map_center_grid_pos[1] // MAP_SIZE) + + if grid_offset == (0, 0): + return + + x_or_y_direction = rd.randint(0, 1) + + beacon_direction = (x_or_y_direction * self.beacon_x_change, + (1 - x_or_y_direction) * self.beacon_y_change) + + map_with_beacon_offset = ( + grid_offset[0] + beacon_direction[0], grid_offset[1] + beacon_direction[1]) + + for i in range(-1, 2): + for j in range(-1, 2): + offset = (grid_offset[0] + i, grid_offset[1] + j) + has_beacon = offset == map_with_beacon_offset + if (i, j) != (0, 0) and offset not in self.beacon_map_history: + new_map, self.list_precious_stones = create_new_map( + list_precious_stones=self.list_precious_stones, + has_beacon=has_beacon) + self.grid_map.add_submap(new_map, offset) + + self.beacon_map_history.append(map_with_beacon_offset) + + def compute_min_max_display_values(self, direction_id): + min_value = self.prec_map_center_grid_pos[direction_id] - \ + CASES_ON_HALF_TUPLE[direction_id] + max_value = self.prec_map_center_grid_pos[direction_id] + \ + CASES_ON_HALF_TUPLE[direction_id] + return min_value, max_value + + def update_map_on_screen_position(self): + """ + Update the position of the map on the screen. + + Parameters + ---------- + None + + Returns + ------- + None + """ + self.x_map_on_screen = self.x_char_on_map * \ + TILE_SIZE - WINDOW_SIZE[0] / 2 + self.y_map_on_screen = self.y_char_on_map * \ + TILE_SIZE - WINDOW_SIZE[1] / 2 + + def update_char_on_screen_position(self): + """ + Update the position of the character on the screen. + + Parameters + ---------- + None + + Returns + ------- + None + """ + # Movements of the character + offset = CHARACTER_MOVEMENT * math.sin(self.count_frame * 0.15) + + self.crystal_1.x = self.x_char_on_screen - CHARACTER_SIZE // 2 + 0.5 * offset + self.crystal_1.y = self.y_char_on_screen - 3 * CHARACTER_SIZE / 4 + 0.5 * offset + self.crystal_2.x = self.x_char_on_screen + 0.5 * offset + self.crystal_2.y = self.y_char_on_screen - 4 * CHARACTER_SIZE / 5 - 0.5 * offset + self.x_char_on_screen = WINDOW_SIZE[0] / 2 + self.y_char_on_screen = WINDOW_SIZE[1] / 2 + offset + self.character.x = self.x_char_on_screen - CHARACTER_SIZE / 2 + self.character.y = self.y_char_on_screen - CHARACTER_SIZE / 2 + + def get_char_grid_pos(self) -> tuple: + """ + Return the grid coordinates of the main character. + """ + return (floor(self.x_char_on_map), floor(self.y_char_on_map)) + + def get_map_center_grid_pos(self) -> tuple: + """ + Return the grid coordinates of the center of the map. + """ + return (floor(self.x_map_on_screen / TILE_SIZE + CASES_ON_WIDTH / 2), + floor(self.y_map_on_screen / TILE_SIZE + CASES_ON_HEIGHT / 2)) + + def update_textures_map_list(self, forced_reload=False) -> None: + """ + Update the list of textures to keep on display. + """ + current_map_center_grid_pos = self.get_map_center_grid_pos() + + if self.prec_map_center_grid_pos != current_map_center_grid_pos or forced_reload: + + # Create the textures for the map + x_min_value, x_max_value = self.compute_min_max_display_values(0) + y_min_value, y_max_value = self.compute_min_max_display_values(1) + + to_delete_list = [] + to_add_list = [] + on_screen = [] + + for x in range(x_min_value, x_max_value + 1): + for y in range(y_min_value, y_max_value + 1): + on_screen.append((x, y)) + + position_texture_map_list = [ + e.position for e in self.textures_map_list] + + for position in position_texture_map_list: + if not position in on_screen: + to_delete_list.append(position) + + for position in on_screen: + if not position in position_texture_map_list: + to_add_list.append(position) + + # Delete useless tiles + for texture_map in self.textures_map_list[:]: + if texture_map.position in to_delete_list: + self.textures_map_list.remove(texture_map) + self.remove_widget(texture_map) + + # Add necessary tiles + textures_map_position_list = [ + texture_map.position for texture_map in self.textures_map_list] + for position_to_add in to_add_list: + if position_to_add not in textures_map_position_list: + self.add_texture_to_map(position_to_add) + + self.prec_map_center_grid_pos = self.get_map_center_grid_pos() + + def add_texture_to_map(self, position_to_add): + """ + Add a texture to the list of textures to display + """ + letter_tile = self.grid_map.get_texture(position_to_add) + new_texture_map = TextureWidget( + name_texture=letter_tile, + position=position_to_add, + size_hint=TILE_SIZE_HINT) + self.textures_map_list.append(new_texture_map) + self.add_widget(new_texture_map, 100) + + if letter_tile in DICT_TREASURE_STONES or letter_tile == "C": + new_texture_map.size_hint = ( + TILE_SIZE_HINT[0] / 2, TILE_SIZE_HINT[1] / 2) + + if letter_tile != "G": + ground_texture = TextureWidget( + position=position_to_add, + size_hint=TILE_SIZE_HINT, + name_texture="G") + self.textures_map_list.append(ground_texture) + self.add_widget(ground_texture, 110) + + def update_textures_map_positions(self): + """ + Update the positions of all textures on screen + """ + texture_map: TextureWidget + for texture_map in self.textures_map_list: + x_grid, y_grid = texture_map.position + texture_map.x = x_grid * TILE_SIZE - \ + self.x_map_on_screen + texture_map.y = y_grid * TILE_SIZE - \ + self.y_map_on_screen + if texture_map.name_texture in DICT_TREASURE_STONES or texture_map.name_texture == "C": + texture_map.x += TILE_SIZE / 4 + texture_map.y += TILE_SIZE / 4 + + def update_textures_map_on_screen(self): + """ + Update all the textures map to display them on the screen. + + Parameters + ---------- + None + + Returns + ------- + None + """ + self.update_textures_map_list() + self.update_textures_map_positions() + + def update_display_orientation(self, x_movement, y_movement): + display_orientation = "" + if abs(x_movement) > 0.25: + if x_movement < 0: + display_orientation += "left_" + else: + display_orientation += "right_" + if abs(y_movement) > 0.25: + if y_movement > 0: + display_orientation += "top" + else: + display_orientation += "bottom" + else: + if display_orientation != "": + display_orientation = display_orientation.replace("_", "") + else: + display_orientation = "bottom" + return display_orientation + + def update_facing_character(self): + self.character.texture = TEXTURE_DICT[ + DICT_DISPLAY_ORIENTATIONS[self.display_orientation]] + + def update_darkness_position(self): + x_grid, y_grid = self.beacon_position + self.darkness_circle.x = x_grid * TILE_SIZE - \ + self.x_map_on_screen + TILE_SIZE / 2 + self.darkness_circle.y = y_grid * TILE_SIZE - \ + self.y_map_on_screen - TILE_SIZE / 2 + self.darkness_circle.draw() + + def update_char_on_map_position(self, x_movement: float, y_movement: float): + """ + Update the position of the character on the map. + It takes into account the collisions; the character can only go on "MOVE" tiles. + It also updates the orientation of the character on the map. + + Parameters + ---------- + x_movement: float + Movement on the x axis + + y_movement: float + Movement on the y axis + + Returns + ------- + None + """ + # Update the orientation of the character on the map + if abs(x_movement) > abs(y_movement): + if x_movement > 0: + new_orientation = DICT_ORIENTATIONS["right"] + else: + new_orientation = DICT_ORIENTATIONS["left"] + else: + if y_movement > 0: + new_orientation = DICT_ORIENTATIONS["top"] + else: + new_orientation = DICT_ORIENTATIONS["bottom"] + + if self.character_orientation != new_orientation: + self.character_orientation = new_orientation + + # Update the orientation of the display of the character + display_orientation = self.update_display_orientation( + x_movement, y_movement) + if self.display_orientation != display_orientation: + self.display_orientation = display_orientation + self.update_facing_character() + + # Update the position of the character on the map + x_extremity = self.x_char_on_map + SPEED * x_movement + y_extremity = self.y_char_on_map + SPEED * y_movement + + # Values of next tiles + next_xy = DICT_TILES_MOVEMENT[self.grid_map.get_tile_type( + (floor(x_extremity), floor(y_extremity)))] + next_x = DICT_TILES_MOVEMENT[self.grid_map.get_tile_type( + (floor(x_extremity), floor(self.y_char_on_map)))] + next_y = DICT_TILES_MOVEMENT[self.grid_map.get_tile_type( + (floor(self.x_char_on_map), floor(y_extremity)))] + + if MOVE in next_xy and (MOVE in next_x or MOVE in next_y): + self.x_char_on_map += SPEED * x_movement + self.y_char_on_map += SPEED * y_movement + elif MOVE in next_x: + self.x_char_on_map += SPEED * x_movement + elif MOVE in next_y: + self.y_char_on_map += SPEED * y_movement + self.update_textures_map_on_screen() + + def search_near_crystal(self, current_grid_pos): + x_grid, y_grid = current_grid_pos + has_near_crystal = False + for i in range(x_grid - SOUND_RADIUS_CRYSTAL, x_grid + SOUND_RADIUS_CRYSTAL + 1): + for j in range(y_grid - SOUND_RADIUS_CRYSTAL, y_grid + SOUND_RADIUS_CRYSTAL + 1): + if self.grid_map.get_tile_type((i, j)) == "C": + has_near_crystal = True + return has_near_crystal + + def search_near_off_beacon(self, current_grid_pos): + x_grid, y_grid = current_grid_pos + has_near_beacon = False + for i in range(x_grid - SOUND_RADIUS_BEACON, x_grid + SOUND_RADIUS_BEACON + 1): + for j in range(y_grid - SOUND_RADIUS_BEACON, y_grid + SOUND_RADIUS_BEACON + 1): + if self.grid_map.get_tile_type((i, j)) == "B": + has_near_beacon = True + return has_near_beacon + + def manage_near_beacon_sound(self): + if self.is_beacon_near: + if sound_mixer.musics["near_beacon"].state != "play": + sound_mixer.play("near_beacon", stop_other_sounds=False) + else: + if sound_mixer.musics["near_beacon"].state == "play": + sound_mixer.fade_out("near_beacon", 1, mode="exp") + + def manage_near_crystal_sound(self): + if self.is_crystal_near: + if sound_mixer.musics["near_crystal"].state != "play": + sound_mixer.play("near_crystal", stop_other_sounds=False) + else: + if sound_mixer.musics["near_crystal"].state == "play": + sound_mixer.fade_out("near_crystal", 1, mode="exp") + + def compute_distance_with_beacon(self): + distance = sqrt( + (self.x_char_on_map - self.beacon_position[0])**2 + (self.y_char_on_map - self.beacon_position[1])**2) + return distance + + def clean(self): + Clock.unschedule(self.update) + self.darkness_circle.canvas.clear() + self.grid_map = GridMap() + self.ambient_darkness.canvas.clear() + + def game_over(self): + self.game_over_timer += 1 + if self.game_over_timer > GAME_OVER_FREEZE_TIME * FPS: + my_collection.update_high_score(self.score) + self.manager.init_screen("game_over", self.score) + self.clean() + self.clear_widgets() + + def manage_in_darkness(self): + distance_with_beacon = self.compute_distance_with_beacon() + if distance_with_beacon > self.darkness_circle.radius: + self.in_darkness = True + if self.in_darkness_count == 0: + sound_mixer.play( + "darkness", stop_other_sounds=False, loop=False) + if self.in_darkness: + self.in_darkness_count += 1 + if self.in_darkness_count > MAX_TIME_IN_DARK * FPS: + sound_mixer.play("death", stop_other_sounds=True) + self.darkness_circle.change_radius(0) + self.update_darkness_position() + self.is_game_over = True + music_mixer.stop() + + else: + if sound_mixer.musics["darkness"].state == "play": + sound_mixer.fade_out("darkness", 1, mode="exp") + self.in_darkness = False + self.in_darkness_count = 0 + + def get_next_tile(self): + """ + Get tile towards which the character is oriented. + + Parameters + ---------- + None + + Returns + ------- + next_tile: str + String representing the type of tile + + position: (int, int) + Tuple representing the position of the corresponding tile + """ + if self.character_orientation == DICT_ORIENTATIONS["top"]: + position = (floor(self.x_char_on_map), + floor(self.y_char_on_map) + 1) + next_tile = self.grid_map.get_tile_type(position) + elif self.character_orientation == DICT_ORIENTATIONS["bottom"]: + position = (floor(self.x_char_on_map), + floor(self.y_char_on_map) - 1) + next_tile = self.grid_map.get_tile_type(position) + elif self.character_orientation == DICT_ORIENTATIONS["left"]: + position = (floor(self.x_char_on_map) - + 1, floor(self.y_char_on_map)) + next_tile = self.grid_map.get_tile_type(position) + elif self.character_orientation == DICT_ORIENTATIONS["right"]: + position = (floor(self.x_char_on_map) + + 1, floor(self.y_char_on_map)) + next_tile = self.grid_map.get_tile_type(position) + return next_tile, position + + def interact_with_environment(self): + """ + Interact with the environment. + It takes into account the tile towards which the character is oriented. + + Parameters + ---------- + None + + Returns + ------- + None + """ + for key in self.list_keyup: + bool_interact = False + + # Check the interaction with the current tile + position = (floor(self.x_char_on_map), floor(self.y_char_on_map)) + my_tile = self.grid_map.get_tile_type(position) + if key == self.DICT_KEYS[INTERACT] and ( + INTERACT in DICT_TILES_MOVEMENT[my_tile] or my_tile in DICT_TREASURE_STONES): + bool_interact = True + + # Check the interaction with the next tile + if not bool_interact: + my_tile, position = self.get_next_tile() + if key == self.DICT_KEYS[INTERACT] and ( + INTERACT in DICT_TILES_MOVEMENT[my_tile] or my_tile in DICT_TREASURE_STONES): + bool_interact = True + + if bool_interact: + # Get crystal in our bag + if my_tile == "C": + + # Can only take crystals in less than MAX_CRYSTALS + if self.number_crystals[0] < MAX_CRYSTALS: + self.number_crystals[0] += 1 + self.number_crystals[1] += 1 + sound_mixer.play( + "get_crystal", stop_other_sounds=False) + self.number_crystals_label.text = str( + self.number_crystals[0]) + " / " + str(MAX_CRYSTALS) + + self.grid_map.replace_texture(position, "G") + + # Delete the former textures + for texture in self.textures_map_list: + if texture.position == position and ( + texture.name_texture == "C"): + self.remove_widget(texture) + self.textures_map_list.remove(texture) + break + + if self.number_crystals[0] == 1: + self.crystal_1.texture = TEXTURE_DICT[DICT_TILES_TEXTURE["C"][0]] + self.crystal_1.opacity = 1 + self.crystal_1_name = my_tile + else: + self.crystal_2.texture = TEXTURE_DICT[DICT_TILES_TEXTURE["C"][0]] + self.crystal_2.opacity = 1 + self.crystal_2_name = my_tile + + # Bring back the crystals to the beacon + elif my_tile in ["B", "b"]: + if my_tile == "B" and self.number_crystals[1] != 0: + self.darkness_circle.radius = START_BEACON_CASES + self.score += self.number_crystals[1] + self.darkness_circle.change_radius( + self.darkness_circle.radius + self.number_crystals[1] * RATE_AUGMENTATION_LIGHT_DISPLAY) + if self.number_crystals[0] != 0: + self.crystal_1.opacity = 0 + if self.number_crystals[0] == 2: + self.crystal_2.opacity = 0 + + # Reset the counter of crystals + self.number_crystals[0] = 0 + self.number_crystals[1] = 0 + self.number_crystals_label.text = "0 / " + \ + str(MAX_CRYSTALS) + + # Update the collection if needed + if self.crystal_1_name not in ["C", ""]: + my_collection.find_new_stone(self.crystal_1_name) + if self.crystal_2_name not in ["C", ""]: + my_collection.find_new_stone(self.crystal_2_name) + + if my_tile == "b": + sound_mixer.play( + "give_crystal", stop_other_sounds=False) + else: + self.start_new_beacon() + + # Interact with the precious stones + elif my_tile in DICT_TREASURE_STONES: + if self.number_crystals[0] < MAX_CRYSTALS: + self.number_crystals[0] += 1 + sound_mixer.play( + "get_crystal", stop_other_sounds=False) + self.number_crystals_label.text = str( + self.number_crystals[0]) + " / " + str(MAX_CRYSTALS) + self.grid_map.replace_texture(position, "G") + + # Delete the former textures + for texture in self.textures_map_list: + if texture.position == position and ( + texture.name_texture == my_tile): + self.remove_widget(texture) + self.textures_map_list.remove(texture) + break + + if self.number_crystals[0] == 1: + self.crystal_1.texture = TEXTURE_DICT[ + DICT_TREASURE_STONES[my_tile]] + self.crystal_1.opacity = 1 + self.crystal_1_name = my_tile + else: + self.crystal_2.texture = TEXTURE_DICT[ + DICT_TREASURE_STONES[my_tile]] + self.crystal_2.opacity = 1 + self.crystal_2_name = my_tile + + self.list_keyup = [] + + def start_new_beacon(self): + + self.score += 5 + self.rate_diminution_light += RATE_DIMINUTION_LIGHT_AUGMENTATION + + # Play the sound + on_screen_beacon_tile = self.get_next_tile()[1] + sound_mixer.play( + "start_beacon", stop_other_sounds=True) + + # Change the parameters + self.progress_bar_beacon.value = MAX_INTENSITY + self.beacon_life = MAX_INTENSITY + + # Remove the previous beacon + self.grid_map.set_tile_type( + (floor(self.beacon_position[0]), floor(self.beacon_position[1])), "R") + + # Change the position of the light circle + self.beacon_position = ( + on_screen_beacon_tile[0], on_screen_beacon_tile[1] + 0.5) + + # Replace the texture of the beacon + self.grid_map.set_tile_type( + on_screen_beacon_tile, "b") + for texture_map in self.textures_map_list[:]: + if texture_map.position == on_screen_beacon_tile: + self.textures_map_list.remove(texture_map) + self.remove_widget(texture_map) + self.add_texture_to_map(on_screen_beacon_tile) + + # Increase the size of the map + self.expand_grid_map() + + # Reload all textures to avoid junction problems + temp_list = self.textures_map_list[:] + self.textures_map_list = [] + self.update_textures_map_list(forced_reload=True) + for widget in temp_list: + self.remove_widget(widget) + + def redraw_interface(self): + self.remove_widget(self.number_crystals_label) + self.add_widget(self.number_crystals_label) + self.remove_widget(self.number_crystals_image) + self.add_widget(self.number_crystals_image) + self.remove_widget(self.progress_bar_beacon) + self.add_widget(self.progress_bar_beacon) + if DEBUG_MODE: + self.remove_widget(self.fps_label) + self.add_widget(self.fps_label) + + def display_tutorial(self, *args): + self.is_tutorial = True + if self.count_frame < WAIT_FRAMES: + self.list_keyup = [] + self.list_keydown = [] + elif self.count_frame in range(WAIT_FRAMES, WAIT_FRAMES + FRAMES_LATERAL): + self.list_keyup = [] + self.list_keydown = [self.DICT_KEYS["left"]] + elif self.count_frame in range(WAIT_FRAMES + FRAMES_LATERAL, WAIT_FRAMES + FRAMES_LATERAL * 2): + self.list_keyup = [] + self.list_keydown = [self.DICT_KEYS["right"]] + elif self.count_frame < WAIT_FRAMES + FRAMES_LATERAL * 2 + 0.75 / SPEED: + self.list_keyup = [] + self.list_keydown = [self.DICT_KEYS["bottom"]] + elif not self.take_crystal and not self.have_taken_crystal: + self.list_keyup = [] + self.list_keydown = [self.DICT_KEYS["bottom"]] + self.take_crystal = True + elif self.take_crystal: + self.list_keyup = [self.INTERACT_KEY] + self.list_keydown = [self.DICT_KEYS["bottom"]] + if self.local_counter_tutorial > FRAMES_LATERAL: + self.take_crystal = False + self.have_taken_crystal = True + if self.local_counter_tutorial != 0: + self.list_keydown = [] + self.local_counter_tutorial += 1 + elif self.count_frame < WAIT_FRAMES + 3 * FRAMES_LATERAL + 1.25 / SPEED: + self.list_keyup = [] + self.list_keydown = [self.DICT_KEYS["right"]] + else: + self.list_keyup = [self.INTERACT_KEY] + self.list_keydown = [self.DICT_KEYS["right"]] + self.is_tutorial = False + + self.count_frame += 1 + x_movement, y_movement = self.get_movements_keyboard() + self.update_char_on_map_position( + x_movement=x_movement, + y_movement=y_movement) + self.interact_with_environment() + self.update_darkness_position() + + self.update_map_on_screen_position() + self.update_char_on_screen_position() + + if not self.is_tutorial: + Clock.unschedule(self.display_tutorial) + Clock.schedule_interval(self.update, 1 / FPS) + + if not MOBILE_MODE: + # Create the keyboard to move the character + self._keyboard = Window.request_keyboard( + self._keyboard_closed, self, 'text') + self._keyboard.bind(on_key_down=self.update_on_key_down) + self._keyboard.bind(on_key_up=self.update_on_key_up) + + self.list_keydown = [] + self.list_keyup = [] + + # Create the joystick to move the character + if MOBILE_MODE: + my_layout_joystick = RelativeLayout() + self.add_widget(my_layout_joystick) + self.mobile_joystick = MobileJoystick(my_layout_joystick) + + my_layout_button = RelativeLayout() + self.add_widget(my_layout_button) + self.mobile_button = MobileButton(my_layout_button) + + self.darkness_circle.change_radius( + self.darkness_circle.radius + START_BEACON_CASES) + + ################################## + ### Controls with the keyboard ### + ################################## + + def update_on_key_down(self, keyboard, keycode, text, modifiers): + """ + Update the the list of keys pressed when the key is down. + + Parameters + ---------- + keyboard + + keycode: int + Integer representing the key pressed by the user + + text + + modifiers + + Returns + ------- + None + """ + return self.update_list_keydown("keydown", keycode) + + def update_on_key_up(self, keyboard, keycode): + """ + Update the the list of keys pressed when the key is up. + + Parameters + ---------- + keyboard + + keycode: int + Integer representing the key pressed by the user + + Returns + ------- + None + """ + if keycode[1] in self.DICT_KEYS.values(): + self.list_keyup.append(keycode[1]) + return self.update_list_keydown("keyup", keycode) + + def update_list_keydown(self, action, keycode): + """ + Update the list of keys pressed by the user. + + Parameters + ---------- + action: Literal["keydown", "keyup"] + String to explain how is pressed the key + + keycode: int + Integer representing the key pressed by the user + + Returns + ------- + None + """ + key = keycode[1] + if action == "keydown" and not (key in self.list_keydown): + self.list_keydown.append(key) + if action == "keyup" and key in self.list_keydown: + self.list_keydown.remove(key) + + def _keyboard_closed(self): + """ + Unbind the keyboard. + + Parameters + ---------- + None + + Returns + ------- + None + """ + self._keyboard.unbind(on_key_down=self.update_on_key_down) + self._keyboard.unbind(on_key_up=self.update_on_key_up) + self._keyboard = None + + def get_movements_keyboard(self): + """ + Extract the movement entered by the user to move the character. + It only takes into account the movements with the keyboard. + + Parameters + ---------- + None + + Returns + ------- + x_movement: float + Movement on the x axis + + y_movement: float + Movement on the y axis + """ + x_movement = 0 + y_movement = 0 + for key in self.list_keydown: + for movement in self.DICT_KEYS: + if key.lower() == self.DICT_KEYS[movement]: + if movement == "top": + y_movement = 1 + if movement == "bottom": + y_movement = -1 + if movement == "right": + x_movement = 1 + if movement == "left": + x_movement = -1 + if x_movement != 0 and y_movement != 0: + x_movement = x_movement / SQUARE_TWO + y_movement = y_movement / SQUARE_TWO + return x_movement, y_movement + + ###################### + ### General udpate ### + ###################### + + def update(self, *args): + + # Block the game update if the game is over + if self.is_game_over: + self.game_over() + return + + # Get the last movements of the character + if MOBILE_MODE: + x_movement, y_movement = self.mobile_joystick.get_direction() + self.mobile_joystick.draw() + else: + x_movement, y_movement = self.get_movements_keyboard() + + # Get the interactions with the buttons + if MOBILE_MODE: + if self.mobile_button.get_state(): + self.list_keyup = [self.INTERACT_KEY] + self.mobile_button.draw() + + if DEBUG_MODE and self.count_frame % 60 == 0: + self.fps_label.text = str(round(Clock.get_fps(), 2)) + + # Increase the frame counter + self.count_frame += 1 + + # Decrease the intensity of the beacon + self.beacon_life -= self.rate_diminution_light + self.progress_bar_beacon.value = self.beacon_life + if self.beacon_life < 0: + self.grid_map.set_tile_type( + position=(floor(self.beacon_position[0]), floor( + self.beacon_position[1])), + value="R") + self.darkness_circle.change_radius(0) + + # Manage crystal sound + current_map_center_grid_pos = self.get_map_center_grid_pos() + + if self.prec_map_center_grid_pos != current_map_center_grid_pos: + self.is_crystal_near = self.search_near_crystal( + current_map_center_grid_pos) + self.is_beacon_near = self.search_near_off_beacon( + current_map_center_grid_pos) + self.manage_near_beacon_sound() + self.manage_near_crystal_sound() + + # Update the position of the character on the map + self.update_char_on_map_position( + x_movement=x_movement, + y_movement=y_movement) + + # Get the interactions of the character with the environment + self.manage_in_darkness() + self.interact_with_environment() + self.update_darkness_position() + + self.update_map_on_screen_position() + self.update_char_on_screen_position() + + self.redraw_interface() + + sound_mixer.recursive_update() + # Play randomly the water drops + if rd.random() < PROBABILITY_WATER_DROPS: + if sound_mixer.musics["flic"].state != "play": + sound_mixer.play("flic", stop_other_sounds=False) + + +################# +### Functions ### +################# + + +def load_grid_map(filename: str): + """ + Load a map from a file. + + Parameters + ---------- + filename: str + Path of the file to load + + Returns + ------- + grid_map: list[list[str]] + Map with letters discribing each tile + """ + + # Read the file + with open(PATH_MAPS + filename + ".txt", mode="r", encoding="utf-8") as file: + lines = file.readlines() + + # Create the grid map + grid_map = [] + + for line in lines: + # Clean new lines + line = line.replace("\n", "") + + # If line is not empty + if line.replace(" ", "") != "": + + # Clean double spaces + line = line.replace(" ", " ") + + # Remove last character if space + if line[-1] == " ": + line = line[:-1] + + # Remove first character if space + if line[0] == " ": + line = line[1:] + + # Split on spaces + tiles = line.split(" ") + + # Add the tiles to the grid map + grid_map.append(tiles) + + return grid_map + + +def load_texture(image_file): + """ + Load a texture and create an Image widget in Kivy. + + Parameters + ---------- + image_file: str + Name of the image + + Returns + ------- + None + """ + texture = Image(source=image_file).texture + texture.mag_filter = "nearest" + return texture + + +def load_textures_from_atlas(atlas_name: str): + """ + Load the textures in the atlas, given the name of the atlas. + + Parameters + ---------- + atlas_name: str + Name of the atlas + + Returns + ------- + None + """ + + # Set the global path for the atlas and open it + path_atlas = PATH_ATLAS + atlas_name + ".atlas" + atlas = Atlas(path_atlas) + + # Extract the textures from the atlas + dict_textures = {} + for texture in atlas.original_textures: + texture.mag_filter = "nearest" + for key in atlas.textures: + dict_textures[key] = atlas[key] + + return dict_textures + + +############### +### Process ### +############### + +TEXTURE_DICT = load_textures_from_atlas("map_textures") +# TEXTURE_DICT["hero"] = load_texture(PATH_CHARACTER_IMAGES + "front.png") +TEXTURE_DICT["blank"] = load_texture(PATH_IMAGES + "blank.png") +TEXTURE_DICT.update(load_textures_from_atlas("ghost_textures")) diff --git a/tools_dev.py b/tools_dev.py new file mode 100644 index 0000000..34a70f7 --- /dev/null +++ b/tools_dev.py @@ -0,0 +1,112 @@ +import os + +from math import ceil, sqrt + +from PIL import Image as PIL_Image + +from tools.tools_constants import PATH_ATLAS, DICT_TILES_TEXTURE, PATH_MAP_TEXTURES, PATH_CHARACTER_IMAGES + +from tools.tools_basis import save_json_file + +from tools.tools_map import create_new_map, grid_to_string + +from tools.tools_world_explorer import load_grid_map + + +def create_atlas_from_folder(folder_path: str, rescale_size: tuple = None) -> None: + """ + Create an atlas with pictures contained in a folder. + + Parameters + ---------- + folder_path: str + Path to the folder containing the images + + rescale_size: (int, int) + Rescale the images + + Returns + ------- + None + """ + + # Get the list of files in the folder + file_list = os.listdir(folder_path) + atlas_name = os.path.basename(folder_path[:-1]) + atlas_texture_name = atlas_name + ".png" + + # Compute variables to define the atlas + nb_pictures = len(file_list) + nb_textures_on_side = ceil(sqrt(nb_pictures)) + if rescale_size is None: + image = PIL_Image.open(folder_path + file_list[0]) + rescale_size = image.size[0] + + # Create the atlas texture + atlas_side = rescale_size * nb_textures_on_side + atlas_size = (atlas_side, + atlas_side) + atlas_texture = PIL_Image.new(mode="RGBA", + size=atlas_size) + + # Create the atlas dict + atlas_dict = {atlas_texture_name: {}} + + # Create the atlas + for i, file in enumerate(file_list): + + # Extract the name of the file + file_name = file.split(".")[0] + + # Open the image + image = PIL_Image.open(folder_path + file) + image = image.resize((rescale_size, rescale_size)) + + # Compute its coordinates + x_coord = (i % nb_textures_on_side) * rescale_size + y_coord = (i // nb_textures_on_side) * rescale_size + texture_box_PIL = [x_coord, y_coord, rescale_size, rescale_size] + texture_box_atlas = [x_coord, + atlas_side - y_coord - rescale_size, rescale_size, rescale_size] + atlas_texture.paste(image, + texture_box_PIL[:2]) + + # Add the texture to the atlas + atlas_dict[atlas_texture_name][file_name] = texture_box_atlas + + # Save the atlas + atlas_texture.save(PATH_ATLAS + atlas_name + ".png") + save_json_file(PATH_ATLAS + atlas_name + ".atlas", atlas_dict) + + +def create_map_single_image(grid_map, tile_size, image_folder_path): + """ + Create the map in png to visualize it quickly. + """ + x_size = len(grid_map[0]) + y_size = len(grid_map) + map_size = ((x_size) * tile_size, (y_size) * tile_size) + map_texture = PIL_Image.new(mode="RGBA", + size=map_size) + + for x in range(x_size): + for y in range(y_size): + image = PIL_Image.open(image_folder_path + + DICT_TILES_TEXTURE[grid_map[y][x]] + ".png") + image = image.resize((tile_size, tile_size)) + + image_box = [x * tile_size, + y * tile_size, tile_size, tile_size] + + map_texture.paste(image, box=image_box[:2]) + + map_texture.save("map.png") + + +create_atlas_from_folder(folder_path=PATH_MAP_TEXTURES, rescale_size=100) +create_atlas_from_folder(folder_path=PATH_CHARACTER_IMAGES, rescale_size=100) + +# grid_map = create_new_map(True, []) +# # # grid_map = load_grid_map("magic_forest") +# # create_map_single_image(grid_map, 50, PATH_MAP_TEXTURES) +# print(grid_to_string(grid_map))