Skip to content

Commit

Permalink
Make stylistic changes to code
Browse files Browse the repository at this point in the history
  • Loading branch information
sonjaek committed May 4, 2021
1 parent bb7b2e9 commit 77cbfc4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/gameloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,14 @@ def start(self):
self._handle_events()

if self._score_tracker.game_over():
self._renderer.show_end_banner(self._score_tracker.current_score)
self._renderer.show_end_banner(
self._score_tracker.current_score)
else:
if self._bubble.x >= self._window_width + 50:
self._bubble = Bubble(self._symbol_tracker)
self._bubble.move(1)
self._renderer.redraw(self._bubble, self._score_tracker.current_score)
self._renderer.redraw(
self._bubble, self._score_tracker.current_score)

pygame.time.delay(20)

Expand Down
4 changes: 2 additions & 2 deletions src/index.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import pygame
from ui.renderer import Renderer
from services.symbol_tracker import SymbolTracker
from gameloop import GameLoop
from ui.renderer import Renderer
from services.event_queue import EventQueue
from services.score_tracker import ScoreTracker
from services.symbol_tracker import SymbolTracker

WINDOW_WIDTH = 1200
WINDOW_HEIGHT = 500
Expand Down
3 changes: 2 additions & 1 deletion src/tests/event_queue_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ def setUp(self):
renderer = Renderer(window, 50, (0, 0, 0))
self.event_queue = EventQueue()
symbol_tracker = SymbolTracker()
GameLoop(window, 50, renderer, self.event_queue, score_tracker, symbol_tracker)
GameLoop(window, 50, renderer, self.event_queue,
score_tracker, symbol_tracker)

def test_event_queue_getter_returns_data(self):
response = self.event_queue.get()
Expand Down

0 comments on commit 77cbfc4

Please sign in to comment.