This is my first attempt at using physics bodies and I’m trying to create an animation effect where a character is blowing bubbles. I’m having problems achieving a floating effect, the smaller bubbles move much too fast while the larger bubbles stagnate. I’m also not happy with how much the bubbles bounce off each other and might prefer they stick to each other.
Thanks!
local physics = require("physics")physics.start() physics.setGravity(0, .1) display.setDefault( "background", 255, 255, 255 ) local function newBubble() r = (math.random(15, 35)) forceX = -3 forceY = -1 bubble = display.newCircle(200, 200, r) bubble:setFillColor(135,206,250) bubble:setStrokeColor(0,0,255) bubble.strokeWidth = 2 bubble.x = 500 bubble.y = 500 bubble.alpha = .5 physics.addBody(bubble, "dynamic", {bounce=0, friction=1, density=0, radius=r}) bubble:applyForce(forceX, forceY) end newBubble() timer.performWithDelay(800, newBubble, 10)