Perfect Essay Writing

GSP 125 Week 4 iLab Simple Game inheritance

Order ready-to-submit essays. No Plagiarism Guarantee!

Note:  All our papers are written from scratch by human writers to ensure authenticity and originality.

GSP 125 GSP/125 GSP 125 Week 4 iLab

Check your essay before you submit. See exactly what your professor sees.

See your AI and plagiarism results before your instructor does.Get the exact same report your professor uses. Trusted by 50,000+ students worldwide.

//
//
//
//
//
//
// INSTRUCTIONS
———–Compile this code. You should see a rectangular play field of periods, with
3 Entity objects visible on it. The happy-face Entity moves with the “wasd”
keys, and the club Entity moves with the “ijkl” keys. If the happy-face
reaches the diamond Entity, the player wins. If the happy-face reaches the
club, the player loses.
Read through this code! Try to understand it before starting the assignment.
Comment confusing lines with what you think code is doing, and experiment
with existing code to test your understanding.
Once you feel comfortable with this code, accomplish each of the following,
and make sure your code compiles and runs after each step is completed.
1) Getting comfortable with the game code
a) Implement initialization lists in Vector2, Entity, and Game (setting
object values after a ‘:’, between the constructor signature and body).
Have initialization lists set initial values for each member variable.
b) Add another Entity to the game that isn’t the same location as an
existing Entity. Use a heart icon (ASCII code 3). It should display in
the game.
c) Add logic that makes the club (PLAYER2) win the game if that player
reaches the heart Entity. You may want to make new constants, like
GOAL2, and WIN2, to follow the existing code convention.
d) Make a new private function called “void Game::handleUserInput()”, move
the user input handling logic from Game::update() into this new
function, and call Game::handleUserInput from Game::update.
e) Add whitespace to the handleUserInput logic, and comment each line with
what you understand it is doing. If you don’t understand what the code
is doing, experiment with it until you do! Do things like printing
variables you are unsure about, and guess what output will look like.
f) Implement the prototyped overloaded operators for Vector2. Once they
are finished you should be able to use the alternate code for setting
up PLAYER2 in Game::Game() in “game.cpp”.
2) A “BlinkEntity” class
a) Create 2 new files in your project: “blinkentity.h”, and
“blinkentity.cpp”
b) Make a BlinkEntity class that extends Entity. Declare the class in
“blinkentity.h” and define it’s methods in “blinkentity.cpp”. Your
“blinkentity.h” file should look something like:

pragma once

include “entity.h”

class BlinkEntity : public Entity {
};
c) Instead of using an Entity for the Entity marked GOAL1 in the Game
constructor, use a BlinkEntity. You will need to create a public
BlinkEntity constructor.
d) Give BlinkEntity another member variable called “alternateIcon”. When
BlinkEntity calls it’s update function, swap the values of “icon” and
“alternateIcon”. You won’t notice a change during runtime until you add
the virtual modifier to Entity::update().
3) A “WanderingEntity” class
a) Create 2 new files in your project: “wanderingentity.h”, and
“wanderingentity.cpp”
b) Make a WanderingEntity class that extends Entity. Declare the class in
“wanderingentity.h” and define it’s methods in “wanderingentity.cpp”. //
Your “wanderingentity.h” file should look something like:
//

pragma once

//
//

include “entity.h”

//
//
class WanderingEntity : public Entity {
//
};
// c) Instead of using an Entity for the Entity marked PLAYER2 in the Game
//
constructor, use a WanderingEntity. You will need to create a public
//
WanderingEntity constructor.
// d) Create a new update method for WanderingEntity. Declare it in
//
“wanderingentity.h”, and define it in “wanderingentity.cpp”. In the
//
WanderingEntity::update() method, set the “howToMoveNext” variable
//
to a random number from 0 to 3. You can use “rand() % 4” to do this in
//
“wanderingentity.cpp” if you #include <cstdlib> or <stdlib.h>. After
//
setting the “howToMoveNext” variable in update, call the parent class’s
//
updated with “Entity::update()”.
// e) Add at least 2 more WanderingEntity objects in the Game. Add game logic
//
will cause the player to lose if the player shares a location with any
//
WanderingEntity object.

SOURCE: WWW.ROYALRESEARCHERS.COM
Havent found the Essay You Want?
We Can Help
The Essay is Written From Scratch for You

🛒Place Your Order

ORDER AN ESSAY WRITTEN FROM SCRATCH at : https://royalresearchers.com/
PLACE YOUR ORDER
Share your love