Skip to content

Instantly share code, notes, and snippets.

@addieljuarez
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save addieljuarez/263e40c8ffcf31a393e3 to your computer and use it in GitHub Desktop.

Select an option

Save addieljuarez/263e40c8ffcf31a393e3 to your computer and use it in GitHub Desktop.
-----------------------------------------------------------------------------------------
--
-- main.lua
--
-----------------------------------------------------------------------------------------
-- Your code here
local fisica = require('physics');
fisica.start();
local back = display.newImage('bkg_clouds.png');
back.x = display.contentCenterX
back.y = display.contentCenterY
local base = display.newImage( 'ground.png', display.contentCenterX, 445 );
fisica.addBody(base, 'static', {friction = 0.5, bounce=0.3});
-- friction = Fr = uN u=constante de proporcionalidad
-- u = Fe/N
-- u = Fd/N
local caja = display.newImage( 'crate.png', 100, 50 );
fisica.addBody(caja, {density=3.0, friction=0.5, bounce = 0.3});
-- densidad = m/V
-- =magnitud
-- masa/Volumen
-- Kg/m3
local caja2 = display.newImage( 'crate.png', 120, 120);
fisica.addBody(caja2, {density=3.0, friction=0.5, bounce=0.3})
-- fisica.addBody(caja2, {density=30.0, friction=0.5, bounce=0.3})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment