Titanium Appcelerator Box2d simple example part 2


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

Adds a floor to previous example


Copy this code and paste it in your HTML
  1. // create a ground level for things to hit
  2. var floor = Ti.UI.createView({
  3. backgroundColor:'#fff',
  4. width:310,
  5. height:2,
  6. bottom:40
  7. });
  8.  
  9. var b = world.addBody(floor, {
  10. density:12.0,
  11. friction:0.3,
  12. restitution:0.4,
  13. type:'static'
  14. });

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.