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
What is scaling and shearing? The scaling transformations alters the shape of an object and can be carried out  by multiplying every vertex (x,y) by scaling factor Sx, Sy where

Geometric continuity - Properties of Bezier Curves Geometric continuity is the other process to join two successive curve sections. G 0 continuity is the similar as parametri

Well you might surprise to what a convex window? In common, on the basis of the shapes the windows are categorized into two classes: i) A Convex shaped windows: Windows of a s

all details of Graphical User interface and interactive input methods

Define clipping and covering (exterior clipping)? Clipping is the process of cutting a graphics display to neatly fit a predefined graphics region or the view port.  This is

Curve segment - properties of bezier curves Note : 1) The joining point on the curve along w.r.t. the parameter based upon second derivates of Q(t) is the acceleration. Wh

Perspective Distortion - Polygon Rendering and Ray Tracing Methods Anomalies are introduced since interpolation is performed after perspective transformation in the 3-D scree

Describe any two methods for drawing thick lines. Two method for drawing thick lines are: (1) Using the line- width command: "setline width scale factor (iw)" Line width param

QUESTION (a) Explain the steps involved in performing Image based processing. (b) Propose a mask using a 3X3 matrix, which would help in discovering discontinuities, and hen

The image you have been given for contour extraction is shown in Figure 1. The method for constructing the search space is shown in Figure 2. It is generated from two initial discr