Git Product home page Git Product logo

box2d-beef's Introduction

box2d-beef box2d wrapper for the Beef Programming Language

box2d - Actually a box2d fork with liquidfun merged into it!

Prerequisites

  • To initialize submodules run git submodule update --init --recursive

Windows

  • Visual Studio 2019 Community/Professional (it can be built with other versions though, check build_windows_vs2019.cmd for more information)
  • To build prerequisites run build_windows_vs2019.cmd

MacOS

  • To build prerequisites run ./build_macos.sh

Linux

  • To build prerequisites run ./build_linux.sh

Usage

Open workspace and set Example as Startup project and Run! MacOS/Linux can be built and run with provided VSCode project (expects Beef git clone in the same root folder as this project).

The library is pure C wrapper, so no classes, just structs and "pointers" , intended for people who wish to wrap it their own way. Example:

b2Vec2 gravity = .(0.0f, -10.0f);
var world = World.Create(ref gravity);
b2FixtureDef fd = .();
fd.shape = shape;
fd.density = 20.0f;
fd.friction = 0.1f;

for (int i = 0; i < 10; ++i)
{
   b2BodyDef bd = .();
   bd.type = .b2_dynamicBody;
   bd.position = .(-6.0f + 1.0f * i, 11.25f);
   var body = World.CreateBody(world, &bd);
   Body.CreateFixture(body, &fd);
}

Future work

iOS and Android build scripts.

box2d-beef's People

Contributors

jazzbre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

aharabada

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.