1 / 18

Final Project Virtual Slot Machine.

Final Project Virtual Slot Machine. By: Bander Alrogi Khaled Al Nuaimi Mohammed Almajhad Metaib Al-Enzai Course Title: ECE 2552 Instructor: Dr Kepuska Spring 2005. Concepts Used. Classes Inheritance Abstract Class Graphic Mode and Objects Sound Function. Objective.

rafi
Download Presentation

Final Project Virtual Slot Machine.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Final ProjectVirtual Slot Machine. By: Bander Alrogi Khaled Al Nuaimi Mohammed Almajhad Metaib Al-Enzai Course Title: ECE 2552 Instructor: Dr Kepuska Spring 2005

  2. Concepts Used • Classes • Inheritance • Abstract Class • Graphic Mode and Objects • Sound Function

  3. Objective • To create a program that is a simulation of a Virtual Slot Machine used specially for gambling. Color shapes appear in a window, as if slot machine wheels were turning.

  4. Functionalities When we start the program, three square windows appear on the screen. One of four different shapes appears randomly in each window. Red circle (apple), blue circle (blueberry), square, and pyramid. Each time a shape appears, a click sound is heard. Gradually, the shapes appear more and more slowly, as if the slot machine wheel were slowing down. Finally they stop, and the program sounds a two-tone signal. If the three shapes are same, you win otherwise you lost.

  5. Class Hierarchy Shape Ball Rectangle Triangle No Shape Apple Blueberry Square Pyramid Wheel

  6. Graphics • Display Points, Lines, and Shapes • Address individual pixels and dots • Resolution of 640*480 VGA mode can address 307,200 pixels

  7. Graphics • initgraph() Function: It must be executed before any other graphic mode function can be used. It switches your computer’s display system into the appropriate graphics mode. Uses Graphic.h header file

  8. Graphics • Graphics Driver To specify the mode, we need to choose appropriate values for the parameters to initgraph(). • Graphics Mode Specify the specific mode to be used. For example CGA, EGA, VGA,….

  9. Graphics • Driver = DETECT Let the system decide what graphic mode to use, it checks the adaptor and choose the driver and mode that gives the highest resolution. Set the driver argument to the constant DETECT.

  10. Graphics initgraph(&drive, &mode, "c:\\tc\\bgi"); • Address of Operator: & Instead of using like EGA and EGAHI, we placed them in variables driver and mode. & Symbol address where the constants are stored.

  11. Graphics initgraph(&drive, &mode, "c:\\tc\\bgi"); • Path: It’s the path to the graphic driver. This argument must be specified whether you use auto-detect or specify a mode yourself.

  12. Graphics Closegraph() • When exit from the graphics program, we should restore the system to the video mode that was previously in use.

  13. Sound Generation Sound Generation requires three steps • Turning the sound on • Delaying for an appropriate amount of time • Turning the sound off

  14. Sound Generation • Sound() function It sets the sound generation to a specific frequency in Hertz. The range of the frequency varies from 15 Hertz to 3000 Hertz. Once this function is executed, the sound remains on until specifically stopped.

  15. Sound Generation • Delay() function Function to control how long the sound will continue. It takes simple argument in milliseconds. • Nosound() function Takes no argument and it turn off the sound.

  16. Drawing Shapes • Circle It takes the (x, y) co-ordinates and radius as parameters to draw it circle (x, y, radius);

  17. Drawing Shapes • Rectangle It takes the top-left co-ordinates and the right-bottom co-ordinates as parameters to draw it rectangle (x1, y1, x2, y2);

  18. Drawing Shapes • Triangle Fillpoly function draws and fill a polygon. It takes 2 input arguments. Number of points, and the points to a sequence of (numpoint * 2). Each pair of integers gives x and y co-ordinates of a point on the polygon. triangle[] = {x1, y1, x2, y2, x3, y3}; fillpoly (3, triangle[]);

More Related