Posted By

lspellman on 12/21/11


Tagged

Titanium Appcelerator Box2D


Versions (?)

Titanium Appcelerator Box2d simple example part 2


 / Published in: JavaScript
 

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

Adds a floor to previous example

  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. });

Report this snippet  

You need to login to post a comment.