Commits

Nikhil Marathe committed db5ddfe

Allow camera control using WASD

Comments (0)

Files changed (1)

src/fileadelphia/main.py

         facing_perp_x = (math.sin(math.radians(self.angle+90)),
                          0, #math.sin(math.radians(self.pitch)),
                          -math.cos(math.radians(self.angle+90)))
-        if key == K_UP:
+        if key == K_UP or key == K_w:
         	self.pos = (self.pos[0] + facing[0], self.pos[1] + facing[1], self.pos[2] + facing[2])
-        elif key == K_DOWN:
+        elif key == K_DOWN or key == K_s:
         	self.pos = (self.pos[0] - facing[0], self.pos[1] - facing[1], self.pos[2] - facing[2])
-        elif key == K_LEFT:
+        elif key == K_LEFT or key == K_a:
         	self.pos = (self.pos[0] - facing_perp_x[0], self.pos[1] - facing_perp_x[1], self.pos[2] - facing_perp_x[2])
-        elif key == K_RIGHT:
+        elif key == K_RIGHT or key == K_d:
         	self.pos = (self.pos[0] + facing_perp_x[0], self.pos[1] + facing_perp_x[1], self.pos[2] + facing_perp_x[2])
         else:
         	return False