The sourcecode is:
Code: Select all
function load()
world = love.physics.newWorld( 2000, 2000)
world:setGravity(0, 50)
love.graphics.setBackgroundColor( 255, 255, 255)
ground = love.physics.newBody(world, 0, 0, 0)
ground_shape = love.physics.newRectangleShape(ground, 400, 500, 600, 10)
body = love.physics.newBody(world, 400, 200, 9999)
circle_shape = love.physics.newCircleShape(body, 50)
font = love.graphics.newFont(love.default_font, 12)
love.graphics.setFont(font)
end
function update(dt)
-- Update the world.
world:update(dt)
--I search the "bounce" factor
text = body:getAngularDamping()
end
function draw()
love.graphics.setColor( 0, 0, 255)
love.graphics.polygon(love.draw_line, ground_shape:getPoints())
love.graphics.setColor( 255, 0, 0)
love.graphics.circle( love.draw_fill, body:getX(), body:getY(), 50)
love.graphics.draw(text, 100, 100)
end