@@ -87,7 +87,7 @@ def update_score_text():
87
87
)
88
88
display = framebufferio .FramebufferDisplay (fb )
89
89
90
- # main group will hold all of our visual elements
90
+ # main group will hold all the visual elements
91
91
main_group = Group ()
92
92
93
93
# make main group visible on the display
@@ -202,7 +202,7 @@ def update_score_text():
202
202
40 ,
203
203
)
204
204
205
- # make it hidden, we'll show it when the game is over.
205
+ # make it hidden, it will show it when the game is over.
206
206
game_over_group .hidden = True
207
207
208
208
# add the game over lable to the game over group
@@ -339,9 +339,9 @@ def update_score_text():
339
339
# back over and changing turns
340
340
WAIT_UNTIL = 0
341
341
342
- # bool indicating whether we are waiting to reset flipped
342
+ # bool indicating whether the code is waiting to reset flipped
343
343
# cards and change turns or award points and remove
344
- # cards. Will be True if we are waiting to take action,
344
+ # cards. Will be True if the code is waiting to take action,
345
345
# False otherwise.
346
346
waiting_to_reset = False
347
347
@@ -352,16 +352,16 @@ def update_score_text():
352
352
353
353
# attempt mouse read
354
354
try :
355
- # read data from the mouse, small timeout so we move on
355
+ # try to read data from the mouse, small timeout so the code will move on
356
356
# quickly if there is no data
357
357
data_len = mouse .read (0x81 , buf , timeout = 10 )
358
358
359
- # if we got data, then update the mouse cursor on the display
359
+ # if there was data, then update the mouse cursor on the display
360
360
# using min and max to keep it within the bounds of the display
361
361
mouse_tg .x = max (0 , min (display .width - 1 , mouse_tg .x + buf [1 ] // 2 ))
362
362
mouse_tg .y = max (0 , min (display .height - 1 , mouse_tg .y + buf [2 ] // 2 ))
363
363
364
- # timeout error is raised if no data was read within the alotted timeout
364
+ # timeout error is raised if no data was read within the allotted timeout
365
365
except usb .core .USBTimeoutError :
366
366
# no problem, just go on
367
367
pass
@@ -380,13 +380,13 @@ def update_score_text():
380
380
# if the current state is playing
381
381
elif CUR_STATE == STATE_PLAYING :
382
382
383
- # if we are waiting to reset, and it's time to take action
383
+ # if the code is waiting to reset, and it's time to take action
384
384
if waiting_to_reset and now >= WAIT_UNTIL :
385
385
# this means that there are already 2 cards flipped face up.
386
- # we need to either award points, or flip them back over and
387
- # change to the next players turn.
386
+ # The code needs to either award points, or flip the cards
387
+ # back over and change to the next players turn.
388
388
389
- # change variable to indicate we're no longer waiting to take action
389
+ # change variable to indicate the code is no longer waiting to take action
390
390
waiting_to_reset = False
391
391
392
392
# if both cards were the same i.e. they found a match
@@ -406,7 +406,7 @@ def update_score_text():
406
406
update_score_text ()
407
407
408
408
# if the total of both players scores is equal to half the amount
409
- # of cards then we know the game is over because each pair is worth 1
409
+ # of cards then the code knows the game is over because each pair is worth 1
410
410
# point
411
411
if (
412
412
player_scores [0 ] + player_scores [1 ]
@@ -454,7 +454,7 @@ def update_score_text():
454
454
# empty out the cards flipped this turn list
455
455
cards_flipped_this_turn = []
456
456
457
- # ignore any clicks while we're waiting to take reset cards
457
+ # ignore any clicks while the code is waiting to take reset cards
458
458
if now >= WAIT_UNTIL :
459
459
# left btn pressed
460
460
if buf [0 ] & (1 << 0 ) != 0 :
@@ -497,7 +497,7 @@ def update_score_text():
497
497
# reload
498
498
supervisor .reload ()
499
499
500
- # if the mouse pint is within the exit
500
+ # if the mouse point is within the exit
501
501
# button bounding box
502
502
if exit_btn .contains (coords ):
503
503
# break to exit out of this script
0 commit comments