I am creating part of a game, Contra and cant figure it out

I have the assignment as well as some of the code already written. I need someone to complete this for me.

Get Help With a similar task to - I am creating part of a game, Contra and cant figure it out

Login to view and/or buy answers.. or post an answer
Additional Instructions:

Department of Computer Science Level 5 Quest: Extensible Game Engine CPSC 2377 Introduction to Game Programming Mr. Sean Orme Department of Computer Science Level 5 Quest: Physics CPSC 2377 Introduction to Game Programing Programming Concepts · Creating a hierarchy of C++ classes · encapsulating the idea of physical ‘objects’ as C++ classes; · implementing more quasi-physics Task Summary: Continuing with our development of our game, in this Quest you will explore inheritance by encoding the ideas of a player, enemy, and Blocks into a hierarchy of interactive C++ classes, creating instances of these classes (singly and in a vector), and manipulate these instances via their methods. We will also have an Object class that is the parent of all other classes. In addition, you will be detecting collision between the player and a block and applying gravity to the player. The player will gain the ability to point upward, and to jump! Background I have updated the level to look more like the beginning of the Contra game. This means that there are varying types of blocks and more types have been added to the “Type” enum (formerly known as the “ObjectType” enum). The player and enemy have been moved to the end of this struct and given values of 100 and 200 respectively. This is so that I can combine a player/enemy with a block. For example, in the background.txt file, there is a 205 which is an enemy and a top_block in the same spot. The value pulled from the file is % with 100 to get the background block and the modded value is subtracted from the original value to decide if an enemy or player is created. In the level 4 quest you updated the position of the player by simply moving the position of its sprite left, or right. The same will hold true for the payer in this assignment. However, now you will build on these animation principles applying gravity to the player every turn. Changes in position are the result of the object having velocity over some interval of time, described by the following equations (p=position, v=velocity, ∆t=time interval, and ∆p=change of position): ∆p = ∆t*v p= p+∆p Changes in velocity are the result of the object accelerating over some interval of time (a=acceleration and ∆v=change of velocity): ∆v = ∆t*a v = v + ∆v For this assignment, the game physics is very simple: acceleration, a, is a constant (gravity in AnimatedObject.h) and the interval of time, ∆t, is also fixed (deltaT in AnimatedObject.h). In addition, after gravity is applied, you will detect collision with the blocks. If there is a collision the player’s y position will be adjusted to be on top of the block. This collision should not apply to “background blocks”. The following are considered background blocks and should not be collided with: · center_block · tree_background · water · water_shore · water_wall_corner Also, in this quest, the engine has become a class, holding the player and vector of blocks. The hierarchy of classes looks like this: Notice that our ObjectPart and AnimatedObject structs have now become parent classes instead of members of the classes. This will simplify our code and make it much more readable because we no longer have to use the dot operator to access the ObjectPart and AnimatedObject members of the classes.Object Block Animated Object Player Enemy Engine GUI Base Code Functionality The instructor has provided all the necessary · graphics (./Assets/Images folder), · configuration files (Assets/Config/ folder), · GUI source code to display the Castlevania II game (GUI.h, Texture.h, GUI.cpp, Texture.cpp), · and frame timing source code (Timer.h, Timer.cpp). These files, along with · the base main source code (Level.5.quest.cpp), · base engine source code (engine.h and engine.cpp), · base object source code (Player.h, Player.cpp, Enemy.h, Enemy.cpp, Block.h, Block.cpp, AnimatedObject.h, AnimatedObject.cpp, Object.h, and Object.cpp) NOTE: the code will not compile and run in this assignment by default. You must implement at least skeleton classes for the code to compile and run. Required Code Functionality The Engine class has the following members and methods (NOTE::This class has been completed for you): · Public: · Engine(GUI& gui,const std::string& levelFile, const std::string& playerAnimationFile, const std::string& EnemyAnimationFile); · Constructor that takes the files for the background blocks, player’s animations, and enemy animations, along with the GUI. It is an almost exact copy of the loadGame method from the previous quest, except that the player, enemies, and blocks are already members of the class and we will need to store the GUI in the const GUI& gui; member. · void Engine::changeGameState(Object::Command command) · change game state simply calls the player, enemies, and all the block’s update methods. It no longer needs to take these as parameters, since they are members of the class. · std::tuple < const Player&, const std::vector<Enemy>&, const std::vector<Block>&> getObjects() const; · getter that returns all the objects in the game as a tuple. · Private: · std::vector<Block> blocks; · std::vector<Enemy> enemies; · Player player1; · const GUI& gui; Your Object class should exhibit the following features. · Object should maintain the following protected members: · const Type name{ Type::none }; · Vector2D position{ 0,0 }; · const GUI& gui; //IMPORTANT!!! · Object should have the following public accessor methods (i.e., getters/setters): · Vector2D getPosition() const; · void setPosition(Vector2D newPosition); · Vector2D getDimensions() const; · Type getName() const; · Object should have the following enums: · enum class Command { up, down, left, right, attack, jump, NA }; · enum class Type { none, bridge_center, bridge_end, bridge_start, center_block, top_block, tree_background, water, water_shore, water_top, water_wall, water_wall_corner, player=100, enemy=200}; · Object should overload the following constructors: · Object() = delete; · Object(Vector2D position, Type name, const GUI& gui); · Object should have the following purely abstract method · virtual void update(Object::Command command, const Player& player1, const std::vector<Block> & blocks) = 0; · The instructor also moved the Vector2D struct to the Object.h file. Your Block class should exhibit the following features. · Public child of the Object class · Block should maintain NO private members: · Block should overload the following constructors: · Block() = delete; · Block(Vector2D position, Object::Type name, const GUI& gui); · Block should override the following virtual method · void update(Object::Command command, const Player& player1, const std::vector<Block> & blocks) override; · This is an empty method and only here to make the class instantiable! Your AnimatedObject class should exhibit the following features. · AnimatedObject should overload the following constructors: · AnimatedObject() = delete; · AnimatedObject(std::string animationFile, Vector2D columnRow, Type name, const GUI& gui); · AnimatedObject should maintain the following protected members: · const int walkSpeed{ 12 }; · const int jumpStrength{ 35 }; · Vector2D velocity{ 0,0 }; · static const float deltaT;//initialized to 0.5f · static const Vector2D gravity;//initialized to {0.0f, 10.0f} · int currentSprite{ 0 }; · int currentAnimation{ 0 }; · State state{ State::stillRight }; · std::map<State, std::vector<int>> sprites; · AnimatedObject should have the following public accessor methods (i.e., getters/setters): · int getCurrentSprite() const; · AnimatedObject should have the following enums: · enum class State { stillLeft, stillRight, walkLeft, walkRight, crouchLeft, crouchRight, upLeft, upRight, jumpLeft, jumpRight }; · AnimatedObject should have the following protected methods: · void doPhysics(const std::vector<Block>& blocks); · applies gravity · checks for collision with blocks and sets y position accordingly. ONLY The following blocks should be collided with: · bridge_center · bridge_end · bridge_start · top_block · water_top · void applyGravity(); · updates velocity and position based on gravity and deltaT · bool collision(const Object& object); · returns true if the object is collided with, otherwise false. · void updateSprite(); · Just a copy and paste. Your Player class should exhibit the following features. · Player must implement the following constructors: · Player() = delete; · Player(std::string animationFile, Vector2D position, const GUI& gui); · Player should have NO private members · Player may (student’s choice) maintain the following private methods (unchanged from Level 4 Quest): · void moveDown(); · void moveLeft(); · void moveRight(); · void noAction(); · Add upLeft and upRight to the states that switch back to stillLeft and stillRight respectively. · The instructor added the following helper methods for the added abilities of the player: · void moveUp(); · Change the player's state from stillLeft and stillRight to upLeft and upRight respectively. · void moveJump(); · From stillLeft or stillRight state change to jumpLeft and jumpRight respectively. · Also, if the state’s are changed subtract jumpStrength from the player’s y velocity. · NOTE:: the jump state is only exited upon collision with a block, and this is done in the AnimatedObject’s doPhysics method. · Player should override the following virtual method: · void update(Object::Command command, const Player& player1, const std::vector<Block> & blocks) override; · The only change to this method is that the doPhysics method is called before updateSprite. This Quest can be broken down into the following tasks (with estimated difficulties). Task 0: Download Base Files (easy) Click on the repository link in Blackboard and use Github Desktop to clone the repository to your machine. Task 1: Build the skeleton classes (moderate) The header files for the classes are given to you, you will need to create the definitions for all the methods in the classes. Create empty ones at first and begin slowly filling them in. You will want to have the constructors for the children, pass along the construction to their parents. Task 2: Fully Implement Object class (moderate) You will want to start at the top and work your way down. Fully implement all the methods in the Object class. Task 3: Fully Implement the Block class (easy) You really do not have to do anything for this one if you have already created the empty classes. Task 4: Fully Implement the AnimatedObject class (hard) This is the tough one, and the main class you need to write new code for. You will also need to modify code that you copy and paste from previous quests. You may consider writing the collision function in its own program and pass in test values to make sure it works before putting into this class. Task 5: Fully Implement the Player/Enemy classes (moderate) Nothing too challenging about this one. Mostly copying and pasting and modifying the syntax a bit. Adding up and jump is very similar to the other commands. Task 6: Submit Completed Assignment (easy) Commit your code to the master branch and push it to the github repository. Submit a 5 minute video walkthrough of your code in Blackboard! How to go about writing this code. 1. Immediately read this quest specification carefully. 2. Download and build the project. 3. Run the base code. 4. Examine the source code. Particularly, study which variables the functions (those required for the quest) take as arguments and compare them with what these functions are to do. 5. Write in English the steps that each function should perform. 6. Use this plan to write the code. 7. Write the code incrementally, compiling often. Save your work! 8. Ask questions early and often!

Related Questions

Similar orders to I am creating part of a game, Contra and cant figure it out
32
Views
0
Answers
Advance topics in machine learning (Kernels) 2 questions.
Any 2/3 Questions need answering on Advance topics in machine learning (Kernels). relevant notes can be shared upon request....
17
Views
0
Answers
Using R programming to perform functions and do work.
The expectations are to use R programming to answer the questions attached the file, and the result is also to be a .r file....
13
Views
0
Answers
write up a report using c programming.
Using the knowledge acquired from this module write a descriptive report to solve the programming problems listed below. The word count limit is 500 words You must include the full code implementation as appendix! I recommend you use Courier New size 1...
16
Views
0
Answers
Analyse requirements and select appropriate solutions. Design programmes that use appropriate data structures
The assignment requires you to select and implement appropriate data structures, design and implement algorithms and create the relevant software applications that will allow a user to store, update and manipulate the data relating to the operations of an...