首页 > > 详细

代做ISCG6421 – GUI Programming

ISCG6421 – GUI Programming
Page 1 of 13
ISCG6421 - GUI Programming
Semester 1, 2023
Assignment 2: Breakout
Deadline Time: 12:30pm
Checkpoint 1: Thursday 04th May 2023
Checkpoint 2: Thursday 18th May 2023
Deadline Date: Thursday 1
st June 2023
Course Weighting: 20%
Marks: 100
School of Computing Electrical
and Applied Technology
ASSIGNMENT AIMS
The assignment is intended to help you gain experience with designing and building C# Windows
applications and testing them with requirements-based testing.
Problem statement
Breakout is and arcade game developed in 1970. In Breakout a layer of bricks lines are at the top of
the form and the goal is to destroy them by bouncing ball off a paddle into the bricks. The user can
move the paddle back and forth at the bottom of the screen with arrow keys or mouse. The ball
bounce off the paddle and off the sides of the form. if the ball miss the paddle at the bottom the
game ends.
Your Task is to create Breakout game using C# and .NET Framework Windows Forms.
The screenshot show in example of Breakout game.
https://en.wikipedia.org/wiki/Breakout_(video_game)
ISCG6421 – GUI Programming
Page 2 of 13
Requirements

You are provided with a C# starter project that you must use for this assignment. The starter project
contains all necessary classes and file for you to complete the assignment. However, you can add
more Forms or classes.


• Your solution must be Object oriented.
• There must be a Welcome window or splash screen which will allow user to play the game.
• The game Form must provide a ball, paddle, and a layer of bricks at the top of the screen.
• Each brick must have a firmness 1 to 4.
o Randomly assign the firmness to each brick,1 is weaker and 4 is firm.
o You can colour code the firmness on each brick or display number to represent the
firmness.
• The ball must also bounce off the bricks at the top of the screen and causing the brick weaker
(reduce the firmness) or explode/disappear (the firmness is zero).
• Add two random bomb bricks (with special colour or animation) if user hit it directly should destroy
all the bricks.
• The ball must bounce from the edges of the Form.
• The ball must also bounce off the paddle at the bottom of the Form and if the ball misses the
paddle the game ends.
• The user must be able to control the paddle using mouse or the arrows keys.
• The game must use single Timer to control animation.
• You can give user an option to pause the game.
• To enhance the user experience, it is essential to display the user's score. Every time a brick is hit,
the user should be awarded 10 points. In addition, if the brick disappears, the user will receive an
additional 5 points. For instance, if the brick has a firmness level of 1 and the ball hits it, the user
will earn a total of 15 points.
• Suggest an appropriate scoring system for when the user hits bomb bricks.
• When the game is lost the user should get an appropriate feedback and option to replay the game.
• When all the bricks destroyed then the game is won, and you need to give appropriate feedback to
user and option to replay the game.
• You must add at least two extra features of your choice.
• The game needs to be aesthetically pleasing.
Classes

Your project must be object oriented. You should add following classes:
• Ball
• Brick
• Paddle
• Manager
Your class will need fields and methods. For example for the ball, brick and Paddle objects needs to
know where it is on the screen, its size and colour. The ball and paddle also need to know how to
ISCG6421 – GUI Programming
Page 3 of 13
move. The ball should also know if it is collided with bricks or paddle. The Manger will manage all the
objects, manage animation and calculate game.



Extra Features Examples

• Add different levels to game
• Add appropriate sounds to game
• Keep track of user score especially record the highest score or top three scores
• Allows the players to start, pause, resume, and restart games.
• Provides a way to Save the current game to a file.
• Provides a way to Load a saved game from a file and continue playing the loaded game.
Getting input from the Keyboard

When a user presses a key on the keyboard, a KeyDown event is generated. For the Form’s
KeyDown event, the event method signature is:
private void Game_KeyDown(object sender, KeyEventArgs e)

Game is the name of the form. Following is the sample code
private void Game_KeyDown(object sender, KeyEventArgs e)
{
switch (e.KeyCode)
{
case Keys.Left:
//write code in response to the left arrow key
break;
case Keys.Right:
//write code in response to the right arrow key
break;
}
}
The Form’s KeyPreview property must be set to True. Otherwise, it won’t be able to respond to the
KeyDown event
ISCG6421 – GUI Programming
Page 4 of 13
ISCG6421 – GUI Programming
Page 5 of 13
Required Tests
This is the minimum number of tests you need in your testing documentation:
1. Interface is displayed correctly when the program runs
2. Bricks are displayed correctly
3. Paddle is move with key Press or mouse move
4. The ball is moving
5. The ball is bouncing off the paddle
6. The ball is making the bricks disappear when hit by the ball.
7. Score is calculated correctly
8. The won message displayed when the user won
9. The lost message displayed when the user lost
10. User is getting an option to replay the game when the game is won or lost
Please note that your tests can involve more than one step and must be reproducible (i.e. explicit test
data and user actions) and independent of each other (i.e. please do not use the output of one test as
the input to another test.)

Test Cases
Please using the following format for your test cases
Requirement to test Test Data Input Expected Outcomes Actual Outcomes

Required Unit Tests
You must write at least 7 Unit tests to test methods for your choice. You can select methods from any
class, consider following classes.
• Ball
• Paddle
• Brick
Delivery
A soft copy must be uploaded onto Moodle as a single .zip file prior to the deadline and it must
comprise:
• The testing documentation.
• ALL files needed to compile and run your application from the Visual Studio Community
2022 or 2019. 20-30 marks will be deducted if this is not done.
ISCG6421 – GUI Programming
Page 6 of 13
Please note that it is important to upload the correct version of your assignment onto Moodle. If you
submit the wrong version onto Moodle, please notify me by email before the deadline date or late
penalties may be incurred.



Checkpoints
There is an expectation that you will have completed certain aspects of your assignment at each
checkpoint submission. If your submission does not meet the expectations of the checkpoint, your
overall mark for the final submission may be penalised.
Expectations
Checkpoint 1:
• User interfaces are designed, and the ball is coded for the game
Checkpoint 2:
• Classes are added for Ball, Paddle, Bricks and Manager class is managing the game.

Demo

You must give demo of your assignment and answer all questions about your code. 50 marks will be
deducted if this is not done. Without demo and Q&A your assignment will not be marked.

ISCG6421 – GUI Programming
Page 7 of 13
Marking
Criteria Marks Actual
• Game Interface set up correctly (similarly to the one shown on page
11).
8
• Main functionalities are added to the game form.
1. The ball must bounce from the edges of the Form.
2. Firmness is added to bricks (1 to 4)
3. Ball hit is reducing the firmness .
4. Bomb bricks are added.
5. The ball must also bounce off the bricks at the top of the screen
and causing the brick to explode (disappear) if the firmness is 1.
6. The ball must also bounce off the paddle at the bottom of the
Form and if the ball misses the paddle the game ends.
7. The user must be able to control the paddle using mouse or the
arrows keys.
8. The game must use single Timer to control animation.
(3 Marks for each)
24
• Score is calculated correctly 5
• Appropriate scoring calculated when user hit bomb bricks 4
• Appropriate messages displayed when the game is lost or won 5
• An option is added to replay the game 3
• Appropriate two extra features are added. 6
• Main or welcome form is added which allows the user to begin a
game.
5
• Application is object oriented (6 marks),
Modular (4 marks) and
Algorithmic elegance (4 Marks)
14
• Game is aesthetically pleasing 5
Testing documentation with appropriate tests 8
7 Unit tests for appropriate methods 7
Naming conventions and correct internal documentation 6
You must give demo of your assignment and answer all questions
about your code. 50 marks will be deducted if this is not done.
Total: 100
• Marks will be deducted for any requirement (or for multi-part requirements, or each part of a
requirement) that is not fully implemented or has no or insufficient testing.
• In the interface behaviour and data processing section, marks will be deducted for any
requirement (or for multi-part requirements, or each part of a requirement) that is not well
covered in the test plan or is reported as working in the test plan but does not work when the
ISCG6421 – GUI Programming
Page 8 of 13
assignment is marked. You are also expected to handle exceptions, using message boxes and
“try and catch” blocks.
• Check “Programming Standards for C Sharp Courses” You can also find some at the end of
this document. The standards for C# programming in this document MUST be followed. In
particular, this includes putting meaningful comments at the beginning of each and every
method in the standard format as given in the document.
Do you want to do the best that you can do in this assignment and improve your grades?
You could:
❖ Talk it over with your lecturer
❖ Visit Te Pune Ako or Maia for learning advice and support
❖ Visit the Centre for Pacific Development and Support
❖ Contact the USU Advocate for independent advice
❖ For contact details and more information, go to www.usu.co.nz
ISCG6421 – GUI Programming
Page 9 of 13
Assignment Delivery
Electronic submission of all necessary files is required for ALL assignments and must be submitted
prior to the due date and time. Assignments submitted after the due date and time without having
received an extension through Affected Performance Consideration (APC) will be penalised according
to the following:
• 10% of marks deducted if submitted within 24hrs of the deadline
• 20% of marks deducted if submitted after 24hrs and up to 48hrs of the deadline
• 30% of marks deducted if submitted after 48hrs and up to 72hrs of the deadline
• No marks will be awarded for an assignment that is submitted later than 72hrs after
the deadline.
For the purposes of academic integrity, students who haven’t demonstrated progress work in the class
time can be asked to demo/test their working code and explain logic to the lecturer individually after
assignment submission.
Affected Performance Consideration
A student, who due to circumstances beyond his or her control, misses a test, final exam or an
assignment deadline or considers his or her performance in a test, final exam or an assignment to
have been adversely affected, should complete the Affected Performance Consideration (APC) form
available from Student Central.
When requesting an APC for an assignment, the APC application form must be submitted (along with
work completed to-date) within the time frame of the extension requested; i.e. if the Doctor’s certificate
is for one (1) day, then the APC application form and work completed must be submitted within one (1)
day.
ISCG6421 – GUI Programming
Page 10 of 13
Assistance to other Students
Students themselves can be an excellent resource to assist the learning of fellow students, but there
are issues that arise in assessments that relate to the type and amount of assistance given by
students to other students. It is important to recognise what types of assistance are beneficial to
another’s learning and also what types of assistance are unacceptable in an assessment.
Beneficial Assistance
• Study Groups.
• Discussion.
• Sharing reading material.
• Testing another student’s programming work using the executable code and giving them the
results of that testing.
Unacceptable Assistance
• Working together on one copy of the assessment and submitting it as own work.
• Giving another student your work.
• Copying someone else’s work. This includes work done by someone not on the course.
• Changing or correcting another student’s work.
• Copying from books, Internet etc. and submitting it as own work. Anything taken directly from
another source must be acknowledged correctly: show the source alongside the quotation.
For the purposes of academic integrity, students who haven’t demonstrated progress work in
the class time (and/or no check point submission) can be asked to demo/test their working
code and explain logic to the lecturer individually after assignment submission.
ISCG6421 – GUI Programming
Page 11 of 13
Programming Standards for C Sharp Courses
Internal Documentation
• Your code is such that other programmers can read it without struggling and your users are not
left guessing as to what to do.
• Each class file (including form classes) will begin with comments explaining the purpose of the
class, the author and the date written.
• Each method will start with comments that explain what the method does.
• Any code which does not have an obvious meaning or which uses a specialized technique is to
be commented. Use blank lines and further comments to identify where parts of a task begin
within a method.
• Code will use meaningful variable, class and method names. Components which have event
handler code for any of their events must have meaningful names, Components which have
properties assigned to in code must also have meaningful names. A naming convention that
identifies the type of component involved is recommended. E.g. btnExit, txtStartDate, lblTotal
Layout
• Code will be laid out in the style of the example below, using indentation steps of 4 spaces.
Blocks using { and } will use the layout shown here:
///

method : btnLeapYear_Click
///Check if a date falls in a leap year
///

private void btnLeapYear_Click(object sender, System.EventArgs e)
{
DateTime aDate = getDate();
if ( DateTime.IsLeapYear(aDate.Year) )
{
label6.Text = aDate.Year.ToString() + " IS a leap year";
}
else
{
label6.Text = aDate.Year.ToString()
+ " is NOT a leap year";
}
}
• Parentheses and spaces will be used to make the meaning clear in arithmetic expressions and
conditions.
sum = (n1 / n2) + n3;
not
sum = n1 / n2 + n3;
nor
sum=n1/n2+n3;
• In general, each method will perform a single simple task.
• In the final version of your project please delete all sections of code that has been ‘commented
out’
ISCG6421 – GUI Programming
Page 12 of 13
User Interface
• Always provide the user with clear instructions explaining what they should do. Areas used for
input must be labelled to explain what input is required. Use hints or tool tips to explain
interface features.
• The user must be prevented from entering values or taking actions that the program is unable to
deal with. All input should be validated; any errors found should be reported back to the user with
an error message which clearly and politely explains how to correct the error. The user should be
unable to proceed without correcting invalid input.
ISCG6421 – GUI Programming
Page 13 of 13
Interface Design Basic Mock-up: Screenshot
NOTE: This mock-up does not include all GUI elements necessary to complete the assignment. It
represents a high-level suggestion of layout for the GUI, and not an exact requirement for your
submission.

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!