12.5.1.1 connect the PyGame library and its modules; Python. PyGame library PyGame lets you:
Installing the PyGame library To install the library, you need to run the pip install <Module name> command: Win + R --> cmd --> c:\.....>pip install pygame Connecting and Initializing a PyGame module in the program
Surface creation (Application window)
!!! We have created a game window, but have not made a correct exit from the game !!! Game loop
Questions: 1. Describe how to install the PyGame library. 2. Explain how to use modules, methods, and functions of the PyGame library in the program. 3. Explain each keyword in the line "pygame.display.set_mode(size)". 4. Define using an infinity loop in the game. Exercises: Ex. 1. Determine the order of lines of code Tasks:
Tasks on Stepik.org course "Python Programming for NIS" Task 1. "Create game window" Write a program to create a game window. Size of window 600*400 pixels. Ensure that the window closes correctly. | |
| |
Просмотров: 6101 | | |
Всего комментариев: 0 | |