Basic graphics and mouse events, Computer Graphics

For this assignment, you will program a game called Pig. Pig is a two-player game where players compete to be the first to reach (or surpass) 100 points. Pig usually involves players taking turns rolling a regular 6-sided die. However, in your computer version of the game, you will simulate rolling a die by generating a random number from 1-6 and then display the number on the screen.

Your program does not have to look exactly like the one above; in fact, we encourage you to be creative with the layout so that you can gain more experience with the graphics APIs. There are some constraints that you have to follow though, which are described later.

The rules for Pig are as follows:

_ Player 1 and Player 2 both have scores that start at 0. There is also a trough, which starts at 0 points. Player 1 goes first.

_ On each turn, the player has the option to either roll or pass.

_ If the player chooses to roll, then he or she rolls the die.

_ If the roll was 2-6, then that number of points is added to the trough, and it remains the same player's turn (he or she may choose to roll or pass again).

_ But, if the roll was 1, then the trough is reset back to 0, the player receives no points, and it becomes the opposing player's turn.

_ If the player chooses to pass, then the number of points in the trough is added to his or her score, the trough is reset back to 0, and it becomes the opposing player's turn.

_ The game ends once one player's score reaches or exceeds 100 points, at which point that player is the winner.

Posted Date: 2/28/2013 6:32:36 AM | Location : United States

Related Discussions:- Basic graphics and mouse events, Assignment Help, Ask Question on Basic graphics and mouse events, Get Answer, Expert's Help, Basic graphics and mouse events Discussions

Write discussion on Basic graphics and mouse events
Your posts are moderated
Related Questions
1. Explain the Bresenham line generation algorithm via digitizing the line with end  points as (15, 5) and also (25,13). Ans. Now we are utilizing the Bresenham line generati

Curves and Surfaces - Modeling   and Rendering We have studied the method of drawing curves in diverse coordinate systems. Also we got the concept that it is the revolution of

Define pixel and frame buffer? Pixel is shortened forms of picture element. Every screen point is referred to as pixel or pel.  Picture definition is kept in a memory area c

What are the features of Inkjet printers?  They can print 2 to 4 pages/minutes. Resolution is about 360d.p.i. Thus better print quality is achieved. The operating

JAS: The JAS file formats were implemented to form the smallest possible picture files for 24bits per pixel image and 8 bit per pixel gray scaled pictures. This uses a discrete co

Define coherence properties?  A coherence property of a scene is a part of a scene by which relate single part of the scene with the other parts of the scene.

State the Advantages AND Disadvantages of CAD       Advantages of CAD                                                               Disadvantages of CAD - Easier to modif

MULTIMEDIA TOOLS : In this sense, we will emphasize on various tools utilized in the field of multimedia. Basic Tools: The fundamental toolset for building multimedia p

when dda algorithm is more efficient than bresenhem line drawing algorithm

Reflection about a Line - 2-D and 3-D Transformations Reflection is a transformation that produces the mirror image of an object. Since we discussed that the mirror reflection