随笔分类 -  pygame

摘要:1、飞机+云彩+子弹 import random import pygame from pygame.locals import * class Airplane(pygame.sprite.Sprite): # 继承pygame.sprite.Sprite精灵对象 def __init__(sel 阅读全文
posted @ 2021-06-10 18:11 南风丶轻语 阅读(139) 评论(0) 推荐(0) 编辑
摘要:1、创建精灵和精灵组并检测碰撞 import random import pygame from pygame.locals import * class Player(pygame.sprite.Sprite): # 继承pygame.sprite.Sprite精灵对象 def __init__( 阅读全文
posted @ 2021-06-10 14:53 南风丶轻语 阅读(938) 评论(0) 推荐(0) 编辑
摘要:1、创建精灵对象和精灵组 import random import pygame from pygame.locals import * class Player(pygame.sprite.Sprite): # 继承pygame.sprite.Sprite精灵对象 def __init__(sel 阅读全文
posted @ 2021-06-10 14:51 南风丶轻语 阅读(542) 评论(0) 推荐(0) 编辑
摘要:1、创建精灵对象并根据按键移动 import pygame from pygame.locals import * class Player(pygame.sprite.Sprite): # 继承pygame.sprite.Sprite精灵对象 def __init__(self): super() 阅读全文
posted @ 2021-06-10 14:48 南风丶轻语 阅读(344) 评论(0) 推荐(0) 编辑
摘要:1、创建精灵对象并显示 import pygame from pygame.locals import * class Player(pygame.sprite.Sprite): # 继承pygame.sprite.Sprite精灵对象 def __init__(self): super().__i 阅读全文
posted @ 2021-06-10 14:46 南风丶轻语 阅读(163) 评论(0) 推荐(0) 编辑
摘要:1、创建Surface对象及打印rect属性 import pygame from pygame.locals import * pygame.init() # 初始化pygame screen = pygame.display.set_mode((200, 200)) # 创建窗口 face = 阅读全文
posted @ 2021-06-10 14:43 南风丶轻语 阅读(969) 评论(0) 推荐(0) 编辑
摘要:1、设置窗口 import pygame from pygame.locals import * pygame.init() # 初始化pygame screen = pygame.display.set_mode((300, 300)) # 创建窗口 pygame.display.set_capt 阅读全文
posted @ 2021-06-10 14:40 南风丶轻语 阅读(361) 评论(0) 推荐(0) 编辑
摘要:1、问题描述 当定义精灵类时,移动精灵,移动后会出现模糊,留下移动痕迹 正常定义的是一个小方块 移动后出现痕迹,模糊现象 代码 import pygame from pygame.locals import * class Player(pygame.sprite.Sprite): # 继承pyga 阅读全文
posted @ 2021-06-09 15:13 南风丶轻语 阅读(739) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示