GithubHelp home page GithubHelp logo

fgame's Introduction

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

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.

fgame's People

Contributors

fabiommendes avatar gutioliveira avatar macartur avatar msfernandes avatar andrebsguedes avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.