Question: The Assesment is due today, it requires code for a pac man game in which 'clara' is used as pacman, mushrooms are used as pwer
The Assesment is due today, it requires code for a pac man game in which 'clara' is used as pacman, mushrooms are used as pwer ups, leaves are used as pellets and ghosts are still the same. i recquaire the code for the entire assignment, all details for the assignment are located below in the screenshots. IF you download the screenshots and zoom in on them, they will be clear to read. the question is very simple. Please provide me with the code for this assesment
\fImportant note 2 Do not let the following list of commands scare you, as they are further explained in the assignment brief and your tutors will help you to select those commands that you need for each task. Important note 3 For this assignment you should no longer have a main loop (for or while) inside act(). Instead you should rely on the act{) method being executed repetitively (similar to how you did in Practical 2). The stop(}; command MUST NOT be used in this assignment. \f\fPart 12 - Making and Adding Levels It's time to understand how Clara's world is designed in this game, and how to design and add your own levels. When you first opened up \"MyClara', ou may have noticed the first level at the top of the code. This is the format you will need to use in order to create your own levels. See the image below for what you should roughly see when first opening up \"MyClara' wycon Pee ota Eastoeresie rn sect oe nin You will need to rename the level from \"LEVEL_1\" to"LEVEL_2" You'll notice that a level is simply an array of characters that visually represent the level that they make. The characters used are as follows: * '# represents a tree, which is an obstacle to both Clara and the Ghosts. ' 'represents a leaf, which Clara needs to eat in order to progress to the next level. * 'represents nothing, which is essentially an empty tile. ' '%' represents a Ghost. At least one must be present in every level you make. * '? represents a Ghost Healer, which the Ghosts return to when eaten in order to come back to life. At least one must be present in every level you make. represents a Ghost Wall, which is an obstacle that only Ghosts may pass through, and not Clara. It is connected to the group of trees that make up the initial room that the Ghosts start in. At least one must be present in every level you make, * 'S' represents a mushroom, which can be eaten by Clarain order to make the Ghosts scared and capable of being killed by Clara. * '@ represents Clara, it is where she will start at the beginning of the level. Only one must be present in every level you make. 'The characters that make up the array of a level in Clara's world are each surrounded by single quotes (") and the characters in a single row are separated by commas (). Asingle row ina level is surrounded by curly braces({}), and the end of a row of a level, that is not the end of the whole level, is indicated by a comma after the closing curly brace (},)- Now you should have rough understanding of how Clara's world is constructed, In order to build your own level, all you have to dois delete all of the streets of the level and write your own level in there, following the above rules in order to present it and write it properly. 'Then write your own level, in between the curly braces that are left after you delete what was highlighted. After you're done, you'll need to go to where you call the \"advanceToLevel(char{])\" method and figure out a way of sending \"LEVEL_2 when the player has finished \"LEVEL_1\" Now add a new level, and test it 'To add another level, simply copy and paste \"LEVEL_2" inside MyClara and changeit to\"LEVEL_3", and modify it just like you did for level 2. Add as many levels as you want, although technically you are only required to add one more level. \f\fGhost's vocabulary For this assignment, you will also be required to code new characters - Ghosts. The Ghosts pose a threat to Clara as she tries to eat all of her leaves and try to prevent her from accomplishing her mission. 'The behaviour of each Ghostis controlled by the act() method inside Ghost java. Each of the Ghosts in the game is essentially an instance of the Ghost class (we will learn about classes soon enough in the lectures). In order to assist you in programming Ghosts, just like for Clara, there are Ghost commands already made for you. Some of these commands are exactly the same as Clara's, some are slightly different, and some completely unique to the Ghosts. Be sure to read the following list of commands carefully: Name treeFront() treeAbove() treeBelow) treeToLeft) treeToRight() getDirection)) setDirection(string) isScared() animate) Description 'Checks if there is a tree in front of the Ghost. . Checks if there isa tree above the Ghost. '+ Note that this methods relative to the screen, not the Ghost. That is, regardless of the direction of the Ghost, tree that is above it, will always be above it. . 'Checks if there is a tree below the Ghost. . Checks if there is tree to the left of the Ghost. . Checks if there isa tree to the right of the Ghost. Gets which direction the Ghost is facing. Makes the Ghost face a specific direction, 'Moves the Ghost at the specified speed. The ghost will move in the direction itis currently facing until it hits an obstacle or until the direction is changed 'The Ghost checks whether it should be scared of Clara. . 'The Ghost continues its animation by one frame. The Ghosts continues its death animation by one frame. Input Nothing. Nothing. Nothing. Nothing. Nothing. Nothing. string, which specifies which direction you want the Ghost to face. 'An integer, which specifies how fast you want the Ghost to move. Nothing. Nothing. Nothing. Output true if there is tree infront of the Ghost. false f there is not a tree infront of the Ghost. true if thereis a tree above the Ghost. false if there isnot a tree above the Ghost. true if theres a tree below the Ghost. here isa tree to the left of the Ghost. trueif theres tree to the right of the Ghost. string which represents the direction the Ghost is facing. Nothing. Nothing. true if the Ghosts should still be afraid of Clara, Nothing. Nothing. animateScared() getClara() getGhostHealer() isAboveMe(Actor) isBelowMe(Actor) isToMyLeft(Actor) isToMyRight(Actor) intersects (Actor) makeClaraDead{) playGhostEatenSound() isPacmanIntroStillPlaying() wrapAroundWorld() The Ghosts continues its scared animation by one frame. Gets Clara, Gets the Ghost Healer. Checks whether the specified Actor is above the Ghost. Checks whether the specified Actor is below the Ghost. Checks whether the specified Actor is to the left of the Ghost. Checks whether the specified Actor is to the right of the Ghost. Checks whether the specified Actor is currently intersecting the Ghost. Makes Clara's \"isClaraDead()" method return true, Plays the sound of a Ghost being eaten. Checks if the pacman intro sound is still playing. Enables the Ghost to automatically move off one side of the game, and end upon the other side. Nothing. Nothing. Nothing. Clara or Ghost Healer. Clara or Ghost Healer. Clara or Ghost Healer. Clara or Ghost Healer. Clara or Ghost Healer. Nothing. Nothing. Nothing. Nothing. Nothing. Clara. Ghost Healer. true if specified Actor is above the Ghost. true if specified Actor is below the Ghost. true if specified Actor is to the left of the Ghost. true if specified Actor is to the right of the Ghost. true if the specified Actor is currently intersecting the Ghost. Nothing. Nothing. Nothing. Nothing
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
Students Have Also Explored These Related Accounting Questions!