Department of Computer Science and Information Technology La Trobe University CSE1OOF Semester 1 Bundoora, 2020 Assignment Part C Due date for SUBMISSION Friday 25th may at 10.00 am Delays caused by...

i had attached the files


Department of Computer Science and Information Technology La Trobe University CSE1OOF Semester 1 Bundoora, 2020 Assignment Part C Due date for SUBMISSION Friday 25th may at 10.00 am Delays caused by computer downtime cannot be accepted as a valid reason for a late submission without penalty. Students must plan their work to allow for both scheduled and unscheduled downtime. The execution test marking will be in your normal lab time according to your allocation There is a 5% penalty for each working day that your submission is late. The submission will close on Monday the 25th at 10am. This is an individual Assignment. You are not permitted to work as a Pair Programming partnership or any other group when writing this assignment. You can use code provided in lectures & workshops. Copying, Plagiarism: Plagiarism is the submission of somebody else’s work in a manner that gives the impression that the work is your own. The Department of Computer Science and Information Technology treats academic misconduct seriously. When it is detected, penalties are strictly imposed. Refer to the subject guide for further information and strategies you can use to avoid a charge of academic misconduct. Submission Details: Note you must submit electronic copies of your source code files using the submit command on latcs8. Ensure you submit the required file. For example, the file Entity.java would be submitted with the command: >submitOOFEntity.java Do NOT use the LMS to submit your files, use latcs8 only PLEASE NOTE: While you are free to develop the code for this progress check on any operating system, your solution must run on the latcs8 system. Marking Scheme: This assignment is worth 15% of your final mark in this subject. Implementation (Execution of code) 90%, explanation of code 10% You may be required to attend a viva voce (verbal) assessment (to be used as a weighting factor on the final mark). Return of Mark sheets: The face to face execution test marking in the lab constitutes a return of the assignment mark. Please note carefully: The submit server will close at 10:00 am on the 25th of may. After the submit server has closed, NO assignments can be accepted. Please make sure that you have submitted all your assignment files before the submit server closes. (see pages 14 - 15) There can be NO extensions or exceptions. You must attend the lab you have signed up for on Allocate+ to have your assignment marked. If you have not signed up for a lab on the LMS page, your assignment will not be marked and it will be awarded 0. Non-attendance at the marking lab you have signed up for on the LMS page will also result in your assignment being awarded 0, except as detailed below. If you cannot attend the lab please email me ([email protected]) to arrange another time. Marking scheme: 90% for the code executing correctly 10%, you will be asked to explain (and / or alter) parts of your code. You are free to solve the Tasks below in any way, with one exception and one condition. Any assignment that uses code that is outside what has been presented to this point must be fully explained at the marking execution test. Not being able to fully explain code outside what has been presented in the subject so far will result in the assignment being awarded a mark of 0, regardless of the correctness of the program. Submitting an assignment with code outside what has been presented so far and not attending the marking execution test will result in an automatic mark of 0, regardless of the correctness of the submission Problem Description Your task will be to make a 2D game that works inside the UNIX terminal window. Please watch the Week 9 & 10 Lecture Videos on Echo. The game will use only Unicode characters (basically Emojis) to represent the player and the other entities, such as monsters etc. The player will be able to move around using the WASD keys. The artificial intelligence (AI) of the monsters will be synchronous with the player movements, that is, the monsters only move when the player moves. This is because taking user input is a blocking operation meaning that the code will sit and wait for the user to provide input, during this time no processing can happen. I have provided you with some files copy them to your home drive using this command. cp /home/student/csilib/cse1oof/bu1-2020/game/*.java . Your program must work with an UNEDITED version of GameDriver.java The driver program will put the terminal into a special mode where they key pressed are processed immediately without needing to press enter. THIS UNIX SPECIFIC! USE LATCS8 It won’t work on Windows. If you don’t want to use Latcs8, I would recommend using the Virtual Machine (VM) that is on LMS. Windows Subsystem for Linux may also work. https://lms.latrobe.edu.au/mod/forum/discuss.php?d=962672 We will be testing the program on Latcs8, it MUST work correctly there. Inheritance Diagram Terminology In the game making word there is a lot of jargon that you need to be aware of. Game State The state of a game refers to overall position of the player and any other entities and their attributes, position, health, etc. For a game of chess, the game state information would include · Who’s turn is it currently. · What colour each player is playing as. · What the location of each piece is. Render The term render in computing generally refers to the idea of converting raw data into an image for a human to look at. This can include thigs like video rendering, or image rendering. For our game rendering will refer to printing the entities on the terminal screen. Artificial intelligence (AI) This refers to how the game entities behave; where they move, what tasks they do and when they do them. The AI can be very simple such as move in a random direction, or the AI can be very complex such as a system that predicts the user’s behaviour. Map The environment where the game takes place with the entities on itis referred to as the Map or Level. Not to be confused with the concept of player level, which is typically independent of the map. In our game the map is a finite two-dimensional grid. Mob A mob is a general term for hostile enemies or monsters. Sprite A sprite is the image that is used to represent a game entity, in our case we will be using Emojis as sprites. A good source of spites: https://www.compart.com/en/unicode/block/U+1F300 Frame A frame is the rendered image that the user sees, the frame rate refers to how many rendered images are generated and displayed to the user’s screen per second. Most games will have a frame rate between 60-120 FPS, depending of graphics settings and how powerful the PC is. Our game will only refresh the frame when the user moves Tick A tick is 1 cycle of the game loop which updates the entities in the game. Most games will have a timer-based tick system, for example Minecraft has a tick rate of 20 ticks per second (TPS). Our game will only tick when the player moves. Game Design The game we are designing draws inspiration from Chips Challenge, I would recommend familiarising yourself with the game before continuing. Chips Challenge uses a moving frame to allow the player to see only a small section of the map at a time. This allows the map to be much larger than the users screen. To keep this assignment simple, we will not be doing that, instead will have a fixed size map that is the same size as the frame. However, we will explore how to do a moving window type approach in the bonus section. The coordinates system will be positive X moves to the right and positive Y moves down. The squares below we will refer to as tiles, or positions. The player has no health, instead the player will lose immediately as soon as a monster moves onto a tile that is occupied by the player. The player can move by pressing WASD the keys. The monsters move 1 tile per tick. The player wins the game by reaching the flag. We will have a few monsters, if the player touches any monster the player loses instantly. · The Ghost, moves around randomly. · The Cactus, does not move. · The Ball, travels in one direction until it cannot go any further, then it bounces backwards. · The Alien, moves in leftwards, until it cannot go any further, then it will turn 90 degrees to the left and continue. · The Goblin, moves towards the player. And some other entities · The Player · The Wall, stops all entities passing it, does not move. · The MultiWall, same as Wall, but occupies multiple tiles. · The SafeZone, same as MultiWall, but allows players to walk through it. · The Flag, wins the game, does not move Our game will have a collision system, so some entities can walk though others. Monsters must collide with other monsters, but not with the player. GameState.java This will be your main controller object for the game, it will contain the player and all entities. In order to be compatible with the drive program you MUST implement the methods listed below. The underlined attributes are static constants Constructor The constructor will need to · Initialise the frame array to be FRAME_WIDTH by FRAME_HEIGHT. · Initialise the Random attribute. · Call resetGame() resetGame() This method will setup the game into a fresh state. · Initialise the Entities array. · Populate the entities array with some monsters and a flag. · Instantiate the player object. · Set gameFinished to false Do not put the player in the entities array. onUserInput(int asciiCode) This method will be called when the user presses a key, the ASCII code will be passed in. Your code should detect if the pressed “W” and if so, call moveUp() on the player object. Do the same for left, right, and down with keys A, D, and S respectively. If the user pressed “R”, call resetGame() to start a new game. renderFrame() This method must do a few tasks 1. Clear the contents of the frame array, use a nested for loop to set everything to null. 2. Loop over the entities array and call drawSelf(). 3. Call drawSelf() for the player object. 4. Display the contents of frame, use a nested for loop to print the strings out. If you encounter a null, just print two space characters. When printing the frame put a nice border on it. Use the same box drawing characters that were used in Assignment 2. getRandom() Return the Random object. isBlocked(Entity entityToMove, int x, int y) This method is
May 19, 2021CSE1OOFLa Trobe University
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here