I'm totally lost here on what to do...If anyone has done this before please guide me


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | /** * MyClara * * Available functions (see Assignment document for explanations on what each function does): * treeFront, ghostWallFront, * getDirection, setDirection, * move, * makeScared, isScared, * animate, animateDead, * onLeaf, removeLeaf, * onMushroom, removeMushroom, * allLeavesEaten, * isClaraDead, * playClaraDieSound, isClaraDieSoundStillPlaying, * playLeafEatenSound, * playPacmanIntro, isPacmanIntroStillPlaying, * wrapAroundWorld, * getCurrentLevelNumber, advanceToLevel */ class MyClara extends Clara { // Please leave this first level here, // until after you've completed \"Part 12 - // Making and Adding Levels\" public final char [][] LEVEL_1 = { { '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' }, { '#' , '$' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '$' , '#' }, { '#' , '.' , '#' , '#' , '.' , '#' , '.' , '#' , '#' , '#' , '#' , '#' , '.' , '#' , '.' , '#' , '#' , '.' , '#' }, { '#' , '.' , '.' , '.' , '.' , '#' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '#' , '.' , '.' , '.' , '.' , '#' }, { '#' , '#' , '#' , '#' , '.' , '#' , ' ' , '#' , '#' , '|' , '#' , '#' , ' ' , '#' , '.' , '#' , '#' , '#' , '#' }, { ' ' , ' ' , ' ' , ' ' , '.' , ' ' , ' ' , '#' , '%' , '?' , '%' , '#' , ' ' , ' ' , '.' , ' ' , ' ' , ' ' , ' ' }, { '#' , '#' , '#' , '#' , '.' , '#' , ' ' , '#' , '#' , '#' , '#' , '#' , ' ' , '#' , '.' , '#' , '#' , '#' , '#' }, { '#' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '#' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '#' }, { '#' , '.' , '#' , '#' , '.' , '#' , '#' , '#' , '.' , '#' , '.' , '#' , '#' , '#' , '.' , '#' , '#' , '.' , '#' }, { '#' , '$' , '.' , '#' , '.' , '.' , '.' , '.' , '.' , '@' , '.' , '.' , '.' , '.' , '.' , '.' , '.' , '$' , '#' }, { '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' , '#' } }; // Movement constants public final String UP = "up" ; public final String DOWN = "down" ; public final String LEFT = "left" ; public final String RIGHT = "right" ; // Add and initialise Clara's variables here /** * Act method * * Runs of every frame */ public void act() { //Make Clara do things here if (Keyboard.isKeyDown(LEFT)){ setDirection(LEFT); } if (Keyboard.isKeyDown(RIGHT)){ setDirection(RIGHT); } if (Keyboard.isKeyDown(UP)){ setDirection(UP); } if (Keyboard.isKeyDown(DOWN)){ setDirection(DOWN); } move( 3 ); if (onLeaf()){ removeLeaf(); playLeafEatenSound(); } wrapAroundWorld(); } //Give Clara functions here } |