你的项目简介

FGAme的Python项目详细描述


https://travis-ci.org/fabiommendes/FGAme.svg?branch=masterhttps://coveralls.io/repos/github/fabiommendes/FGAme/badge.svg?branch=master

fgame是python 3的一个基于物理的游戏引擎。其目的是避免样板 如此简单以至于连孩子都能玩它(并学会如何编程 带着它!)。检查此pong实现:

from FGAme import *

# A 10px margin to keep things on the screen
world.add.margin(10)

# Create a ball in the middle of the screen. We also add some random speed
ball = world.add.circle(20, pos=pos.middle, color='red')
ball.vel = vel.random()

# Create both players as AABBs (axis aligned bounding boxes). Infinite
# masses prevent them from moving when hit by the ball
p1 = world.add.aabb(shape=(20, 120), pos=(30, 300), mass='inf')
p2 = world.add.aabb(shape=(20, 120), pos=(30, 300), mass='inf')

# Connect long press events with the correct functions
on('long-press', 'w').do(p1.move, 0, 5)
on('long-press', 's').do(p1.move, 0, -5)
on('long-press', 'up').do(p2.move, 0, 5)
on('long-press', 'down').do(p2.move, 0, -5)

# Start main loop
run()

fgame当前需要运行pygame。我们计划把它作为后端 不可知论,在未来它将支持SDL2,Kivy,Qt和其他

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

推荐PyPI第三方库


热门话题
serversocket Java服务器socket中断如何   java通过随机类和排序为数组生成数据   @Column length大于255个字符的java实体   java在使用NIO2 API时消除检查异常   java使用用户凭据通过Microsoft Graph API上的控制台应用程序发送电子邮件   java将2个ArrayList一个接一个地显示到jTextArea中,根据输入的数据多次显示   java无法使用导入的库。安卓工作室。谷歌云端点jar   spring boot Neo4j Apoc在java中获取结果摘要时的情况   转义特殊字符javajson   无法在java中使用OpenCV读取图像,涉及unicode路径   swing Document Listener java“无法实例化DocumentListener类型”   java Piglatin,难以理解如何移动“.”一串   java映射请求基于一个可观察对象中的每个元素,使用改进?   java在可扩展字符串中搜索时,如何忽略字符的大小写?   在包中分组类的java约定   python为Java应用程序创建Ubuntu指示小程序   java Camunda:如何通过processInstanceId获取所有已完成的任务