PyEnvirons是PyGame的一个高级API,可以方便地为无监督的人工智能代理设计、开发和调试环境。它正在快速发展中,几乎每天都会添加一些功能。

PyEnviron的Python项目详细描述


pyenvirons

“PyEnvirons”是PyGame的一个更高级别的API,可以方便地为无监督的人工智能代理设计、开发和调试环境。它正在快速发展中,几乎每天都会添加一些功能。

用法和示例

下面是一个示例,向您展示pyenvirs是多么简单。

创建功能窗口

fromCoreimportPyEnviron#Importing PyEnviron libraryscreen=PyEnviron.Window([800,600],'testwindow')#Instantiating the window class to make a window, by specifying the size and name of the windowapp=PyEnviron.App(screen)#Instantiating the app class by giving the app our windowapp.run()#running our app

使用精灵、游戏对象和层

fromCoreimportPyEnviron#Importing the PyEnviron libraryscreen=PyEnviron.Window([800,600],'testwindow')#Instantiating the window class to make a window, by specifying the size and name of the windowapp=PyEnviron.App(screen)#Instantiating the app class by giving the app our windowimage=PyEnviron.Sprite('PyEnviron/SpriteTests/2635d6c2b056dfb.png')#Loading a sprite for our use by specfying a file pathlayer=PyEnviron.Layer()#Instantiating a layer for us to put sprites into#The gameobject class, will have all the variables regarding the sprite, like the image, position, rotation, and script attached to it.gm=PyEnviron.GameObject(image)#Instantiating a gameobject for us to use by giving it our sprite, position, rotation and scale are [0, 0], 0 degrees and [1, 1], respectivly, by defualt.layer.add_gameobject(gm)#Adding our game object to the layerapp.add_layer(layer)#Adding the layer to our appapp.run()#Running the app

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
安卓在java中加入字符串组以创建复合字符串   java系统甚至不点击“下一步”或“上一步”按钮就将我返回到上一页,而不是进入下一页   java如何在arrayList中获取特定列的不同值   CXF GZIP REST JAVA   Java:使用大量半恒定标志检查优化循环中的循环?   java如何在两个应用程序之间进行会话管理?   java SVG文件使用蜡染(但没有轴线)转换为PNG   使用协议缓冲区和内部数据模型的java   java如何在logtag 安卓中打印和查看字符串的值   javascript如何在NodeJs中应用Java/Spring的分层架构?   java Spring URL在JSP中编码不正确   模式对话框后面的java工具提示   java WSRPC生成日历对象而不是日期   在对象外部无法识别类变量   java将图像从文件读/写到BuffereImage的最快方法?   JavaSpring数据存储库对具有不同Id的子类使用抽象超类   安全在Java 5.0上运行web应用程序服务器有危险吗?