still no go ?
[lua]–Boolean for switch function
–slow = false
local function spawnDots()
local buttonSlowMo = display.newCircle(0,0,20,20)
buttonSlowMo:setFillColor(153,50,204)
buttonSlowMo:setReferencePoint(display.centerReferencePoint)
buttonSlowMo.x = _W/2
buttonSlowMo.y = 500
physics.addBody( buttonSlowMo,“static”, { density = 1, friction = 0.3, bounce = 1.0, radius = 20 })
–Switch function for slow motion
function slowMode()
if slow == false then
slow = true
print(“on”) – Print “on” in terminal to show that this is functioning
for i = 1, #blueDots do – Use a for loop so we can call each individual object in the table all at once
blueDots[i].linearDamping = 1.0 – Set linearDamping to 1.5 (slows object linear velocity)
for i = 1, #redDottable do – Use a for loop so we can call each individual object in the table all at once
redDottable[i].linearDamping = 2.0 – Set linearDamping to 1.5 (slows object linear velocity)
end
end
elseif slow == true then
slow = false
print(“off”) – Print “on” in terminal to show that this is functioning
for i = 1, #blueDots do
blueDots[i].linearDamping = 0 – Set linearDamping to 0 (resume original linear velocity)
for i = 1, #redDottable do – Use a for loop so we can call each individual object in the table all at once
redDottable[i].linearDamping = 0 – Set linearDamping to 1.5 (slows object linear velocity)
end
end
end
bluePdot:addEventListener(“touch”, oD)
end
bluePdot = 0
function oD(event)
if evet == bluePdot then – if player touches bluedot then
bluePdot = bluePdot + 1 – add 1 bluedot
if bluePdot == 10 then
slow = true
bluePdot = 0
print (“oD on”)
end
else
slowmode = false
bluePdot = 0
print(“oD off”)
end
end
oD(true)
function slow_pop(event)
if(event.phase == “ended”) then
audio.play(pop)
print( “slowmoation click”)
end
end
buttonSlowMo:addEventListener(“touch”, nGravity)
buttonSlowMo:addEventListener(“touch”, slow_pop)
buttonSlowMo:addEventListener(“tap”, slowMode)
end
timer.performWithDelay(100, spawnDots, 1)
[import]uid: 121743 topic_id: 23957 reply_id: 96933[/import]