Posted By

lspellman on 12/21/11


Tagged

Titanium Appcelerator Box2D


Versions (?)

Titanium Appcelerator Box2d simple example part 4


 / Published in: JavaScript
 

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

This example adds a wall to keep the ball from rolling into space

  1. // create a wall
  2. var leftWall = Ti.UI.createView({
  3. backgroundColor:'#fff',
  4. width:2,
  5. height:200,
  6. bottom:0,
  7. left:0
  8. });
  9.  
  10. world.addBody(leftWall, {
  11. density:12.0,
  12. friction:0.3,
  13. restitution:0.4,
  14. type:'static'
  15. });

Report this snippet  

You need to login to post a comment.