Skip to content

Commit f3bc86c

Browse files
authored
Fixed bug from spaceship (#84)
1 parent 6100646 commit f3bc86c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

source/game.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ def update_game_logic(self):
290290
if(spaceship.playerID) == "Player1":
291291
self.player_one.leave_spaceship(0)
292292
elif(spaceship.playerID) == "Player2":
293-
self.player_two.leave_spaceship(1)
293+
self.player_two.leave_spaceship(0)
294294
if spaceship == self.spaceship_one:
295295
variables.game_data[current_level]["spaceship_one_hp"]['current'] = 0
296296
spaceship.hp = 0

source/objects.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,6 @@ def upgrade(self, new_spaceship_sprite_path):
222222
# Set the image using the current angle
223223
self.image = pygame.transform.rotate(self.original_sprite_scaled, self.angle)
224224

225-
226-
227-
228225
def reposition(self, spaceship_number):
229226
"""Reposition the spaceship to its original location in case of collision."""
230227
# Load the original position from variables
@@ -236,9 +233,10 @@ def reposition(self, spaceship_number):
236233
self.x = planet_center_x + (self.planet_radius + self.radius) * math.cos(self.initial_angle)
237234
self.y = planet_center_y + (self.planet_radius + self.radius) * math.sin(self.initial_angle)
238235
self.angle = self.initial_angle + 180
236+
239237
self.image = pygame.transform.rotate(self.original_sprite_scaled, self.angle)
240238

241-
# print(self.initial_angle)
239+
print("problem")
242240
# # print initial angle in degrees
243241
# print(math.degrees(self.initial_angle))
244242
# print(math.degrees(self.angle))

0 commit comments

Comments
 (0)