Smooth movement along curvy objects (as in alto's adventure)

How to make a smooth transition as in alto’s adventure?

Changing the velocity or gravity doesn’t give me smooth transition.How to do that?

Any help or hint is greatly appreciated and welcomed…

Thanks…

Please some one give me a prototype or hint…I don’t even have an idea on how it works…

I’m not sure I understand the question. The images don’t really convey your issue. Maybe you could share some code that you’re using, perhaps a screen recording of the simulator showing your issue or zip up your project, put it on DropBox or similar and share a link here so the community can see what you’re seeing.

Rob

I have played that game. Although I agree with Rob and don’t understand the question. The game has elements that are very similar to this free template:

https://marketplace.coronalabs.com/app-templates/endless-sk8boarder

Thanks to all.I have trouble in communication. :unsure:  :unsure:

             

            

               

              My doubts is “How to move an object in a circular or elliptical path”.

             The blue boxes should move along the curves as shown in the image. 

             Using the same logic,i wanna create an endless runner…

How to make the endless sk8boarder with curve terrains?

@decoder143 Are you using physics or display transitions?

@sporkfin

            I am using physics now.But physics movement is not smooth and i don’t know how to move the object along the curve-path…

                           Thanks

@decoder143 physics won’t be perfectly smooth but it will do the job. I think you use them not totally correctly.

If you want to follow a curve you can do it with transition. https://docs.coronalabs.com/api/library/easing/index.html with two transitiond one for x and one for y.

If it’s not enough for you, you can do with enterframe and set at each frame the new x and y according to your function or curve

almost all of this class of game (alto’s adventure, hill climb racing, tiny wings, et al, ad nauseum) merely *approximate* curves with straight line geometry.   (i’ve yet to see one that makes me think they’re actually solving nonlinear differential equations in realtime)   if the subdivision is fine enough a player won’t notice the difference.

I haven’t tried Alto’s Adventure but If you use physics chain bodies for the landscape and circular physics bodies for the character - that should work.  The vertices for the chain bodies will have to be close together, but you can mimic a true circle that way.  I have solved a similar issue this way.

However, you will need to keep a constant force on the character to keep it from bouncing off the landscape when it hits bumps.  Density or gravity scale adjustments might help.

This is an interesting question and I can’t wait to see what you figured out, since I’m also quite new to this. After reading it I see that there are plenty of questions of box2d (the physics engine corona uses) and curved surfaces. Here’s some interesting one’s I’ve found…

http://www.box2d.org/forum/viewtopic.php?t=8180 - Circular collisions on curved surfaces

https://gamedev.stackexchange.com/questions/70669/how-do-i-make-a-curved-surface-out-of-rectangular-blocks

just google box2d and curved and you’ll find loads of question - unfortunately in lots of languages but hey box2d is box2d :wink:

Another useful tool I found: https://github.com/jkbmat/Bakalarska-praca an online box2d scene editor to test out physics. Very cool.

My theory is your player object would have to be a circle body and the “land” would be some sort of chain body like sporkfin says. Remember the physics body does not have to look like your actual sprite character - you could use the hidden body’s x and y to place your sprite and make sure your rotation is correct as per the land.

I did a little digging and it seems that corona used to have a little sample called tiny penguin which explained this exact thing. It’s gone from their github now but someone made a fork: https://github.com/chrisid/TinyPenguin

Wow it still runs. I mean it has some errors and warnings but it runs on the simulator just fine.

It uses rectangles to cap the landscape but you could get the same effect with a physics chain body.  The penguin’s rotation is controlled by simply setting the rotaion (instead of calling an angular impulse) - the physics body follows without decoupling from the “display” engine. 

I wonder if that only works for circular physics bodies?  I’ll have to investigate.

I remember reading a long time ago (when playing around with xna) that it was a good way to stop the usual getting stuck on platforms thing that happens with rectangular bodies. I think it was this article https://boxycraft.wordpress.com/2009/06/30/behind-boxboy/ or something similar.

Agreed! I try to base all of my physics bodies off of circles when possible, especially the small ones.  While Physics Editor works great with medium and large physics bodies, smaller physics bodies can be problematic (the calculations get thrown off because there just aren’t enough pixels).  One solution to this is to make everything extra large and then scale down the entire display group.  Other than that, go with circles - in unpredictable interactions, they are less likely to crash the physics engine.

Please some one give me a prototype or hint…I don’t even have an idea on how it works…

I’m not sure I understand the question. The images don’t really convey your issue. Maybe you could share some code that you’re using, perhaps a screen recording of the simulator showing your issue or zip up your project, put it on DropBox or similar and share a link here so the community can see what you’re seeing.

Rob

I have played that game. Although I agree with Rob and don’t understand the question. The game has elements that are very similar to this free template:

https://marketplace.coronalabs.com/app-templates/endless-sk8boarder