Before you start:1.
watch the video posted.
Introduction: Q-Puzzle game
•
•
•
•
•
“Q-Puzzle” game is a puzzle game consisting of several colored doors and boxes. The number of
doors and boxes may vary, however, for the same-colored boxes there must be at least one
matching colored door.
The control pad will contain four directional buttons: Up, Down, Left and Right.
The player will select a box and use the control pad to move the box. The box will continue to
move until it hits a wall or another box. If there is a door with the same color of the box in the
direction of its movement, the box will be removed.
Your objective will be to remove all the boxes through their correspondingcolored doors and the
game ends.
See https://play.google.com/store/apps/details?id=com.oxothuk.qgame&hl=en_CA& gl=US to
get a better idea.
Important notes:
•
•
•
The complete project is divided into 2 assignments (Assignments 2 and 3):
a. In Assignment 2 you will:
i. Create a game level designer, ii. Design a level using the designer, iii. Save the
level as a text file.
b. In Assignment 3 you will:
i. Load the previously saved level,
ii. Play,
iii. Details of Assignment 3 will be available in Assignment 3’s specification.
It is important to understand that you must complete Assignment 2 before starting to work on
Assignment 3.
The rest of the document will specify the requirements for Assignment 2 only.
Problem Specification (Assignment 2):
•
Create a new project in C# using “Windows Forms App (.NET Framework)” template
•
Name the project as follows:
FirstNameInitialLastNameQGame
Replace FirstNameInitial and LastName based on your name.
Example: if a student’s name is Jason Bourne, for Assignment 2, the name of the project will be
JBourneQGame. Any other names will result in “assignment standard” violation.
Please note: for Assignment 3, you will continue to work on the same project.
•
•
•
•
•
•
•
•
•
•
•
•
•
•
Create a “Control Panel” Form which will be used to either “Design” a level or “Play”. In this
assignment the Play button will not do anything.
Create a level/maze “Designer Form” which can be invoked by clicking the “Design” button of
the Control Panel.
The designer form will contain a toolbox at the left. Toolbox will hold Buttons/PictureBoxes to
represent necessary tools (e.g., wall, different types of boxes and different types of doors).
The form will also contain necessary TextBoxes to input the number of rows and the number of
columns. It will also have a “Save” menu.
The user will input number of rows and number of columns, then click the Generate button and a
grid (of PictureBoxes, or other controls) will be generated.
Initially the grid will be empty. By clicking on a tool button (wall/door/box), the user may choose
a tool and click on a cell to assign that item to the cell.
Upon completing the level design, the user will be able to save the maze to a text file.
After saving a MessageBox will be shown with a confirmation message along with the number of
doors, the number of boxes and the number of wall blocks.
For saving you must use Save DialogBox to navigate to a location and to provide/choose a file
name.
In case of invalid input(s), error message will be displayed.
In the middle of a level design process the user may choose to provide new values for row and
column and start creating a new level. In this situation a MessageBox will show up asking
whether the user wants to abandon the current level and start a new one, or not.
If the user accepts, current level/grid will be cleared (all controls placed so far will be removed)
and a new grid will be created. Note: don’t use
Application.Restart(), or similar type of built-in methods, or by closing current form and reinstantiating the form. Initialize the grid, manually.
If the user denies, it will simply close the MessageBox, and the user may continue with the
current level. Don’t forget to incorporate input validation.
You may check the video available under Assignments module of eConestoga. Note: The video
has no audio.
Hints:
Note: these are just hints, you may achieve the same outcome in various ways. Please see the attached
video carefully. Your game must fulfill all the functionalities implemented in the video.
• If you want to make your toolbox buttons with image and text, use an ImageList, add images to
the list, and assign an image to each button. See the Button objects’ ImageList and ImageIndex
properties.
• The Grid is composed of PictureBoxes which are generated dynamically. Upon clicking on a cell,
the recently selected tool’s image will show up on that PictureBox. You must load the images
through resources. Using absolute/relative paths to the images will result in deduction of marks.
Check the hands-on program in eConestoga that addresses how to load an image to a PictureBox
through resources.
• For each tool you may assign an integer, say, 1 for Wall, 2 for Red Door, 3 for Green Door etc.
Assign that value to a PictureBox cell as well as the image once clicked. You may want to make a
•
•
class inheriting from PictureBox class and add necessary fields you feel needed. Check the handson programs and PowerPoint presentations addressing “Inheritance”.
The save file format you will see in the demo considers the following pattern (Check file handling
hands on program):
a. Number of rows
b. Number of columns
c. For each cell
i. Cell’s row
ii. Cell’s column
iii. Cell’s content (1 for Wall, 2 for Red Door etc.)
There are numerous data formats you may think of while saving. The previous strategy just gives
you an example. Feel free to use your own file format while saving.
Remember to incorporate the followings for all assignments (if applicable)
•
•
•
•
Add Title/Header comment.
Add Documentation comment by using /// for all methods (Documentation comments for event
handlers are optional).
Add Implementation comment where (you think) necessary.
Other standards mentioned in the standards document available in Resources module.
o Programming Standards-PROG2370.pdf
Note: The user interface should be as close as the demo provided. All functionalities must be
implemented as well. You may use your own images for the tools, own file formats for save files.
Softcopy Submission Requirements
•
•
•
•
Design an arbitrary level. Save the level to a text file: Level1.txt.
You may use your own extension instead of .txt.
Make a zip file following the project’s naming convention mentioned above. This zip file will
contain:
o The complete Solution made in C# o Saved level
(txt file)
Log in to your eConestoga course shell and upload the zip file to the assignment dropbox.
Assignment 2 Marking Sheet
Spec
User Interface Design
Can generate the grid
Clicked cells are updated based on the selected tool
By selecting a new tool and clicking on a cell that already has an image, will
successfully overwrite.
“None” tool will empty a cell
Save dialog box used
Can save
Images are assigned through resources
MessageBox shown after saving (with the number of walls, doors, boxes)
Validate inputs and show MessageBox for any type of errors
Clicking the “Generate” in the middle of a level design, will show a
MessageBox asking the user if they want to cancel current level and start a
new one. If the user agrees, remove the grid and recreate a new one based on
the row and column values. Grid must be cleared manually.
Deduction:
Runtime errors
Assignment Standard (proper project name, etc., see the
standard documents for detail)
Programming Standard
Late Submission (Soft copy)
No Manual initialization
Bugs (including any missing features mentioned in the
assignment description but not mentioned in this marking
sheet)
Absolute/Relative paths used instead of loading from
resources.
Total Deduction