在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:fabiommendes/FGAme开源软件地址:https://github.com/fabiommendes/FGAme开源编程语言:Python 99.8%开源软件介绍:FGAme is a physics-based game engine for Python 3. Its aims to avoid boilerplate and to be so easy that even a child can play with it (and learn how to program with it!). Check this pong implementation: 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 currently requires Pygame to run. We have plans to make it backend agnostic and in the future it will support SDL2, Kivy, Qt and maybe others. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论