Titanium Appcelerator Box2d simple example part 3


/ Published in: JavaScript
Save to your folder(s)

Now we tilt the floor to be able to let objects bounce down the "hill"


Copy this code and paste it in your HTML
  1. var b = world.addBody(floor, {
  2. density:12.0,
  3. friction:0.3,
  4. restitution:0.4,
  5. type:'static'
  6. });
  7.  
  8. b.setAngle(85);

URL: http://lancespellman.com/2011/12/20/cool-box2d-stuff-with-appcelerator-titanium/

Report this snippet


Comments


You need to login to view comments.