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
when dda line drawing algorithm is more efficient than bresenhem line drawing algorithm?

Multimedia: it is the use of different media to present a specific subject. This representation itself is a multimedia presentation implies; it brings together text and graphics.

Basics of Animation - Computer animation Historical and traditional methods for production of animation: As we have studied the transformations linked in computer graphics

How can I perform feature extraction on images of different classes? How to obtain a vector of each class that contains its features?

Rotation about the origin - 2-d and 3-d transformations Specified a 2-D point P(x,y), which we need to rotate, along with respect to the origin O. The vector OP has a length '

Liang Barsky line clipping algorithm : The algorithm uses parametric form of the line segment.  Four inequalities are created using the parametric form of the line segments.  Th

Dissimilarity between the Printer and the Plotter 1)  Plotters print their output through moving a pen across the surface of paper's piece. It implies that plotters are lim

Distinguish between bitBlt and pixBlt?  Raster functions that manipulate rectangular pixel arrays are usually referred to as raster ops. Moving a block of pixels from one locat

Draw and explain the diagram of a Raster scan system with a display processor. Explain each unit of the diagram.

Write a code to generate a composite matrix for general 3D rotation matrix.  Test your code and rotate continuously a cube about an axis.