What can Pygame do in terms of graphics that wxPython can't?

前端 未结 2 1553
醉梦人生
醉梦人生 2021-02-19 00:58

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 comf

2条回答
  •  滥情空心
    2021-02-19 01:56

    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.

提交回复
热议问题