Skip to content

Commit 6599a4f

Browse files
committed
Review update 1
1 parent 716ac4f commit 6599a4f

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed
405 Bytes
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
ROUTES = [
1+
PATHS = [
22
"animation/rocket_frame_1.txt",
33
"animation/rocket_frame_2.txt",
44
]
55

66
def load_frames():
77
frames = []
8-
for route in ROUTES:
9-
with open(route, "r") as f:
8+
for path in PATHS:
9+
with open(path, "r") as f:
1010
frames.append(f.read())
1111
return frames

main.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import asyncio
44
import random
55
from fire_animation import fire
6-
from ship_animation import load_frames
6+
from load_animation import load_frames
77
from itertools import cycle
88
from curses_tools import draw_frame, read_controls, get_frame_size
99

@@ -57,9 +57,11 @@ def draw(canvas):
5757
# Add ship in the center
5858
frames = load_frames()
5959
global current_ship_row
60-
current_ship_row = total_rows // 2
6160
global current_ship_column
61+
62+
current_ship_row = total_rows // 2
6263
current_ship_column = total_columns // 2
64+
6365
ship = draw_ship(canvas, current_ship_row, current_ship_column, frames)
6466
coroutines.append(ship)
6567

@@ -71,8 +73,7 @@ def draw(canvas):
7173
canvas.border()
7274
for coroutine in coroutines.copy():
7375
try:
74-
if current_ship_frame:
75-
read_controls_and_move_ship(canvas)
76+
read_controls_and_move_ship(canvas)
7677
coroutine.send(None)
7778
time.sleep(game_speed)
7879
except StopIteration:
@@ -158,6 +159,10 @@ def check_object_size(row, column, frame, canvas):
158159
return row, column
159160

160161

161-
if __name__ == "__main__":
162+
def main():
162163
curses.update_lines_cols()
163164
curses.wrapper(draw)
165+
166+
167+
if __name__ == "__main__":
168+
main()

0 commit comments

Comments
 (0)