Skip to content

Commit

Permalink
fixed collision shit
Browse files Browse the repository at this point in the history
  • Loading branch information
eagattas committed Apr 19, 2015
1 parent 08204d8 commit 164384f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
9 changes: 8 additions & 1 deletion PlayerShip.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def __init__(self, position, folder_name):
self.folder_name = folder_name
self.fuel = 0
player_folder = str(folder_name) + "/PlayerShip" + str(self.angle) + ".png"
Ship.__init__(self, position, player_folder, (ship_scale, ship_scale))
Ship.__init__(self, position, classic_ship_location + "/PlayerShip" + str(self.angle) + ".png", (ship_scale, ship_scale))
self.image = pygame.image.load(str(self.folder_name) + "/PlayerShip" + str(self.angle) + ".png")
self.image = pygame.transform.scale(self.image, (ship_scale, ship_scale)) # Scale image
self.image.set_colorkey((0, 0, 0, 0))

# Overrides the Object's move so that rotating the ship is possible.
def move(self, x_vel, screen_height):
Expand Down Expand Up @@ -58,8 +61,12 @@ def damage(self, damage_done):
def input(self, keys):
if keys[K_UP]:
self.fuel -= reduce_fuel
if self.fuel < 0:
self.fuel = 0
self.velocity = (self.velocity[0], self.velocity[1] - move_amount)
if keys[K_DOWN]:
if self.fuel < 0:
self.fuel = 0
self.fuel -= reduce_fuel
self.velocity = (self.velocity[0], self.velocity[1] + move_amount)
self.velocity = (self.velocity[0], min(max(min_y_vel, self.velocity[1]), max_y_vel))
Expand Down
18 changes: 9 additions & 9 deletions highscores.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
EDWARD:EVAN:100
MANAV:OMKAR:100
OMKAR:EDWARD:100
MANAV:EVAN:100
OMKAR:EVAN:100
MANAV:EDWARD:100
ALFANO:WILL:100
NOAH:LAUREN:100
CHESNEY:HILDINGER:100
PLAYER 1:PLAYER 2:28
NOAH:LAUREN:100
ALFANO:WILL:100
MANAV:EDWARD:100
OMKAR:EVAN:100
MANAV:EVAN:100
OMKAR:EDWARD:100
MANAV:OMKAR:100
EDWARD:EVAN:100
PLAYER 1:PLAYER 2:50

0 comments on commit 164384f

Please sign in to comment.