墨爾本大學(xué) SWEN20003 Project2 課業(yè)解析

墨爾本大學(xué) SWEN20003 Project2 課業(yè)解析

題意:

用Java設(shè)計(jì)與實(shí)現(xiàn)一款結(jié)合消除谜喊、彈珠等元素的Shadow Bounce游戲,包括繪制UML圖及代碼實(shí)現(xiàn)

解析:

在一張2D棋盤上有一些不同類別的釘子倦始,玩家通過投擲球消除所有的紅色釘子進(jìn)入下一關(guān)斗遏,每一關(guān)玩家有20次機(jī)會(huì),通過所有關(guān)卡贏得游戲鞋邑,若機(jī)會(huì)用盡游戲失敗诵次。

釘子有四種顏色:藍(lán)色釘子最普通;灰色釘子不能被消除炫狱;紅色釘子在初始化關(guān)卡時(shí)藻懒,由隨機(jī)從藍(lán)色釘子取出的5分之1轉(zhuǎn)換而來;綠色釘子在每關(guān)初始化時(shí)隨機(jī)生成1枚视译,和其它釘子不同的是嬉荆,普通球碰到其他釘子將反彈,碰到綠色釘子將分裂產(chǎn)生兩個(gè)新的球酷含,分別以10像素每秒的速度分別以斜向右上和斜向左下方向移動(dòng)鄙早;

球有兩種類型:普通球和爆炸球,普通球碰到普通釘子反彈椅亚,爆炸球碰到第一個(gè)釘子將自爆限番,傷害以釘子位置為中心周圍70個(gè)像素范圍并消除包含的所有釘子。每關(guān)開始時(shí)有0.1的機(jī)會(huì)隨機(jī)生成一個(gè)不斷移動(dòng)的爆炸源呀舔,當(dāng)普通球撞上爆炸源powerup后弥虐,將升級(jí)為爆炸球扩灯,同時(shí)爆炸源消失;

幸運(yùn)桶:bucket是一個(gè)運(yùn)動(dòng)在地圖底部的幸運(yùn)回收桶霜瘪,初始位置是(512珠插,744),以每幀4像素的速度向地圖左側(cè)移動(dòng)颖对,當(dāng)球撞進(jìn)桶內(nèi)捻撑,本次投擲不計(jì)數(shù);若桶超出地圖缤底,重置為初始位置顾患,而球超出屏幕則玩家次數(shù)減1;

游戲一共有5關(guān)个唧,地圖信息存儲(chǔ)在對(duì)應(yīng)的csv文件中江解,每行信息代表了釘子在地圖的位置

涉及知識(shí)點(diǎn):

UML、面向?qū)ο罂佑恪agel庫

更多可加

薇?號(hào):qing1119X

pdf

SWEN20003 Object Oriented Software Development Project 2, Semester 2, 2019The University of MelbourneDepartment of Computer Science and Software EngineeringSWEN20003 Object Oriented Software DevelopmentProject 2, Semester 2, 2019Released: Friday 13th SeptemberProject 2A due: Friday 27th of September, 11:59pmProject 2B due: Friday 18th of October, 11:59pmUpdated Thursday 19th of SeptemberOverviewIn this project, you will create a graphical arcade game in the Java programming language, continuing from your work in Project 1. We will provide a full working solution for Project 1; you arewelcome to use all or part of it, provided you add a comment explaining where you found the codeat the top of each file that uses the sample code.This is an individual project. You can discuss it with other students, but all submitted code mustbe your own work.There are two parts to this project, with different submission dates.The first task, Project 2A, requires that you produce a class design demonstrating how you planto implement the game. This should be submitted in the form of a UML diagram showing all theclasses you plan to implement, the relationships (e.g. inheritance and associations) between them,and their attributes, as well as their primary public methods. (Methods such as getters and settersneed not be explicitly included.) If you so choose, you may show the relationships separately tothe class members in the interests of neatness, but you must use correct UML notation. Pleasesubmit as PDF only.The second task, Project 2B, is to complete the implementation of the game as described in therest of this specification. You do not have to follow your class design; it is there to encourage youto think about object-oriented principles before you start programming. Indeed, it is expected thatsome aspects of your design will need to change when you start programming.1SWEN20003 Object Oriented Software Development Project 2, Semester 2, 2019Shadow BounceGame overviewShadow Bounce is an arcade game where the player must attempt to clear the game board of redpegs with a limited number of shots. Once the board is cleared, the player can progress to the nextboard, and so on until all boards are cleared or the player runs out of shots, whereupon the gameshould end. A turn begins when the board is first loaded, and ends when all balls from the turnhave fallen off the bottom of the screen. When the turn ends, a new one begins.The player begins with 20 shots. Each turn after the first, the number of shots should decrease by1. When there are no more shots left, the game should end.The game can be divided into three main types of objects: pegs, which can be destroyed to advanceto the next level; balls, which are used to destroy pegs; and a powerup, which can be activated bystriking it with the ball to get a bonus.Boards are loaded from comma-separated value (.csv) files, numbered 0.csv (the first board) to4.csv (the final board). You will not be tested on any other boards. Boards 1 through4 will be released at a later date. Each line of these files is in the following format:type,x,ywhere type is the type of peg to be created, x is an integer representing the x-coordinate to createthe peg at, and y is an integer representing the y-coordinate to create the peg at. The pegs shouldbe created with their centre at these coordinates.The pegsPegs come in three shapes. The shape will be specified along with the type; e.g. blue horizontal peg,grey vertical peg. If it is not specified, the shape should be normal.? Normal pegs:These are the usual circular pegs from Project 1.? Horizontal pegs:these pegs are a horizontal rectangle shape.? Vertical pegs:these pegs are a vertical rectangle shape.They come in four types. Blue and grey pegs are specified in the board files; the others are createdafter the board is loaded.? Blue pegs: these pegs have no special behaviour.2SWEN20003 Object Oriented Software Development Project 2, Semester 2, 2019? Grey pegs:these pegs behave as the blue pegs, but cannot be destroyed.? Red pegs:at the start of each board, one fifth (rounded down) of the blue pegs should become redinstead. When all red pegs are destroyed, the game should advance to the next board.? Green pegs:at the beginning of each turn, a random blue peg should become green. If the green peg isdestroyed, two balls of the striking ball’s type should be created at the green peg’s position,with an initial velocity of 10 pixels per second diagonally upwards and to the left and rightrespectively. At the end of each turn, if the green peg was not destroyed, it should becomeblue again.The ballsThere are two types of ball the player has access to. In Project 2, balls should bounce off pegs theystrike. If the ball strikes the peg from the top or bottom, it should reverse its vertical direction.Similarly, if the ball strikes the peg from the left or right, it should reverse its horizontal direction.The Rectangle class in Bagel contains a method to help you with this. As in Project 1, the circularpegs may be treated as though they were square.? The normal ball:this ball has no special behaviour. It is created in the same way as Project 1, and moveswith the same gravity. Note: If your screen is too small to display the window fully, youmay reduce the size of the window (by calling AbstractGame’s constructor). The ball shouldthen be created with an x value of half the window width, and a y value of 32. All pegs mustremain visible.? The fire ball:the fire ball behaves as the normal ball, except when it strikes a peg, all pegs within 70 pixelsof the struck peg’s centre are destroyed. When the turn finishes, the ball returns to normal.The powerupAt the start of each turn, with a 1/10 chance a powerup should be created at a random position onthe screen. The other 9/10 of the time, no powerup should be created. The powerup should choosea random position on the screen and move towards it at a speed of 3 pixels per frame. When the3SWEN20003 Object Oriented Software Development Project 2, Semester 2, 2019powerup is within 5 pixels of its destination, it should choose another random position. If the ballstrikes the powerup, the powerup is activated and destroyed.? Fire Ball: when this powerup is activated, the player’s ball should be replaced with the fireball.The bucketThe bucket begins at the coordinate (512, 744). Note: As with the ball, if you need to reduce thewindow size, you can; the bucket should begin with an x value of half the window’s width, and ay value equal to the window’s height minus 24.The bucket moves left at a rate of 4 pixels per frame. When any part of the bucket reaches the leftor right sides of the screen, it should reverse direction.If a ball leaves the bottom of the screen while making contact with the bucket, the player shouldget an additional shot.Implementation checklistThis project may seem daunting. As there are a lot of things you need to implement, we haveprovided a feature checklist, ordered roughly in the order we think you should implement them in,together with the marks each feature is worth:1. The board is loaded and visible on screen (1 mark)2. Grey pegs cannot be destroyed (0.5 marks)3. Pegs are randomly chosen to be red when the board is loaded (0.5 marks)4. The game advances to the next board when all red pegs are cleared (1 mark)5. The game ends when all boards are cleared or the player runs out of shots (0.5 marks)6. A peg is randomly chosen to be green pegs each turn (0.5 marks)7. When the green peg is destroyed, the extra balls appear and move correctly (1 mark)8. Powerup appears and moves as described (1 mark)9. Powerup causes fire ball (0.5 marks)10. Fire balls destroy multiple pegs (0.5 marks)11. The bucket functions correctly (1 mark)4SWEN20003 Object Oriented Software Development Project 2, Semester 2, 2019CustomisationOptional: we want to encourage creativity with this project. We have tried to outline every aspectof the game design here, but if you wish, you may customise any part of the game, including thegraphics, types of units, buildings, resources, game mechanics, etc. You can also add entirely newfeatures. However, to be eligible for full marks, you must implement all of the features in the aboveimplementation checklist.For those of you with too much time on your hands, we will hold a competition for the bestgame extension or modification, judged by the lecturer and tutors. The winning three will bedemonstrated at the final lecture, and there will be a prize for our favourite. Past modificationshave included drastically increasing the scope of the game, implementing jokes and creative gamedesign, adding polish to the game, and even introducing networked gameplay.If you would like to enter the competition, please email the head tutor, Eleanor McMurtry, atmcmurtrye@unimelb.edu.au with your username and a short description of the modifications youcame up with. I can’t wait to see what you’ve done!If you like, you may submit a minimal version of the game to be assessed, and email a secondextended version to Eleanor. Extensions submitted this way may use any libraries you like, notjust Bagel and the Java standard library.The supplied packageYou will be given a package, oosd-project2-package.zip, which contains all of the graphics andother files you need to build the game. You can use these in any way you like.Submission and markingTechnical requirements? The program must be written in the Java programming language.? The program must not depend upon any libraries other than the Java standard library, theBagel library, and Bagel’s dependencies.? The program must compile fully without errors.? Every public method, attribute, and class must have Javadoc comments, as explained inlater lectures.Submission will take place through the LMS. Please zip your project folder in its entirety, andsubmit this .zip file. Do not submit a .rar, .7z, .tar.gz, or any other type of compressedfolder.Ensure all your code is contained in this folder.5SWEN20003 Object Oriented Software Development Project 2, Semester 2, 2019Extensions and late submissionsIf you need an extension for the project, please email Eleanor at mcmurtrye@unimelb.edu.auexplaining your situation with some supporting documentation (medical certificate, academic adjustment plan, wedding invitation). If an extension has been granted, you may submit via the LMSas usual; please do however email Eleanor once you have submitted your project.The project is due at 11:59pm sharp. Any submissions received past this time (from 12:00amonwards) will be considered late unless an extension has been granted. There will be no exceptions.There is a penalty of 1 mark per day or part thereof for a late submission. If you submit late, youmust email Eleanor with your student ID so that we can ensure your late submission is markedcorrectly.MarksProject 2 is worth 22 marks out of the total 100 for the subject.? Project 2A is worth 6 marks.{ Correct UML notation for methods (1 mark){ Correct UML notation for attributes (1 mark){ Correct UML notation for associations (1 mark){ Good breakdown into classes (1 mark){ Sensible use of methods and attributes (1 mark){ Appropriate use of inheritance, interfaces, and abstract (1 mark)? Project 2B is worth 16 marks.{ Features implemented correctly: 8 marks (see Implementation checklist for details){ Coding style, documentation, and good object-oriented principles: 8 marks? Delegation: breaking the code down into appropriate classes (2 marks)? Use of methods: avoiding repeated code and overly complex methods (1 mark)? Cohesion: classes are complete units that contain all their data (1 mark)? Coupling: interactions between classes are not overly complex (1 mark)? General code style: visibility modifiers, magic numbers, commenting etc. (2 marks)? Use of documentation (javadocs) (1 mark)6
更多可加薇?號(hào):qing1119X

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
  • 序言:七十年代末膘流,一起剝皮案震驚了整個(gè)濱河市,隨后出現(xiàn)的幾起案子鲁沥,更是在濱河造成了極大的恐慌,老刑警劉巖耕魄,帶你破解...
    沈念sama閱讀 218,036評(píng)論 6 506
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件画恰,死亡現(xiàn)場(chǎng)離奇詭異,居然都是意外死亡吸奴,警方通過查閱死者的電腦和手機(jī)允扇,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 93,046評(píng)論 3 395
  • 文/潘曉璐 我一進(jìn)店門,熙熙樓的掌柜王于貴愁眉苦臉地迎上來则奥,“玉大人考润,你說我怎么就攤上這事《链Γ” “怎么了糊治?”我有些...
    開封第一講書人閱讀 164,411評(píng)論 0 354
  • 文/不壞的土叔 我叫張陵,是天一觀的道長(zhǎng)罚舱。 經(jīng)常有香客問我井辜,道長(zhǎng),這世上最難降的妖魔是什么管闷? 我笑而不...
    開封第一講書人閱讀 58,622評(píng)論 1 293
  • 正文 為了忘掉前任粥脚,我火速辦了婚禮,結(jié)果婚禮上包个,老公的妹妹穿的比我還像新娘刷允。我一直安慰自己,他們只是感情好,可當(dāng)我...
    茶點(diǎn)故事閱讀 67,661評(píng)論 6 392
  • 文/花漫 我一把揭開白布树灶。 她就那樣靜靜地躺著纤怒,像睡著了一般。 火紅的嫁衣襯著肌膚如雪破托。 梳的紋絲不亂的頭發(fā)上肪跋,一...
    開封第一講書人閱讀 51,521評(píng)論 1 304
  • 那天,我揣著相機(jī)與錄音土砂,去河邊找鬼州既。 笑死,一個(gè)胖子當(dāng)著我的面吹牛萝映,可吹牛的內(nèi)容都是我干的吴叶。 我是一名探鬼主播,決...
    沈念sama閱讀 40,288評(píng)論 3 418
  • 文/蒼蘭香墨 我猛地睜開眼序臂,長(zhǎng)吁一口氣:“原來是場(chǎng)噩夢(mèng)啊……” “哼蚌卤!你這毒婦竟也來了?” 一聲冷哼從身側(cè)響起奥秆,我...
    開封第一講書人閱讀 39,200評(píng)論 0 276
  • 序言:老撾萬榮一對(duì)情侶失蹤逊彭,失蹤者是張志新(化名)和其女友劉穎,沒想到半個(gè)月后构订,有當(dāng)?shù)厝嗽跇淞掷锇l(fā)現(xiàn)了一具尸體侮叮,經(jīng)...
    沈念sama閱讀 45,644評(píng)論 1 314
  • 正文 獨(dú)居荒郊野嶺守林人離奇死亡,尸身上長(zhǎng)有42處帶血的膿包…… 初始之章·張勛 以下內(nèi)容為張勛視角 年9月15日...
    茶點(diǎn)故事閱讀 37,837評(píng)論 3 336
  • 正文 我和宋清朗相戀三年悼瘾,在試婚紗的時(shí)候發(fā)現(xiàn)自己被綠了囊榜。 大學(xué)時(shí)的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點(diǎn)故事閱讀 39,953評(píng)論 1 348
  • 序言:一個(gè)原本活蹦亂跳的男人離奇死亡亥宿,死狀恐怖卸勺,靈堂內(nèi)的尸體忽然破棺而出,到底是詐尸還是另有隱情烫扼,我是刑警寧澤曙求,帶...
    沈念sama閱讀 35,673評(píng)論 5 346
  • 正文 年R本政府宣布,位于F島的核電站材蛛,受9級(jí)特大地震影響圆到,放射性物質(zhì)發(fā)生泄漏。R本人自食惡果不足惜卑吭,卻給世界環(huán)境...
    茶點(diǎn)故事閱讀 41,281評(píng)論 3 329
  • 文/蒙蒙 一芽淡、第九天 我趴在偏房一處隱蔽的房頂上張望。 院中可真熱鬧豆赏,春花似錦挣菲、人聲如沸富稻。這莊子的主人今日做“春日...
    開封第一講書人閱讀 31,889評(píng)論 0 22
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽椭赋。三九已至,卻和暖如春或杠,著一層夾襖步出監(jiān)牢的瞬間哪怔,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 33,011評(píng)論 1 269
  • 我被黑心中介騙來泰國(guó)打工向抢, 沒想到剛下飛機(jī)就差點(diǎn)兒被人妖公主榨干…… 1. 我叫王不留认境,地道東北人。 一個(gè)月前我還...
    沈念sama閱讀 48,119評(píng)論 3 370
  • 正文 我出身青樓挟鸠,卻偏偏與公主長(zhǎng)得像叉信,于是被迫代替她去往敵國(guó)和親。 傳聞我的和親對(duì)象是個(gè)殘疾皇子艘希,可洞房花燭夜當(dāng)晚...
    茶點(diǎn)故事閱讀 44,901評(píng)論 2 355

推薦閱讀更多精彩內(nèi)容