dan815
  • dan815
anyone know why my pygame window keeps freezing and i need to close it with the window not responding button instead of escape here my code:
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
jamiebookeater
  • jamiebookeater
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
dan815
  • dan815
import pygame pygame.init() screen=pygame.display.set_mode((640,480)) running = True while running: for event in pygame.event.get(): if event.type==pygame.QUIT: running=False if event.type==pygame.KEYDOWN and event.key==pygame.K_ESCAPE: running = False
e.mccormick
  • e.mccormick
Because you left the engine running.... and I don't mean on your car. ``` import pygame pygame.init() screen=pygame.display.set_mode((640,480)) running = True while running: for event in pygame.event.get(): if event.type==pygame.QUIT: pygame.quit() running=False if event.type==pygame.KEYDOWN and event.key==pygame.K_ESCAPE: pygame.quit() running = False ``` The addition of pygame.quit() shuts down the game engine, allowing the process to be unlinked from those DLLs.
dan815
  • dan815
you are the best!

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

dan815
  • dan815
just wondering though, closing the screen means you close the whole pygame module? so pygame running == pop up screen showing up?
e.mccormick
  • e.mccormick
Solving yours was the first time I used pygame, so I do not know all of what the engine does.
dan815
  • dan815
oh i think theres just something wrong with my version though because
dan815
  • dan815
i saw the teacher type the same code, and theirs was working fine
e.mccormick
  • e.mccormick
On what OS, with what version of Pygame, and whatversion of Python? See, those things could change it very easily.
dan815
  • dan815
that what i was thinking, i think i should downlad the 32 bit version
e.mccormick
  • e.mccormick
Or just close the engine on exit. Part of the fun of programming is finding little differences like that!
dan815
  • dan815
hmm
dan815
  • dan815
i think i need the engine running though
e.mccormick
  • e.mccormick
Should not need it when you exit. Only when playing.
dan815
  • dan815
like there are gonna be questions where i just keep refreshing the display screen by closing and opening
e.mccormick
  • e.mccormick
Hmmm... dunno then.
e.mccormick
  • e.mccormick
If you do it from inside the software, it may be different.
dan815
  • dan815
i will try downloading the right bit version brb
dan815
  • dan815
i m excited lol
dan815
  • dan815
i am finally going to start adding pictures to my game
e.mccormick
  • e.mccormick
Sprites! Whee. I did an Attack of the Rhoombas game in C++ for a final project. They slamed into your tank and exploded to kill you. Had pickups pop up on the map for tank repair and missiles, but never got the missles fully worked out.
e.mccormick
  • e.mccormick
Another cute trick is the rolling background. Start with a pic and cut it in half. Then swap the sides. Next to make the new middle match up. Now, when you have two copies go by, the edges are what was originally thew center and they match. What you fixed matches. So the whole thing works and you can roll it by as an endless background.
e.mccormick
  • e.mccormick
Here is where I used the rolling background. http://www.youtube.com/watch?v=eym2HQjHaWQ And here was the attack of the Rhoomas: http://www.youtube.com/watch?v=iAL1YDT0dbI

Looking for something else?

Not the answer you are looking for? Search for more explanations.