Pygame 游戏开发 All In One

时间:2025-02-22 12:36:32

Pygame 游戏开发 All In One

Pygame

Pygame is a library for digital arts, games, music, making, and a community around such things.

Pygame 游戏开发 All In One

https://github.com/pygame/pygame

Pygame 游戏开发 All In One

https://www.pygame.org/

Pygame 游戏开发 All In One

https://en.wikipedia.org/wiki/Pygame

demo

Pygame 游戏开发 All In One

# simple demo

# 导入依赖
import pygame, sys # 初始化
pygame.init() # 设置窗体
screen = pygame.dispaly.set_mode((600, 400))
# 设置屏幕
pygame.display.set_caption('Python 游戏开发') while True:
for event in pygame_.events.get():
# 事件处理
if event.type == pygame.QUIT:
sys.exit()
# 刷新屏幕
pygame.display.update()

Pygame 游戏开发 All In One

Pygame 游戏开发 All In One

Pygame 游戏开发 All In One

Pygame 游戏开发 All In One

Pygame 游戏开发 All In One

Pygame 游戏开发 All In One

refs

PIP

$ pip install pygame

https://pypi.org/project/pygame/

Python3 字符串

字符串是 Python 中最常用的数据类型。

我们可以使用引号( ' 或 " )来创建字符串。

var1 = 'Hello World!'
var2 = "Hello World!"

https://www.runoob.com/python3/python3-string.html


Pygame 游戏开发 All In One

xgqfrms 2012-2020

www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!

***Pygame 游戏开发 All In One