Home



Final Project - 3D Slot Machine v 1.0 - Home
Page Last Modified: December 4, 2003

This web page is to help play the game and to also explain how it works.

Current Issues:

  • This is the first version of the slot machine.

  • Picking is not enabled for the lever of the slot machine. In the current version, clicking the mouse and moving it in any direction will move the lever.

  • To date, I have not yet implemented the "rigging" of the slot machine. I want to eventually program it so that it doesnt land on certain values as much as it currently does, namely the cherry. Also, I want to add "cheats" to where the user will get a good reel (e.g. three of the same val) if a good amount of games are played. Or, if the user is getting low on money, little "encouragement" winning combinations can be programmed in.

How To Play (User's Guide) :

  • Playing the game is very simple, all the user has to do is choose a betting value, either one, two, or three credits, and spin the reels. This basically consists of two steps.
  1. Pick bet:
    The default bet is one credit, and will remain that value until the use changes it. The numbers 1, 2, and 3 on the keyboard toggle the desired betting amount. The amount being bet is displayed underneath the slot machine.

  2. Spinning the reels:
    There are two ways to do this. First by left-clicking the mouse, holding it down and moving the mouse down (which rotates the lever) until the reels start spinning. The second way is to press the 's' button on the keyboard.

About The Design (Overall Description of Project):

  • Minor details about drawing objects:
    - The slot machine case was drawn by hand, but all other objects used opengl funtions (quadrics).
    - The sides of the cylinders are drawn in where appropriate, using disks.

  • The basic design deals with drawing 3D objects and doing basic transformations on them to get the desired look. Texture mapping is used to give the reels their look.

  • The complicated part of the design was making the program a state machine. Since the display function had to be called to make changes to the display, the program had to have different states to reflect a spinning state and a static state. It was important that the program was implemented this way in order for the user to actually see the reels rotating.

  • Another part that was complicated was getting random numbers to work correctly. Usually general random number generators generate the same sequence of random numbers every time (if they are using the same seed). The rand() function provided by C++ produced the same sequence of random number every time my program was executed, so I had to tweak it a little to get different sequences to come out each time. With that done, I believe that no two instances of playing the slot machine will be identical.

  • The last main part of the program that deserves mentioning was determining if a hand is a winning hand or not. This consisted of figuring out what values are being displayed to the user and what combinations of the values are winning combinations. Determining which picture values are being displayed was a little bit of a challenge, I determined where the reel was relative to the amount of rotation that was done during the spinning of the reels. After I did this, figuring out which combinations are winning combinations was a simple if-else list of combinintions.

  • The combination that the reels land on will determine how much money is won or lost. A simple message is displayed to the user (above the slot machine case) describing a winning combinations. So far, the amount of winning combinations is somewhat limited because I did not have enough time to code in every single combination. The amount that exist are sufficient to play the game. As I have been playing it seems like the odds are for the house over all, though the machine is not rigged and completely random.