腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
在创建自定义
sprite
类时,
Pygame
抛出"TypeError“
、
、
objects (for parallax) def _init_(self, x, y, image,speed):backgrounds =
pygame
.
sprite
.OrderedUpdates()backdrop =
pygame
浏览 5
提问于2014-06-26
得票数 1
回答已采纳
1
回答
雪碧未被提取
、
、
代码:
sprite
_frame = 0self.
sprite
_frame = 0 self.character_
sprite
= self.standing_right[self.
sprite
_frame]self.
sprite
_frame = self.<e
浏览 12
提问于2022-11-26
得票数 1
回答已采纳
1
回答
我需要使用
pygame
移动动画的帮助
、
、
pygame
.display.set_mode((WIDTH,HEIGHT)) #window '=': 'wall.png',} class Pacman(
pygame
.
sprite
.
Sprite
浏览 2
提问于2021-06-24
得票数 1
1
回答
碰撞误差self.rect.colliderect(
sprite
.rect)
、
、
这段代码在击中
sprite
之前开始打印“冲突”。 self.x = x enemy1.kill()class Enemy(
pygame
.
spr
浏览 1
提问于2021-03-02
得票数 1
回答已采纳
1
回答
多幅图像在绘制时会产生故障。
、
import
pygame
import osimport time WIDTH, HEIGHT = 800,600
pygame
.display.set_caption("My Game")bg_music = [] for r,d,f in os.wal
浏览 0
提问于2020-10-20
得票数 1
回答已采纳
1
回答
如何使实体在游戏中受到颜色碰撞的伤害?
、
、
、
这是我的代码:import
pygame
import time
pygame
.display.set_caption("Space Invaders") spaceship =
pygame
.image.load("spaceship2.png"
浏览 2
提问于2021-01-09
得票数 3
回答已采纳
1
回答
尝试在
pygame
中旋转图像以进行移动
、
、
我没有收到错误,但字符停留在一个位置,并且在我按下左箭头和右箭头键后
不
旋转。有没有人可以看看我的代码,让我知道我做错了什么?("Game")window.fill(green) def __init__(==
pygame
.KEYDOWN: pla
浏览 0
提问于2021-01-03
得票数 1
1
回答
游戏无法加载背景图像?
、
、
、
import
pygame
pygame
.init() screen =
pygame
.display.set_mode# icon =
pygame
.image.load('')running = True if event.type
浏览 1
提问于2020-01-23
得票数 2
回答已采纳
2
回答
pygame
.Color()返回的神秘值
、
、
我需要从PixelArray中的元素中识别像素的颜色,然后输入到
pygame
.Color()中。
pygame
.Color()返回的一个值使我感到困惑。usecolor = (46,12,187,255) # Declare our chosen color.
sprite
.fill(usecolor)
浏览 0
提问于2019-07-23
得票数 1
回答已采纳
1
回答
将精灵添加到组中
、
、
我正试图在屏幕上
显示
一组
Sprite
,然而,我下面的代码
显示
了一个空白屏幕。我在这方面已经有一段时间了,我不知道为什么这在逻辑上看起来是正确的。= 640
sprite
_width = 5spriteCount = 5
pygame
.init() <
浏览 1
提问于2013-12-19
得票数 0
1
回答
我想杀了我的雪碧。怎么杀死它?
、
、
、
import
pygame
as
pygame
, sys,time
pygame
.init() window_game =mouse_pos =
pygame
.mouse.get_pos() class mySprite(
pygame
.
sprite
.
Sprite
):__init__() self.image =
pygame</
浏览 8
提问于2022-02-25
得票数 -1
回答已采纳
1
回答
每个循环中创建精灵的
PyGame
循环
不
更新
、
、
、
、
每次循环运行时,我都试图创建一个alpha粒子(
sprite
),并且我能够创建它(
显示
在屏幕上),但是它不会向前移动,而如果我只创建一个粒子,它就能正常工作。()class Particle(
pygame
.
sprite
.
Sprite
):
pygame
.
sprite
.
Sprite
.self.rect.centerx
浏览 2
提问于2016-02-26
得票数 1
回答已采纳
1
回答
精灵不会混入表面
PyGame
、
import
pygame
size = (600,600)
pygame
.display.set_caption("chess")whitepawn =
pygame
.
浏览 6
提问于2022-03-30
得票数 0
1
回答
如何为我的游戏正确设置协调
、
、
这是我的密码 def __init__(self): def __init__(self): def __init__(self):
pygame
.
sprite
.<e
浏览 1
提问于2016-11-22
得票数 0
回答已采纳
3
回答
Pygame
:设置不
显示
的视频模式
、
基本上,在
显示
显示
器(窗口)之前,我需要使用
pygame
.Surface.convert_alpha(),但尝试这样做会引发以下异常:
pygame
.error: No video mode has been set 我该怎么做呢?
浏览 3
提问于2011-02-25
得票数 2
回答已采纳
1
回答
Python NameError:名称'self‘没有定义,为什么?
、
、
在顶部from
pygame
.
sprite
import
Sprite
pygame
.init() def __init__(self): self.img =
pygame</em
浏览 2
提问于2014-11-22
得票数 3
回答已采纳
1
回答
为什么雪碧不动?
、
以下是我的当前代码:screen =
pygame
.display.set_mode((800, 500)) def __init__(self, s, x, y):
pygame
.
sprite
.
Sprite
():
浏览 6
提问于2021-03-19
得票数 1
回答已采纳
1
回答
如何让精灵在点击时消失?
、
我有一个爆炸类和一个事件在主循环中,正确地检查一个精灵的位置,然后
显示
一个爆炸动画,如果鼠标点击气球。尽管如此,原始的气球精灵一直从屏幕上掉下来。这是气球班 super(Balloon,self).__init__() self.
浏览 0
提问于2021-11-27
得票数 1
回答已采纳
1
回答
空白
Pygame
屏幕
、
、
我知道这不是一个真正的空白屏幕,但现在我有一个问题。加载游戏需要花费很长时间。每次我关闭窗口,它都会满载?如果你需要代码,就问吧。
浏览 16
提问于2019-08-05
得票数 2
1
回答
Python3.10.2,AttributeError:'Player‘对象没有属性'image’
、
、
、
这是我的密码import
pygame
WHITE=(255,255,255)WIDTH=500
pygame
.init()
pygame
.display.set_caption("spacegame") clock=
pygame
.time.Clock()
浏览 3
提问于2022-01-26
得票数 0
点击加载更多
热门
标签
更多标签
云服务器
ICP备案
对象存储
云点播
智聆口语评测
活动推荐
运营活动
广告
关闭
领券