Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added gameover1.bmp
Binary file not shown.
18 changes: 16 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
import pygame
import math

# Images
gameover = pygame.image.load('gameover1.bmp')

# Colors
BLACK = (0,0,0)
WHITE = (255,255,255)
BLUE = (0,0,255)
Expand Down Expand Up @@ -182,12 +186,14 @@ def main():
running = False

if player.train_wreck(train):
train.dx = 0
print "Game over!"
train.constdx = 0
player.dx = 0
running = False

# keep train moving
train.step()

# decrease speed of player (and all things relative to it)
for model in controlled_models:
# good delta speed is .00005
if model.dx > .01:
Expand All @@ -205,6 +211,14 @@ def main():

pygame.display.update()

running = True
while running == True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
screen.blit(gameover,(60,60))
pygame.display.flip()

pygame.quit()

if __name__ == '__main__':
Expand Down