Teach you to use Python's pygame module to implement jigsaw puzzles_python

Table of contents

  • Introduction to pygame
  • installpygame
  • Common modules of pygame
  • pygame entry case
  • pygame realizes jigsaw puzzle game
  • Summarize

Introduction to pygame

Python Pygame is a software package specially designed for the development and design of 2D video games. It supports Windows, Linux, Mac OS and other operating systems, and has good cross-platform performance. Developed by Pete Shinners in 2000, Pygame is a free, open-source package, so you can use it to develop games without worrying about any fees.

Pygame is developed on the basis of SDL (Simple DirectMedia Layer, a multimedia development library written in C language), which provides many operation modules, such as image module (image), sound module (mixer), input/output (mouse, keyboard, display) module, etc. Compared with developing 3D games, Pygame is better at developing 2D games, such as Aircraft Wars, Snake, and Minesweeper.

installpygame

pip install pygame

Common modules of pygame

  • pygame.cdrom access CD-ROM
  • pygame.cursors load cursors
  • pygame.display access display device
  • pygame.draw draws shapes, lines and points
  • pygame.event manages events
  • pygame.font uses fonts
  • pygame.image loads and stores images
  • pygame.joystick for using a gamepad or something similar
  • pygame.key read keyboard keys
  • pyg

Guess you like

Origin blog.csdn.net/shengyin714959/article/details/130370850