Skip to content

EJTH/phun-js-box2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

phun-js

Phun-js is a bundle of utilities revolving around the sandbox "games" Phun and Algodoo. The greater goal of this project is to create a HTML Web player for Algodoo & Phun scenes.

As of now it currently consists of:

  • Scene & ThymeScript parser
  • ThymeScript to JavaScript Transpiler
  • Small runtime for Thyme in javascript (polyfills for thyme specific language features)
  • WIP Web player for Algodoo scenes

HTML5 Algodoo scene viewer/player

The plan for the web player is to use LiquidFun by Google for the Physics calculations and possibly THREE.js for the rendering. LiquidFun is an extension of the Box2D physics engine and comes in an EmScripten compiled version for javascript.

Instructions

Go to the phun-js-webplayer drag and drop your algodoo scene into the browser. Thats it!

Player features

  • Drag & drop .phz files to load (Client side)
  • Hinges, springs (wip)
  • water
  • Complex polygons
  • Circles, rectangles
  • Hinges, Motors (Controlled)
  • Fixate joins (wip)
  • Camera follow

Player examples:

ThymeScript parser and Transpiler

For info on using the Thyme parser and transpiler, take a look at the unit tests provided. and also reference the documentation for PEG.js

TODOs

  • Fix complex polygons (Earclipping!)
  • Fix emscripten compilation (enable optimizations and fix particles!)

Web player

  • (Proper) Springs
  • Thrusters
  • Breakables
  • Events & Thyme Scripting
  • Textured and solid rendering mode
  • Sky & cloud
  • Killers and Immortalss
  • Air friction
  • Wind (Probably never going to do this!)
  • Controls (wip)
  • Phun drag&drop support in player

Greater scheme

  • Scene to HTML converter tool (CLI)
  • THREE.js+liquidfun template with phz scene support.

Links

About

Algodoo scene parser for javascript (and wip player for phun / algodoo scenes in the browser with Box2D)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages