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

Ambient reflection-polygon rendering & ray tracing methods , Ambient Reflec...

Ambient Reflection-Polygon Rendering & Ray Tracing Methods When we go for the examiner of light effects, so surroundings play a significant role and it is assumed as there

Two point and three point perspective transformations, Two-Point and Three-...

Two-Point and Three-Point Perspective transformations The two-point perspective projection can be acquired by rotating about one of the principal axis only and projecting upon

Is cad only helpful for design drawings, Question: Is CAD only helpful for ...

Question: Is CAD only helpful for design drawings? No. When true-scale, structurally valid drawings are the purpose for CAD's existence; it utilizes is as diverse as imagination

Three dimensional transformations, Three Dimensional Transformations A ...

Three Dimensional Transformations A 3D geometric transformation is used extensively in object modelling and rendering.2D transformations are naturally extended to 3D situations

Multimedia business, Multimedia Business: Even fundamental office app...

Multimedia Business: Even fundamental office applications as a MS word processing package or a MS Excel spreadsheet tool turns into a powerful tool along with the aid of mult

Positive accelerations - computer animation, Positive Accelerations - Compu...

Positive Accelerations - Computer Animation So as to incorporate increasing speed in an animation the time spacing among the frames should increase, hence greater change in th

Education, Education, Training, Entertainment and Computer Aided Design ...

Education, Training, Entertainment and Computer Aided Design CAD or CADD is an acronym which depending upon who you ask, can stand for: I. Computer Assisted Design. II.

Advantages of the z-buffer method, Advantages of the z-buffer method:      ...

Advantages of the z-buffer method:              1) The z-buffer method or algorithm is easy to apply and it needs no sorting of surface in a scene. 2) In z-buffer algorithm

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

File Formats that are used for Bitmap Data Bitmap data can be saved in a wide variety of file formats are: • BMP: restricted file format that is not appropriate for use in

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