Code Monkey home page Code Monkey logo

dorefindmi's Introduction

DoReFindMi

This is a game for Rainbow HAT for Android Things in which the aim is to find the sequence of the ABC buttons to press, which if followed in correct order, will play out the "do-re-mi" melody. The player's seek time is measured for an element of competitiveness.

Pre-requisites

Game flow and rules

  • The game starts when the 3 step counter reaches zero and game timer starts
  • The player needs to guess the order of the 8-step order of the A, B, C buttons
  • When pressed in correct order, the buzzer plays the “do-re-mi” melody, and the led strip lights up the leds one by one, from left to right
  • When an incorrect button is pressed a low-frequency sound is played out, the led lights reset and the player has to guess the order from the start
  • The round is won when the player completes the sequence after which the alphanumeric display displays WON! followed by the time it took the player to win
  • A game is restarted by pressing on the buttons again, when a new sequence of steps is generated, and next players can attempt to complete their rounds in fastest time

Demo

Demo

Dependencies and architecture

The game makes use of the following individual components provided by Rainbow HAT:

  • Buttons
  • Gpio Leds
  • Piezo Speaker
  • Apa102 Led Strip
  • Alphanumeric Display

Classes which provide access to these components implement things.supplier.*Supplier adapter interfaces and contain minimal logic to enable replacing them with other compatible devices, or a subset thereof, or stubs in tests. There are unit tests which do just that in the test source set. The logic of interaction with the devices is implemented in their respective things.controller.*Controller classes. A game contains of rounds which are initiated and announced when completed by GameController class, and Player’s *moves/guesses* are validated by Game class.

Build and install

In Android Studio, click on the "Run" button. If you prefer to run on the command line, type

./gradlew installDebug
adb shell am start com.tomaszrykala.dorefindmi/.DoReFindMiActivity

Schematics

No idea, I’ve used Rainbow HAT (contributions welcome).

Contributions

As above ;-)

Next steps

At the moment there are no hints as to what buttons should players press, akin to the popular game Simon (I genuinely did not know of it until a friend told me this project is like it). This should probably be added, because it can be argued that currently winning a game is based on pure luck, with just a little of short term memory requirement :-)

Credits

These excellent blogs helped to get this project off the ground:

License

Copyright 2017 Tomasz Rykała

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.

dorefindmi's People

Contributors

tomaszrykala avatar winteripe avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

winteripe

dorefindmi's Issues

Recommend Projects

  • React photo React

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

  • Vue.js photo Vue.js

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

  • Typescript photo Typescript

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

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

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

  • web

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

  • server

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

  • Machine learning

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

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

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

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.