pygame删除非精灵对象

发布于 2025-02-08 04:31:11 字数 88 浏览 1 评论 0原文

因此,我正在尝试制作一个向上的滚动平台游戏,我需要一种方法来删除分数计数器并在玩家死亡并重新启动时隐藏死亡屏幕。但是,这些对象不是精灵。还有一种删除它们的方法吗?

So Im trying to make an upward scrolling platformer, and I need a way to delete the score counter and hide the death screen when a player dies and restarts. However, those objects aren't sprites. Is there still a way to delete them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

残花月 2025-02-15 04:31:11

这只是一个示例,因为您尚未提供任何代码:'(

if not ondeathscreen:
     #draw your deathscreen
if not inGame:
     #draw your score counter

您必须使用游戏来代码,但希望它会有所帮助:))。

this is just an example because you have not provided any code :'(

if not ondeathscreen:
     #draw your deathscreen
if not inGame:
     #draw your score counter

you have to personilize this code with your game but hopefully it helps :))).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文