canvas - Box2d javascript add images to bodies and manage art assets -
ok have few levels of simple platform built out,
so need insight on how assign images bodies, , handle images, etc. game simple platform game, ball palyer chacter , have try reach other side. have obstacles joints , swinging balls, etc. getting started, please let me know if can help... box2dweb.. here example of few bodies inside game in various places.. advice appreciated. pplayer character let me know if can help.
function pc(gamepiece){ if (gamepiece == 1) { var ballsd1 = new b2circledef(); ballsd1.density = 1.1; ballsd1.radius = 22; ballsd1.restitution = 0.5; ballsd1.friction = 1; ballsd1.userdata = 'player'; var ballbd = new b2bodydef(); ballbd.lineardamping = .03; ballbd.allowsleep = false; ballbd.addshape(ballsd1); ballbd.position.set(40,0); player.object = world.createbody(ballbd); }
ok using box2d , need adding images bodies...
i guess not generate world programmatically. need find editor suitable job, or write 1 yourself.
i can advice use r.u.b.e lets create box2d worlds , attach images bodies. may export scene via json fits javascript.
the rendering of images attached bodies custom job. importing of scene if there no loader box2dweb yet.
Comments
Post a Comment