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

  • From: arqam mehmood <arqamgrt1@xxxxxxxxx>
  • To: pythonvis@xxxxxxxxxxxxx
  • Date: Thu, 29 Jul 2021 06:08:45 +0500

Well I dont understand completely what are you trying to say.
but, If you're talking about putting the execution code outside of the
loop, I did it, but not worked, I tried break as well, but it says,
The game is over, Press enter to play again. and exit from the program.
because, I'm working in a main loop, if i'll try to break this loop,
the program will not work any more.
On 7/28/21, Ben Mustill-Rose <ben@xxxxxxxxx> wrote:

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.

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: