pygame问题 [英] pygame problems

查看:94
本文介绍了pygame问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我再次遇到更多问题。这次它与pygame有关。下面的代码没有给出任何错误消息,但它没有做它应该做的任何事情。代码有点长但它很简单。请帮助

Hi guys i have come again with more problems.This time it has to do with pygame.The following code does not give any error messages but it does not do what it is supposed to do either.the code is a bit long but it''s straightforward.Please help

展开 | 选择 | Wrap | 行号

推荐答案


大家好我再次遇到更多问题。这次它与pygame有关。下面的代码没有给出任何错误信息,但它没有做到它应该做的事情做任何一个。代码有点长,但它很简单。请帮助
Hi guys i have come again with more problems.This time it has to do with pygame.The following code does not give any error messages but it does not do what it is supposed to do either.the code is a bit long but it''s straightforward.Please help
展开 | 选择 | Wrap | 行号



我不确定你的缩进是否正确。在你的while循环中,你不会画任何东西或更新屏幕。您应该在每个帧中放置更新,绘图和blitting。你拥有它的方式,它只会在你关闭窗口时只做一次。你的while循环应该是这样的:
Hi, I''m not sure you''re indenting is correct. In your while loop you don''t draw anything or update the screen. You should put the updating, drawing, and blitting in every frame. The way you have it, it is only going to do something when you close the window and only once.Your while loop should look like this:
展开 | 选择 | 换行 | 行号



感谢您的回复。我想你的意思是我应该包括blitting和绘制到while循环,是有意义的。你怎么做到这一点在pygame级别,任何好的教程?
Thanks for replying.I think what your saying is i should include the blitting and drawing into the while loop,makes sense.How did you get to this level in pygame,any good tutorials?



pygame 网站有一些很好的教程,是一个很好的参考。

这里有一些帮助你的链接:
http://www.pygame.org/docs/
http://www.pygame.org/wiki/tutorials
http://www.pygame.org/docs/tut/chimp...ineByLine.html

另外,您可以从网站下载一些示例游戏,这样您就可以看到它们的编写方式并从中学习。

The pygame website has some good tutorials and is a good reference.
Here are some links to help you out:
http://www.pygame.org/docs/
http://www.pygame.org/wiki/tutorials
http://www.pygame.org/docs/tut/chimp...ineByLine.html
Also, you could download some sample games from the website so you can see how they are written and learn from them.


这篇关于pygame问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆