Basic graphics and mouse events, Computer Graphics

Assignment Help:

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.


Related Discussions:- Basic graphics and mouse events

Explain clearly the condense editing using examples, QUESTION 1. Creat...

QUESTION 1. Create a COMPLETE storyboard for a movie of 2 minutes duration on ONE of the following subject: a. Poverty b. Global Warming c. Smoking d. Drugs e. D

File formats that are used for vector data, File Formats that are used for ...

File Formats that are used for Vector Data This data can be saved in a wide variety of file formats are as: •EPS: the most well-accepted file format to exchange vector dra

Random scan display device - types of refresh monitors, Random Scan Display...

Random Scan Display Device The original cathode ray tube, developed in the late fifties and early sixties, produced charts and pictures, line through line on the tube surface

Functioning of input devices - 2d shape primitives, Functioning of Input De...

Functioning of Input Devices Functioning of input devices-Keyboard, mouse, trackball and space ball, Joystick, data glove, digitizer, scanner, touch panel, light pen, voice sys

Curve segment - properties of bezier curves, Curve segment - properties of ...

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

Alias wavefront - softwares for computer animation, Alias Wavefront - Softw...

Alias Wavefront - Softwares for Computer Animation Alias is one of the highest computer animation packages out there. Alias was formed by the company which used to be Alias, a

Key frame systems - computer animation, Key Frame Systems - computer animat...

Key Frame Systems - computer animation This method is for low-level motion control. In fact these systems comprise languages that are designed simply to produce the in-between

Data set, In this project, the image data set consists of 320 training imag...

In this project, the image data set consists of 320 training images and 285 test images. Table 1 shows the image data set in details. In addition to the original images, th

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd