newton [PhysicsEditor exporter + loader]

Showcase your libraries, tools and other projects that help your fellow love users.
Post Reply
User avatar
tadamson
Prole
Posts: 2
Joined: Thu Jul 28, 2016 5:41 pm

newton [PhysicsEditor exporter + loader]

Post by tadamson » Tue Feb 21, 2017 4:16 am

Library that includes tools to export physics bodies made in CodeAndWeb's PhysicsEditor (https://www.codeandweb.com/physicseditor), then load them into a LÖVE game. I only found one other library of this sort and it didn't suit my use case very well. This library exports to .lua files for easy parsing, and takes a minimal approach by only loading the physics body. Comes with a basic "wdraw" utility for rendering all of the physics bodies in a given physics world.

Usage example:

Code: Select all

local loader = require "loader"
local wdraw = require "wdraw"
local world = love.physics.newWorld()
local body
local x, y = 100, 100

function love.load()
    body = loader(world, "physics/exportedFile", "bodyName", x, y)
end

function love.update(dt)
    world:update(dt)
end

function love.draw()
    wdraw(world)
end
Bitbucket repo:
https://bitbucket.org/tcadamson/newton
Last edited by tadamson on Mon May 21, 2018 8:05 am, edited 3 times in total.


Post Reply

Who is online

Users browsing this forum: No registered users and 28 guests