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

Assumption for diffuse reflection - polygon rendering, Assumption for Diffu...

Assumption for Diffuse Reflection - Polygon Rendering  i) the diffuse reflections by the surface are scattered along with equal intensity in each direction, independent of vie

Types of graphic images, Types of Graphic Images: Graphic images have...

Types of Graphic Images: Graphic images have been processed through a computer can generally be divided in two distinct categories. That image is either bitmap files or vecto

Character Generation, Explain Various techniques of Character Generation Al...

Explain Various techniques of Character Generation Algorithm?

Military-applications for computer animation, Military: In order to enter ...

Military: In order to enter the military, one has to go by various training. Depending upon whether you want to be in the army, navy or the marines, you may be working along with

Storing information structures in display memory, What is the major disadva...

What is the major disadvantages of storing information structures in display memory? A major disadvantage of storing information structures in display memory is that when color an

Briefly explain color profile, Question 1) Why are selection tools useful?...

Question 1) Why are selection tools useful? Describe them based on different categories Question 2) What are the different types of layers? Describe each type Quest

#title., WHAT IS PAINTERS ALGORITHM?

WHAT IS PAINTERS ALGORITHM?

Mathematical description of oblique projection onto xy-plane, Mathematical ...

Mathematical description of an Oblique projection onto xy-plane  In order to expand the transformation for the oblique projection, identify the Figure. This figure explains a

Amiga - hardware for computer animation, Amiga - Hardware for computer anim...

Amiga - Hardware for computer animation Originally owned through Commodore, Amiga computers have conduct a position in the computer animation industry for many years. This is

Spline curve - modeling and rendering, Spline curve - Modeling and Renderin...

Spline curve - Modeling and Rendering Spline curve is created by using Control points that control the shape of the curve Spline curve is a composite curve formed along with s

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