Introduce yourselves!
Icebreaker: What is your favorite game of all time?
Given a game engine with a GameObject
class definition.
Write code for move()
that moves the game object to a new (x,y)
location. How do you differentiate the class (x,y)
attributes from the method (x,y)
parameters?
Assume you want a Saucer
class to be managed by the game engine. A Saucer has an (x,y)
location and 10 hit points. Write the class definition.
Now, assume the Saucer should gain 1 hit point every time it moves to a new (x,y)
location. There are at least two ways to write this code.
What are they? What are the advantages/disadvantages of each?
Assume you want the game engine to move the Object as in #1. Write a Saucer::move()
method to increase the hit points by 1.
GameObject *p_o
).What is the syntax for invoking the move()
method?
Assume the engine wants to invoke the object-specific move()
method (e.g., Saucer::move()
). How does this happen? What keyword do you need to add to the GameObject
definition to make this work?
Have ONE person from each group submit the group's answers:
https://wpi.qualtrics.com/jfe/form/SV_9nW6BckzrVbDz0i
Make sure to include the names of all group members.
Happy C++-ing!
-- Mark