[pythonvis] Re: trying to develop a game in pygame.

  • From: Ben Mustill-Rose <ben@xxxxxxxxx>
  • To: pythonvis@xxxxxxxxxxxxx
  • Date: Wed, 28 Jul 2021 10:45:44 +0100

How about making your game break out of the main loop once it's over
then put the speech code outside of the loop before the code that
distroys the window?

On 7/28/21, arqam mehmood <arqamgrt1@xxxxxxxxx> wrote:

Hi everyone.
I'm learning python and pygame.
I'm trying to develop a game in pygame, a game engine in python.
but the problem is, if I want my program to show some text on screen,
screen readers does not read by default.
for this, I'm using accessible-output2 and pyttsx.
by using these module screen reader will read the text forcefully.
but for example, I have created a condition.
        if game_over:
            gameWindow.fill(white)
            talk("The game is over!")
Talk() is a user defined function that will let your screen reader
forcefully speak.
now, the problem is, this statement is in game loop, and when the game
is over, it speaks this text again and again, and I want it to speak
at once like,
the game is over!
but it is speaking again and again.
do anyone have any solution for this?
regards, Arqam Mehmood.
List web page is
//www.freelists.org/webpage/pythonvis

To unsubscribe, send email to
pythonvis-request@xxxxxxxxxxxxx with "unsubscribe" in the Subject field.

List web page is 
//www.freelists.org/webpage/pythonvis

To unsubscribe, send email to 
pythonvis-request@xxxxxxxxxxxxx with "unsubscribe" in the Subject field.

Other related posts: