首页 > 其他分享 >CHC5028 Software Development

CHC5028 Software Development

时间:2024-12-19 18:20:38浏览次数:4  
标签:Development CHC5028 class object should will player your Software

CHC5028 Software Development with C/C++ Coursework Important Dates

Background

Text adventures”, now called “interactive fiction”, were among the first type of computer

ame ever produced. These games have no graphics; the player reads the story of thegame in text, and decides what their character will do by typing commands at a prompt.hese are playable online via a web browser. It is advisable to try out the games to getan understanding of how the games behave.

For this coursework, you will be creating a simple game engine for a text adventure.You are not required to write an actual adventure, only the back-end program code thatwould support one. You will need to add some material to the program in order totest it,but this may just be simple test material. You may add interesting descriptions or storiesto your program if you want to, but there are no marks for doing so.You are provided with a CLion project containing a very simple game harness whichsupports only two commands: going north (north or n), and quitting (quit). Extend itby doing the exercises below. Note that the later exercises are less explicitly describedhan the earlier ones, meaning that you must solve more problems yourself. This ismachine which does not have the Windows API installed, you may get an error in theewordwrap.c. This file calls a Windows specific function to find thewidth of the console. Ifyou get this error, remove the #include <windows.h> fromthe top of the file, and editthe initWordWrap() function by deleting its contents andreplacing them with

consoleWidth = 80; currentConsoleOffset = 0;. You can change 80 here to anynumber that makes the output comfortably readable.Task 1 (10% of the mark) In the current system, you can only move North. Extend the engine to allow movement inallfour compass directions.

  • Add properties to the Room class for storing east, south, and west exits. Theseproperties will need accessor methods.
  • Add code to the gameLoop method to understand the commands east, south, andwest(and the abbreviations e, s and w) and to handle them in a similar way to north.
  • Modify initRooms to create more rooms using the new exits to test yourcode.
  • The rooms created should be constructed in a reasonable and logical relationship thatmakes the game playable and sensible.

Task 2 (15% of the mark) A key part of most text adventure games is the ability to move objects around. Objects can be found in rooms and can be picked up and put down by the player. Add this capability to the game engine.

  • Create a GameObject super class. It should contain at least a weight, and akeyword (for the player to use when typing commands).
  • Modify the Room class so that each Room includes a list of GameObjects in theroom.
  • Create a derived class Weapon of Game代写CHC5028 Software DevelopmentOjbect class, the weight of each object ofWeapon should be limited in a range of 5-10. It should contain a property namedharm which should be limited in a range of 10-30.
  • Create a derived class Food of GameObject class, the weight of each object of Foodshould be limited in a range of 1-5. It should contain a property named energy whichshould be limited in a range of 1-10.

Modify initRooms to create some GameObjects ((including food and weapon objects)and put them in the rooms. Use this to test your program. (No marks are assigned

pecifically for this task, but without it, the ones following cannot be demonstrated.)Task 3 (15% of the mark)

A key part of most text adventure games is the ability to fight with the NPC enemy. The

NPC can be found in rooms and the player can fight with them. Add this capability to

the game engine.

  • Create a pure virtual EnemyObject class. It should contain at least a health, and akeyword (for the player to use when typing commands). It should contain a virtualmethod damage().
  • Modify the Room class so that each Room includes a list of EnemyObject in theroom.
  • Create a derived class Boss of EnemyObject class, the health of each object oBoss should be 100.
  • Create a derived class Clowns of EnemyObject class, the health of each object ofClowns should be 30.Modify initRooms to create some EnemyObjects ((including boss and clownsobjects) and put them in the rooms. Use this to test your program. (No marks areassigned specifically for this task, but without it, the ones following cannot bedemonstrated.)
  • You need to consider different reasonable damage value for each differentenemy objects’ damage() method.Task 4 (5% of the mark)
  • Modify the State class to include a representation of the player’s physical strength,called strength, which is initiated as 100, and when strength goes to 0, the programshall be terminated.
  • Modify the Room::describe() method to print out the keywords of all theobjects in throom, formatted as nicely as possible.

Task 5 (30% of the mark)

  • Modify the gameLoop method to pay attention to the second word of the commandtheplayer enters, if there is one. The following commands can be used with the secondword to search through a) objects in the current room,and b) objects in the inventory, foran object with a keyword matching the second word of the command the player typed.Implement the player command get which, when typed with an object keyword, willmoveerrors if the object is not in the room, or the object is already in the inventory, or theobject does not exist.
  • Implement the player command drop which, when typed with an object keyword, willmove that object from the inventory into the current room list. It should displayappropriate errors if the object is not in the inventory or doesnot exist, etc. (5%)
  • Implement the player command inventory which will print out the keywords ofall theobjects in the inventory.
  • Implement the player command eat which, when typed with a food objectkeyword, will print out the player’s strength after adding the energy of the foodobject to the player’s strength, which should not exceed 100.
  • Implement the player’s command fight which, when typed with an enemyobject keyword if the enemy object exists in the room, will print out the enemy’shealth that subtracts from the sum of harm of weapons carried by the player.
  • The harm is mutual, the player’s strength should reduce the damage of theenemy existing in the room and be printed out. You need to make the damage()in the Boss and Clowns class can be applied when the fight command isworking.
  • You need to make the printout of each command execution demonstrate theexplicit status of all objects in the room.

Task 6 (25% of the mark)

Since most players will not want to play an entire game at one sitting, most games includesave and load (or restore) commands. Implement these commands. Theyshould ask theuser for a filename and then write or read the current game state, to orfrom that file.Note that the layout and descriptions of rooms, and the list and descriptions of objects,are not part of the game state because they do not change during the game. These should not beincluded in the save file and saving them will lose marks.A simple file open, load, and save does not guarantee full marks and may notguarantee

“a good mark”. To this end, some important points to consider:

  • The “game state” may also include the locations of objects the player has dropped inrooms. Would it be a good idea to restructure how object locations are stored?
  • The “game state” may also include the status of the player and enemy objects. Would itbe a good idea to restructure these objects to the original situation?
  • The State object stores the current room, and objects, using pointers. Pointers cannotsafely be written to disk since addresses may be different when the programis reloaded.How can you enable this data to be safely saved and reloaded?
  • It is worth ensuring to some degree that the user cannot readily cheat, or spoil the game,authentication or encryption, at the same time, the file does not have to be just a textdump. This makes it harder to parse when loaded. So, for example, saving the requiredindexes into a static array of strings may be a better way than saving the stringsthemselves.Marking scheme for this task:
  • 5% for basic correct structure of I/O.
  • 10% for the file format designed for storing the saved game.
  • 10% for the code that performs the save and the load.

Assessment Rules( Very important ) Code will be assessed by a demonstration and viva in week 12. You will be asked to demonstrate your code and to explain how it works. There is no hard division of

marksbetween code and viva. The marks given are mainly based on your performance

in answering the assessor's questions and the accuracy and correctness of the

corresponding answers.

If you cannot explain your code sufficiently well to satisfy the assessor that it is your own work, they have the right to award 0 marks for that exercise,regardlessof the quality of the code. The fact that your code works does not guarantee full marks. All code is expected toalso be readable, maintainable, and efficient. You are not required to exactly follow the stepsin the exercises above. Alternative designs are also acceptable if they can bejustified in theviva. However, designs which substantially reduce efficiency or other desirable propertieswithout corresponding benefits will lose marks.

  • The deadline for submission of the coursework is Week 12.
  • In Week 12 you will also be required to demonstrate the final version ofyourwork, and verbal feedback will be given. In addition to final submission and viva in Week 12, there will be two counselling inthe week 10 and week 11 tutorial periods. You also can make appointments with the tutor during the whole semester toNotice on presentation and submission You do not need to give a presentation nor submit a report for either section of thecoursework. This coursework’s focus is on the quality of your final code and on your ability tounderstand it, not your software engineering process (which is not expected tobe standardwhen you are learning the language).

Standard rules on plagiarism apply to this coursework.

The Code should be your own work and must not be copied from the internet or any other source. If you have difficulty with the coursework, you should approach your practicaltutor in the first instance. Posting questions about the coursework on Stack Overflow, Quora,or similar sites may be treated as an incitement to plagiarism. Posting parts of your answer tothe coursework on the publicly available internet where other students may access it will betreated asan incitement to plagiarism. Soliciting or obtaining answers to the coursework inxchange for money and any other consideration will be treated as serious academicmisconduct. Asking for coursework answers from any party outside of the University is itselfattempted plagiarism and you should not do it; if that third party commits any of theoffenses inthis section on your behalf, you may be held responsible, even if you were not directly awarethey would do so (because you should not have asked them in the first place).Assignment Data

Learning Outcomes

  • Understand the fundamental concepts of C and C++ programming for objectmanipulation, data structuring and input/output control.
  • Refine a problem specification into a collection of C++ classes.
  • Create a software artefact specified in terms of C++ objects and their interrelations.
  • Research the techniques for safe and efficient programming in C and C++.

标签:Development,CHC5028,class,object,should,will,player,your,Software
From: https://www.cnblogs.com/MATH1131/p/18616323

相关文章

  • Windows和Linux系统中安装JDK(Java Development Kit)
    一、在Windows系统中安装JDK下载JDK访问Oracle官方网站(https://www.oracle.com/java/technologies/javase-downloads.html)。根据你的操作系统(32位或64位)和需求,选择合适的JDK版本进行下载。例如,对于大多数普通开发,选择JavaSE(StandardEdition)的JDK安装包。运行安装程序......
  • CS-453 Software transactional memory
    Projectdescription(CS-453)S´ebastienRouaultAntoineMuratSeptember24,2024Projectforum:https://moodle.epfl.ch/mod/forum/view.php?id=108506011Softwaretransactionalmemoryourgoalistoimplementasoftwaretransactionalmemorylibrary.Theproject......
  • DTS207TC Database Development and Design
    Modulecodeand TitleDatabase Development and Design (DTS207TC)SchoolTitleSchoolofAIandAdvancedComputingAssignmentTitle001: Assessment Task 1(CW)Submission Deadline23:59, 15th Dec (Friday)FinalWord Cou......
  • Zuul powers some of the largest Open Source development efforts
    ZuulpowerssomeofthelargestOpenSourcedevelopmenteffortshttps://zuul-ci.org/ ProjectGatingKeepyourbuildsevergreenbyautomaticallymergingchangesonlyiftheypasstests.CI/CDwithAnsibleUsethesameAnsibleplaybookstodeployyours......
  • IERG3080 Software Patterns
    IERG3080 Fall2024-Group ProjectDue: 23 Dec 2024Instructions:● This projecttakes30%ofthecoursetotal.●   Yourgroup needsto use VisualStudio to implementagame using WPF in C#described inthisspecification,andalsowrite......
  • CPT109 C Programming and Software
     CPT109CProgrammingandSoftwareEngineering1–GroupProject AssessmentObjectiveThisassessmentaimstoevaluatestudents’abilitytodevelopasignificantsoftwaresolutiontoarealworldproblembyworkingasamemberofateam.Yourteamwi......
  • Software Vulnerabilities Exercise
    SoftwareVulnerabilitiesExercise2-BasicbufferoverflowexploitsforthereceiverapplicationPEvansOctober31,20241OverviewandObjectivesInthepreviousexerciseyousawthatbysendingtoomuchdatatothenetworkingapplicationyoucancausei......
  • app.Environment.IsDevelopment、app.UseStaticFiles() 、在ASP.NET Core应用程序中,调
    在ASP.NETCore应用程序中,app.UseStaticFiles()是一个中间件方法,用于启用对静态文件的服务。这意味着当你的应用程序接收到对静态资源(如HTML文件、CSS文件、JavaScript文件、图片等)的请求时,UseStaticFiles中间件会处理这些请求并提供相应的文件。在ASP.NETCore应用程序中,app.E......
  • Hardware/Software Co-Exploration of Neural Architectures——神经架构的硬件/软件
    在一些研究工作中,探索实践与硬件平台端协同探索的方式来指导神经网络模型的结构设计优化,本文是对《Hardware/SoftwareCo-ExplorationofNeuralArchitectures》论文的阅读学习整体的论文阅读笔记,感兴趣的话可以参考下,如果想要进一步了解工作内容详情,建议移步阅读原英文论文,地......
  • FIT2107 - Software Quality and Testing
    FIT2107-SoftwareQualityandTestingASSIGNMENT2[40%]WhiteboxtestingandcodeanalysisOverviewForthisassignment,yourtaskistodesignanddocumentappropriatetestsforasoftwaresystemusingwhiteboxtechniques,buildaCI/CDpipelinetor......