@@ -87,7 +87,7 @@ def update_score_text():
8787 )
8888 display = framebufferio .FramebufferDisplay (fb )
8989
90- # main group will hold all of our visual elements
90+ # main group will hold all the visual elements
9191main_group = Group ()
9292
9393# make main group visible on the display
@@ -202,7 +202,7 @@ def update_score_text():
202202 40 ,
203203)
204204
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.
206206game_over_group .hidden = True
207207
208208# add the game over lable to the game over group
@@ -339,9 +339,9 @@ def update_score_text():
339339# back over and changing turns
340340WAIT_UNTIL = 0
341341
342- # bool indicating whether we are waiting to reset flipped
342+ # bool indicating whether the code is waiting to reset flipped
343343# 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,
345345# False otherwise.
346346waiting_to_reset = False
347347
@@ -352,16 +352,16 @@ def update_score_text():
352352
353353 # attempt mouse read
354354 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
356356 # quickly if there is no data
357357 data_len = mouse .read (0x81 , buf , timeout = 10 )
358358
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
360360 # using min and max to keep it within the bounds of the display
361361 mouse_tg .x = max (0 , min (display .width - 1 , mouse_tg .x + buf [1 ] // 2 ))
362362 mouse_tg .y = max (0 , min (display .height - 1 , mouse_tg .y + buf [2 ] // 2 ))
363363
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
365365 except usb .core .USBTimeoutError :
366366 # no problem, just go on
367367 pass
@@ -380,13 +380,13 @@ def update_score_text():
380380 # if the current state is playing
381381 elif CUR_STATE == STATE_PLAYING :
382382
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
384384 if waiting_to_reset and now >= WAIT_UNTIL :
385385 # 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.
388388
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
390390 waiting_to_reset = False
391391
392392 # if both cards were the same i.e. they found a match
@@ -406,7 +406,7 @@ def update_score_text():
406406 update_score_text ()
407407
408408 # 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
410410 # point
411411 if (
412412 player_scores [0 ] + player_scores [1 ]
@@ -454,7 +454,7 @@ def update_score_text():
454454 # empty out the cards flipped this turn list
455455 cards_flipped_this_turn = []
456456
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
458458 if now >= WAIT_UNTIL :
459459 # left btn pressed
460460 if buf [0 ] & (1 << 0 ) != 0 :
@@ -497,7 +497,7 @@ def update_score_text():
497497 # reload
498498 supervisor .reload ()
499499
500- # if the mouse pint is within the exit
500+ # if the mouse point is within the exit
501501 # button bounding box
502502 if exit_btn .contains (coords ):
503503 # break to exit out of this script
0 commit comments