In Lime, I do not want to edit all the physics through Tiled and stuff. I downloaded PhysicsEditor and I want to export that and allow my own runner to run on the maps like so:
module(…, package.seeall)
function new()
local localGroup = display.newGroup()
local director = require(“director”)
local physics = require “physics”
physics.start()
physics.setGravity(0,9.8)
– Create our listener function
local sprite = require(“sprite”)
local lime = require(“lime”)
local map = lime.loadMap(“mape.tmx”)
local visual = lime.createVisual(map)
local physical = lime.buildPhysical(map)
visual:scale(.75,.75)
visual.y = -310
visual.x = -55
local spriteSheet = sprite.newSpriteSheet(“mainplayer.png”, 256, 256)
local monsterSet = sprite.newSpriteSet(spriteSheet, 1, 24)
sprite.add(monsterSet, “running”, 1, 10, 512, 0)
sprite.add(monsterSet, “jumping”, 11, 17, 612, 1)
local monster = sprite.newSprite(monsterSet)
monster:prepare(“running”)
monster:play()
monster:scale(.5,.5)
monster.x = 160
monster.y = -150
physics.addBody( monster, { density=.02, friction=0.05, bounce=0.3 } )
local physicsData = (require “map1”).physicsData()
physics.addBody(map.world, “static”, physicsData:get(“map1”)) [import]uid: 59735 topic_id: 32659 reply_id: 332659[/import]