Skip to content

Commit

Permalink
Merge pull request #6 from bragerosberg/refactor-file-structure
Browse files Browse the repository at this point in the history
Refactor file structure
  • Loading branch information
bragerosberg authored Nov 11, 2021
2 parents 72fb3c6 + e86df4a commit 9dcdc50
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/__pycache__
/__pycache__
.history
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
6 changes: 3 additions & 3 deletions breakout.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def __init__(self, x, y):

# Assigns the block attributes of custom graphics and location on screen
self.image = pygame.Surface([64, 64])
self.image = block_img
self.image = brick_img
self.rect = self.image.get_rect()
self.rect.x = x
self.rect.y = y
Expand Down Expand Up @@ -102,7 +102,7 @@ def __init__(self):
self.height = pad_height

self.image = pygame.Surface([self.width, self.height])
self.image = player_img
self.image = paddle_img
self.rect = self.image.get_rect()
self.screenheight = pygame.display.get_surface().get_height()
self.screenwidth = pygame.display.get_surface().get_width()
Expand Down Expand Up @@ -136,7 +136,7 @@ def update(self):
# Name the game window
pygame.display.set_caption('Breakout made by "bro041"')
# Make font ready for loss/win scenario
font = pygame.font.Font("arcade.ttf", 72)
font = pygame.font.Font("./assets/arcade.ttf", 72)

# Assigns the different sprite classes their group classes
blocks = pygame.sprite.Group()
Expand Down
8 changes: 4 additions & 4 deletions breakout_graphics.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pygame

# Graphics on the blocks, ball, player-controlled-pad and the background
block_img = pygame.image.load("glowstone.png")
ball_img = pygame.image.load("fire_charge.png")
player_img = pygame.image.load("bouncer.png")
background_img = pygame.image.load("nether.png")
brick_img = pygame.image.load("./assets/glowstone.png")
ball_img = pygame.image.load("./assets/firecharge.png")
paddle_img = pygame.image.load("./assets/bouncer.png")
background_img = pygame.image.load("./assets/nether.png")

# Amount of times ball has hit the bricks
font_name = pygame.font.match_font("arial")
Expand Down

0 comments on commit 9dcdc50

Please sign in to comment.