![]() |
User input problem
It is my first game and I need to know how to, for lack of a better word, pause the program but still run my animations and only stop them and continue the program when it receives use input.
Code:
for event in pygame.event.get(): |
You would have to run your animation code inside a sentinel type loop such as a while loop. The sentinel condition being that you received the correct user input which would cause the loop to exit and continue on. This probably won't work exactly as you are expecting because Python is after all a scripting language and executes the commands in the script line by line. You might be able to achieve something more like you would want if you involved threading in which case you could perform multiple tasks simultaneously but threading can be difficult to get right.
Code:
|
| All times are GMT +1. The time now is 12:41 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.