xgqfrms™, xgqfrms® : xgqfrms's offical website of cnblogs! xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

Pygame 游戏开发 All In One

Pygame 游戏开发 All In One

Pygame

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

https://github.com/pygame/pygame

https://www.pygame.org/

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

demo

# 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()


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



©xgqfrms 2012-2020

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

***

posted @ 2021-01-09 23:11  xgqfrms  阅读(78)  评论(3编辑  收藏  举报