联系方式

  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp

您当前位置:首页 >> CS作业CS作业

日期:2018-05-25 08:23

ITD121 Programming Principles: Class Assignment QUTIC TP1, 2018

Page 1 of 4

Class Assignment: YAHTZEE Part A

Due Date: 01 June 2018 (Friday Week 13) Weighting: 40%

Specification Version 1.0 (19th April 2018)

In this assignment you have the option of working in pairs. If you work alone, you will not receive any special consideration. Pairs need to be registered by the 11th May (end of week 10). To register, one person in each pair needs to email the unit coordinator with the full name and student id of both members of the pair. 1. Overview

This assignment aims to give you a "real world experience" that occurs often in the workplace. You have been hired to complete a project that has not been fully specified at this stage and you have been given (in your mind) an impossible delivery date. There will be supporting documentation to the project which will be released in stages over the next few weeks.

This assignment is known as the Class Assignment because it will use multiple C# classes in contrast to your earlier assignments where all of your code was in a single class.

You are to implement a prototype of a computerised version of a popular dice game, named Yahtzee. It is recommended that if you are not familiar with this game that you first read the rules of playing Yahtzee as it is important that you understand the language used in playing this game. There are other sites including Wikipedia which explain this game just as well. A separate Yahtzee Rules document, which stipulates the rules required for this project game, can be found on Blackboard.

There are various online versions of the game which you can play to gain familiarity with the game. However their GUI interfaces are much more sophisticated than the one specified for this project.

You will be provided with a near complete object oriented design for this assignment which will include UML class diagrams for both the GUI and various classes which will constitute the game logic along with written documentation.

You will also be given a prototype project folder (Yahtzee template) which will contain an almost bare GUI Form which will be the basic starting point for the assignment described in the Part A Specification. Do not start your own project folder.

The controlled release of the assignment is to enable you to make progress incrementally without being overwhelmed by the sheer complexity of the entire project. You should start each part soon after its release. 2. The Task

You are to implement a prototype of a computerised version of Yahtzee. You are required to:

(a) Use Windows Forms, rather than other GUI technologies such as WPF, XNA, web-pages, game engines, etc. (If you don’t know what some of these acronyms mean, that’s fine. Just ignore them.)

(b) Develop the game which will play according to the specified rules for this project. (See separate Yahtzee Rules document on Blackboard.)

(c) Produce a GUI layout which will be described in this and subsequent specification releases. 3. The Objective of Part A

This objective of Part A of the project is to begin the implementation of the GUI form which will look like the following screenshot. Your form’s background is your choice. The screenshot used "Dodger Blue" which is one of many colours available on the Web tab of the BackColor Property.

This specification will include some specific Property requirements for the different Labels, Buttons and Checkboxes that are on the Form.

ITD121 Programming Principles: Class Assignment QUTIC TP1, 2018

Page 2 of 4

4. Project folder

Open the Solution file Yahtzee Game.sln and then open Form1.cs

You will see that the Form contains a SplitContainer which has divided the Form into two Panels: one on the left, for the Labels, Buttons and Checkboxes in previous screenshot; and one on the right for some other controls that will be introduced in a later specification.

Figure Figure Figure Figure Figure 1: Part A : Part A : Part A : Part A : Part A –GUI designGUI design GUI designGUI designGUI design

Figure Figure Figure Figure Figure 2: Empty Empty Empty Empty Form with with with SplitContainer SplitContainer in Design View in Design View in Design View in Design View in Design View

ITD121 Programming Principles: Class Assignment QUTIC TP1, 2018

Page 3 of 4

You can’t really see the SplitContainer, just its two panels. The SplitContainer is docked in its parent container, so that its panels occupy the whole of the form, i.e. its Dock property is Fill. (This is the default behaviour when you add a SplitContainer to a Form, so you shouldn’t have to do anything. But if you accidentally change this property, your form will look a mess.) This control is complete. Its position on the form is correct. Do not move it.

If you execute the project the following Form is displayed, though not in the size shown below

5. The GUI controls

Figure 1 shows the main Form of the game is entirely within panel1. The top part of the Panel has Labels for five dice and a button to click to roll the dice. Below that are five Checkboxes, one for each die to stop the die from being rolled, with a Label that explains this.

Next is a Label for a message to tell the player what they are to do next. The possible messages that can appear on this Label for the basic game play include:

? "Roll 1";

? "Roll 2 or choose a combination to score";

? "Roll 3 or choose a combination to score";

? "Choose a combination to score"; and

? "Your turn has ended - click OK".

An OK Button will appear below the message label at the appropriate time.

The rest of the panel shows the information for the Player. It shows the player's name (Label) and a score Label for every combination. A score will be displayed for every combination that the player has attempted, and any combinations not attempted will remain blank.

There are 13 Buttons, one for each combination. There are also some sub-total and total values Labels, including a Grand Total that will be shown when the game has finished. 6. Developing the GUI

The following describes some essential features of some controls. Any control not explicitly mentioned should be placed on the Form similar to that shown in Figure 1. Choose sensible names if none are stated. In general, your Form should be readable, well laid out (formatted) and provide an intuitive interface for the user.

Figure Figure Figure Figure Figure 3: Runtime view of e Runtime view of e Runtime view of eRuntime view of e Runtime view of e Runtime view of e mpty mpty mpty Form with with with SplitContainer

ITD121 Programming Principles: Class Assignment QUTIC TP1, 2018

Page 4 of 4

Dice Labels

Onto the Form, place the five (5) Labels which will hold the separate die face values after a roll. The dice Labels need to have their AutoSize property set to false, before deleting the default text. The BackColor needs to be set to a colour which will make the Label visible. For example, in the screenshot in Figure 1 White from the Web tab was selected. The Width and Height should be the same so the Label shape is square. Though it will show no result for the moment, the TextAlign Property should be set to Middle Center. Name these Labels: die1, die 2, etc.

Various Labels

The message Label font size is 15 and has a ForeColor which will make the text visible against the background colour. This Label will initially display "Roll 1".

The Player Label has a font size of 25 and the two "Section" Labels have a font size of 20.

Until multiple players are introduced in a later specification, the Player Label will not be updated with a player’s name.

Combination Controls

Place the thirteen (13) Buttons onto the Form one after another so their default names (Name) are "button1", "button2" … "button13". Change AutoSize to true this will ensure that the Buttons retain the same general appearance though some will be wider than others.

Align the right hand edge of the Buttons in each column after having changing the Text of each.

The thirteen (13) score Labels for each Button should be added to the Form one after the other with their default names (Name) set to "scoreLabel1", "scoreLabel2", etc. (Ignore this advice at your own peril!)

Set AutoSize to false, before deleting the default text. Set TextAlign to Middle Center. Choose a suitable Size for the score Labels, 30 by 23 was used for the screenshot. Name the remaining five (5) score Labels appropriately.

The Grand Total Label font size in the example GUI was 25.

Compile your Form as you may have to adjust the size and position of various controls to arrive at a Form which looks reasonable. Show your Form to me for feedback its overall appearance. 7. Final Comment

Though all care has been taken in the production of this (and future) specifications and related documentation, there may be a need to notify by email any alterations/clarifications. SO CHECK YOUR QUT EMAIL DAILY.

Optional - Working in Pairs

Ensure that both people in the pair are more or less equally involved this project. A Statement of Completeness will be required with submission, to indicate the contribution made by each person in the pair.

Do not forget to register your group details via email by the 11th May. Include the full name and student number of each person in your email.


版权所有:编程辅导网 2021 All Rights Reserved 联系方式:QQ:99515681 微信:codinghelp 电子信箱:99515681@qq.com
免责声明:本站部分内容从网络整理而来,只供参考!如有版权问题可联系本站删除。 站长地图

python代写
微信客服:codinghelp