Arcade Python 2D视频游戏库
Arcade简介
Arcade,基于Pyglet和OpenGL的Python 2D视频游戏第三方库。适合于那些想在不学习复杂框架的情况下创建2D游戏的程序员。
Arcade应用实例
import arcade
SCREEN_WIDTH = 800
SCREEN_HEIGHT = 600
SCREEN_TITLE = "Starting Template"
class MyGame(arcade.Window):
def __init__(self, width, height, title):
super().__init__(width, height, title)
arcade.set_background_color(arcade.color.AMAZON)
def setup(self):
pass
def on_draw(self):
self.clear()
def on_update(self, delta_time):
pass
def on_key_press(self, key, key_modifiers):
pass
def on_key_release(self, key, key_modifiers):
pass
def on_mouse_motion(self, x, y, delta_x, delta_y):
pass
def on_mouse_press(self, x, y, button, key_modifiers):
pass
def on_mouse_release(self, x, y, button, key_modifiers):
pass
def main():
""" Main function """
game = MyGame(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
game.setup()
arcade.run()
if __name__ == "__main__":
main()
Arcade Github统计数据
The Arcade library is licensed under the MIT License.
Github 1.6k stars
Arcade安装命令
pip install arcade
Python版本要求
Arcade requires Python 3.7 or newer. It does not run on Python 2.x.
免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。