marceluphd / android_slot_machine

An Android slot machine game developed in Java, practising TDD, no frameworks.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fruit Machine

The Spec:

Goal: Create a fruit machine in Android.

Last week, for your homework you were asked to create a fruit machine using objects modelled in Java. You are now being asked to take that Java code and use it as the basis for an Android app which simulates the same fruit machine.

MVP

The aim is to display the results of the Java logic already written. For example, if the user spins and lands 3 matching symbols a winning message is displayed and their winnings updated and stored. Users should also be allowed to nudge and hold at random times.

Project Extensions

  • Display the symbols above and below as well to help with nudges
  • Allow users to choose from Symbol Packs (Different games.)
  • Extend to 5 reels
  • Improve the UI

General Rules (Applies to ALL projects)

  • DO NOT USE ANY FRAMEWORKS - this includes Java Swing and similar packages.

My Approach

As I already had working code from the homework which ran in the terminal, my planning was very basic. I decided to write the code for this project from scratch using TDD using the homework as a reference. My homework became the blueprint instead of drawing up diagrams and I made notes of the things I would need to add or change to allow the extra features (nudge and hold) to work. Starting from scratch also allowed me to clean up and SOLIDify the code. The only other planning I did was to draw up my wireframes.

The Outcome

I had my MVP up and running on day 3 of the project which allowed time to add extensions and refactor. I had made the slot machine class extendable to allow extra wheels and my tests showed that it was possible. However, I decided against extending the app to 5 reels because I felt I wouldn't learn anything by doing it, the code would have been the same. I would just have to add more buttons and images to the screen which is timely and I felt it would benefit me more to learn something new. I did manage to display the extra symbols on the screen and from there I moved on to improving the interface. I wanted to learn and implement something new at that stage so I looked up how to add animation and sounds. This ended up working really well and drastically improved the UI. As an added extra; I whipped up a bonus minigame in just over an hour to see how much I had learned. The game runs really well and I had time to refactor my code to a point where I was satisfied. There are a few things I would want to change and add in to finish things up but overall I was very happy with the end product.

About

An Android slot machine game developed in Java, practising TDD, no frameworks.


Languages

Language:Java 100.0%