Answers
Exercise A:
In Camera.py
add extra if
statements to handle the ‘A’ and ‘D’ key presses and use the x axis to move the camera as follows:
def update(self):
key = pygame.key.get_pressed()
if key[pygame.K_w]:
self.transform.update_position(
self.transform.get_position()
+ pygame.Vector3(0, 0,
self.pan_speed),
False)
if key[pygame.K_s]:
self.transform.update_position
(self.transform.get_position()
+ pygame.Vector3(0, 0,
-self.pan_speed),
False)
if key[pygame.K_a]:
self.transform.update_position(
self.transform.get_position()
+ pygame.Vector3(self.pan_speed,
0, 0),
...