摘要: 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 南风丶轻语 阅读(157) 评论(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 南风丶轻语 阅读(979) 评论(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 南风丶轻语 阅读(564) 评论(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 南风丶轻语 阅读(361) 评论(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 南风丶轻语 阅读(172) 评论(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 南风丶轻语 阅读(1013) 评论(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 南风丶轻语 阅读(428) 评论(0) 推荐(0)