Hi, well this is my first thread in the forum, I’ve been programming in CoronaSDK some time, but I ran into this problem and did not find much specific information, so I ask for your help.
I’ve been putting together a prototype for a mini game, using an environment similar to “Mario Bros” with horizontal and vertical platforms, but I have trouble joining the platform with the character, who first detected the colicion with the platform, but I can not do the joint.
I leave a video to see what the problem and performance.
thanks for the reply, but apparently the code, is aimed at another problem, the static objects crossing in fact is similar to another use.
I’m still looking for the solution.
I managed to follow the trajectory of the platform, but to jump on it, the character “sticks” in the center of the platform, and that is way too forced by code.
As far as I could see, you are using transitions to move the platforms, right? If so then that’s the cause of the problem. Try using physics instead. Make them kinematic and move them using:
Thanks for the reply. As the saying goes “The simplest explanation and efficient, usually is the right thing”.
I used “transition.to” because it could generate a “cycle” between two functions, but the solution with timer looks like this … and increasing the friction of the platform.
physics.addBody( plataformaRoja,"kinematic",plataformBody )
local function SwRojoAction()
local function SwRojoActionSecundaria()
function waitToMove(event)
plataformaRoja:setLinearVelocity(0, 0)
timer.performWithDelay(1000,SwRojoAction)
end
plataformaRoja:setLinearVelocity(80, 0)
timer.performWithDelay(2000,waitToMove)
end
function waitToMove(event)
plataformaRoja:setLinearVelocity(0, 0)
timer.performWithDelay(1000,SwRojoActionSecundaria)
end
plataformaRoja:setLinearVelocity(-80, 0)
timer.performWithDelay(2000,waitToMove)
end
I have a small difference in distance, but it is probably due to the size of the platform. Well thanks for your help.