Pygame可以在wxPython无法做到的图形方面做些什么? [英] What can Pygame do in terms of graphics that wxPython can't?

查看:149
本文介绍了Pygame可以在wxPython无法做到的图形方面做些什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用Python开发一个非常简单的2D游戏。 Pygame是Python中最受欢迎的游戏开发库,但我已经非常熟悉wxPython,并且使用起来很舒服。我甚至写了一个俄罗斯方块克隆在里面,这是非常流畅的。



我不知道,什么是Pygame的报价在图形方面(离开声音一边,一会儿)是的wxPython可以你呢? Pygame中的图形比wxPython更简单/更快吗?它更跨平台吗?



看起来我在这里错过了一些东西,但我不知道是什么。


<解决方案

理论上Pygame没有什么可以做的,你不能用wxPython。关键不是什么,而是如何。在我看来,使用PyGame编写游戏比较容易,因为:





对于一些非常简单的游戏,比如俄罗斯方块,差异不会太大,但如果你想开发一个相当复杂的游戏,相信我,你会想要像PyGame这样的东西。


I want to develop a very simple 2D game in Python. Pygame is the most popular library for game development in Python, but I'm already quite familiar with wxPython and feel comfortable using it. I've even written a Tetris clone in it, and it was pretty smooth.

I wonder, what does Pygame offer in terms of graphics (leaving sound aside, for a moment) that wxPython can't do ? Is it somehow simpler/faster to do graphics in Pygame than in wxPython ? Is it even more cross-platform ?

It looks like I'm missing something here, but I don't know what.

解决方案

Well, in theory there is nothing you can do with Pygame that you can't with wxPython. The point is not what but how. In my opinion, it's easier to write a game with PyGame becasue:

  • It's faster. Pygame is based on SDL which is a C library specifically designed for games, it has been developed with speed in mind. When you develop games, you need speed.

  • Is a game library, not a general purpose canvas, It has classes and functions useful for sprites, transformations, input handling, drawing, collision detection. It also implements algorithms and techniques often used in games like dirty rectangles, page flipping, etc.

  • There are thousands of games and examples made with it. It will be easier for you to discover how to do any trick.

  • There are a lot of libraries with effects and utilities you could reuse. You want an isometric game, there is a library, you want a physics engine, there is a library, you what some cool visual effect, there is a library.

  • PyWeek. :) This is to make the development of your game even funnier!

For some very simple games like Tetris, the difference won't be too much, but if you want to develop a fairly complex game, believe me, you will want something like PyGame.

这篇关于Pygame可以在wxPython无法做到的图形方面做些什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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