Reference no: EM132560824
Introduction
This document describes the detailed requirements for the second semester module project. The assignment consists of a series of tasks of varying complexity. All the tasks available can contribute to the development of an upgrade to the PetAFish simulation:
Assessment Structure
Assignment 3 is worth 50% of the module grade and is structured with a range of increasingly challenging tasks. You are required to work individually and complete as many of the task elements as possible.
10% of this assignment is for the Learning Journal to be completed in addition to the submitted project - see details below.
How to pass this Assessment:
• Come to class, get logical support from your tutors, we can't give you answers but we can push you in the right direction.
• Google it! You won't find the answers to everything, but small syntax issues or snippets of code that might make life easier will be out there waiting for you! Being able to google your way past a problem is a key skill!
• Keep trying, even if it doesn't work right away and gets very frustrating, this is how it feels to learn how to program, just keep trying!
• Read all instructions. There are a lot of hints and tips in all the text presented here.
Good code practices will be graded, these include:
• Good commenting and indentation
• Appropriate Naming Conventions
• Working code based on suggested approaches
• Using appropriate methods, parameters, conditional statements and iterations
As a general rule, you will not earn any credits for a given task if the code that you produce cannot be run and tested, producing visible results coherent with the requirements. Hence, code that can be run and tested can earn you credits even if it has bugs or is incomplete, but writing new code that does not work at all will not be as helpful!
For each task you will actually earn points depending on: i) how you fulfil the specific task requirements; ii) the quality of your solution, in relation to the assessment criteria for the task.
The Task
You are tasked with creating a Piranha Battle simulation as an upgrade for the FishORama work you have been involved in. A sample video (of the final Challenge solution) is available on Blackboard as a guide - your solution does not need to be identical, as long as it meets the brief below.
CORE level (40% of assignment)
Set up the battle simulation:
1. Create a Piranha class based on the example OrangeFish class in the FishORama project.
2. Create 6 piranha fish, store them in an Array or a list as you created them, if this is a challenge, you can create a variable for each Piranha, but won't receive full marks for this step. When creating the piranha, consider the following:
a. Continue to pass the string and tokenManager object as parameters to the Piranha Constructor
b. Also pass two additional numbers, the first representing the fish number (from 1-3, outlined in step 6 below) and the second representing a team number (either team 1, or team 2 with 3 fish being on each team).
c. These numbers (from part b) should be stored in relevant variables in the Piranha class
3. Place 3 piranhas on the left side of the screen and 3 piranhas on the right side of the screen. To do this, it is expected that the 3 piranhas on the left are placed one under the other on the same X coordinate with a uniform distance between them on Y.
a. The first piranha on the left should be placed -300 on X and +150 on Y
b. Two subsequent piranhas should be placed 150 pixels below the previous fish on the Y axis
c. The first piranha on the right should be placed +300 on X and +150 on Y
d. Two subsequent piranhas should be placed 150 pixels below the previous fish on the Y axis
4. For full marks, to place the fish as mentioned in step 2, you can use either two separate for loops (one starting at 0 and the other at 3) or two nested for loops both starting at 0 and running 3 times each.
5. Make all the Piranhas face inwards to face the other team ready for battle!
6. Have each piranha store a number from 1-3 so the piranha on the left should be numbered 1, 2 and 3 respectively from top to bottom, and the piranha on the right should be numbered 1, 2 and 3 as well. These numbers will be passed to the Piranha constructor from Simulation as mentioned in step 2.
7. Make the Piranha swim up and down 50 pixels above and below starting position (100 pixels in total). Note, a later task is to make the Piranha swim in circles, which replaces this up and down movement (and gains the credit for this task)
8. Have the chicken leg be placed at random times in the centre of the screen, but only when it hasn't already been placed (so the program will not try to place the chicken leg if it is already there).
Code for placement of the leg already exists, so it should simply be a case of repurposing this code. Read all the hints below to get this done!
a. The Kernel in the FishORamaEngineLibrary already has functionality to place the leg
b. We can repurpose this for our needs, copy the code from the Kernel's Update method (// Place a new chicken leg at the position of the mouse) and put it in a new method called PlaceLeg() which can be placed in the Simulation.
c. Remove all the code related to mouse clicks but keep/add the code that checks if the tokenManager.ChickenLeg variable is null
d. Have the leg position itself at the centre of the screen instead of based on the mouse position
e. Instead of using a mouse click to add the ChickenLeg (as happens in Kernel), you can do random number generation in Simulation to randomly call the PlaceLeg method you just created if a certain number gets generated. Obviously, this must be in the update so it continues to place the ChickenLeg whilst the simulation is running.
Attachment:- Introduction to OO Programming.rar