Page 1 of 1

In this project, you will implement a simple game where you will collect the collectibles on the screen. Please see the

Posted: Wed Apr 27, 2022 3:33 pm
by answerhappygod
In This Project You Will Implement A Simple Game Where You Will Collect The Collectibles On The Screen Please See The 1
In This Project You Will Implement A Simple Game Where You Will Collect The Collectibles On The Screen Please See The 1 (88.32 KiB) Viewed 39 times
IN PROCESSING
In this project, you will implement a simple game where you will collect the collectibles on the screen. Please see the sample output below. Attached, you can also find the video file. You are asked to use Inheritance principles in this game and implement the GUI by using Processing library. Steps for Part A: 1. Check the given UML diagram below and implement the given classes. Point + posx: int + posy:int +r: int +g: int +b: int +set(posx: int, posy: int,r:int, g: int, b: int) Player Point -finished:boolean CollectiblePoint -isVisible:boolean +set(posx: int, posy: int, r: int, g: int, b: int, finished:boolean) +getisFinished(): Boolean +setlsFinished(fin:Boolean):void +set(posx: int, posy: int, r: int, gint, b: int, isVisible:boolean) +getisVisible(): Boolean +setisVisible (vis:Boolean):void 2. set method of the Point class sets the instance variables. 3. set method of the Player Point and CollectiblePoint classes call the super class set method with relevant variable values and setup their corresponding instance variable. 4. setters and getters are obvious.
Steps for Part B: 1. Create a new file now for implementing your game. 2. In this file, create horizontal and vertical walls as obstacles for your player. 3. Later, create your collectibles array by using CollectiblePoint class. You may create as many collectibles as you wish however keeping this number in between 5 to 30 will make your game easier to play, follow and debug. 4. In order to print the number of collectibles you collected, keep a variable. 5. Create your player object of PlayerPoint type. 6. In the setup method: a. initialize your player position (in my case, I give the half of width and height for initialization) and initialize the isFinished to false. Give a proper color. b. Randomize the collectibles' x and y positions and initially, make them all visible. Give a proper color to each or use the same color for all. 7. In the draw method: a. colorize the background canvas. b. Print the name of your game as a text message on the top-corner. C. draw the obstacle walls. d. use point method to draw the collectibles if they are visible (use a meaningful stroke and strokeWeight). e. if the distance of our player to any collectible is smaller than our threshold value (4 in my case), increment the number of collected collectibles and make the visibility of that collectible false so that they do not appear on the screen any more. If the number of collected collectibles reaches your max collectible number, change the isFinished variable to true. f. If any created collectible is beyond the [0,width] and [0, height] window borders, clamp their values and place them in our window. g. draw our player by using the point method (use a meaningful stroke and stroke Weight) h. now check the pressed keys for left, right, up and down arrows. As you press, your walls should continue to be drawn like going through infinity. i. draw your inventory on the top right area of your game which means you need to show the number of collected collectibles. If the player's isFinished becomes true, print it as an end message.