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
Introduction of Curves and Surfaces This section has covered the methods of generating polygons, closed and curves surfaces. Under those methods we have discussed different ty

Question (a) Define the term Multimedia. (b) Describe any four important tools you know about for a virtual campus. (c) Following our discussion in our lecture list an

QUESTION (a) Suppose that you have been assigned to re-engineer the existing systems for a company. Do you think that design patterns can be applied to these existing systems?

Polygon Rendering and Ray Tracing Methods In previous section we had discussed various methods for visible-surface detection, although in order to produce visibility the prese

Notes for Specular reflection (1) In addition to diffuse reflection, light sources produce highlights or bright spots termed as specular reflection. Such highlighting is extre

Write a C program to create a window of specified size and position and draw the following objects with dimensions of your choice, to fit within the window.   (a) A point  (b) A


Local Illumination Model - Polygon Rendering In this only light that is directly reflected by a light source through a surface to our eyes is observed. No explanation is taken

Example1: Translate a square ABCD along with the coordinates as: A(0,0),B(5,0),C(5,5),D(0,5) via 2 units in x-direction and 3 units in y-direction. Solution: We can show the

Q. Define Advanced Graphics Port? AGP signify Advanced (or Accelerated) Graphics Port. It's a connector standard defining a high speed bus connection between the microprocessor