brent
first, i do have pro access and have been writing test programs and submitting bug reports.
second, the msg just had a snippet of the code.
i attached a zip file but don’t see it in the post.
i need docs on how to connect methods to listeners and filters
local centerX = display.contentCenterX
local centerY = display.contentCenterY
local W = display.contentWidth
local H = display.contentHeight
display.setDefault( ‘background’, 1,1,1)
local physics=require(‘physics’)
physics.start()
physics.setGravity(0,9.8)
local obstacle = display.newRect( centerX, centerY*1.75, W, 4 )
obstacle:setFillColor( 0, 1, 0)
physics.addBody( obstacle, “static”)
obstacle = display.newRect( W/10, centerY*1.75-150, 4, 300 )
obstacle:setFillColor( 0, 1, 0)
physics.addBody( obstacle, “static”)
obstacle = display.newRect( W*9/10, centerY*1.75-150, 4, 300 )
obstacle:setFillColor( 0, 1, 0)
physics.addBody( obstacle, “static”)
function touched(event)
if event.phase==‘ended’ then
local red = display.newImage( “red_balloon.png”, event.x, event.y )
physics.addBody( red, { density = 0.4, friction = 0.1, bounce = 0.2, radius=43 } )
end
end
Runtime:addEventListener( “touch”, touched ) – touch the screen to create balloons
–add liquid
local testParticleSystem = physics.newParticleSystem(
{
filename = “particle.png”,
radius = 4,
imageRadius = 5,
elasticStrength = 0.5, --greater than 1.5 not useful
}
)
local function delete(a,b,c)
print(a,b,c)
end --delete
local function onTimer( event )
local group=testParticleSystem:createGroup(
{
flags = { ‘elastic’, ‘destructionListener’ },
groupFlags = { ‘solid’ },
x = centerX,
y = 0,
color = {math.random(),math.random(),math.random()},
--radius = 32,
halfWidth=48, halfHeight=16,
lifetime=8
}
)
–group:addEventListener(‘destructionListener’, delete)
end --onTimer
timer.performWithDelay( 2000, onTimer, 0 )