Reputation: 1882
It may be a repetitive uestion but I could not find any specific answer to my query
How to create A slanted/curved ground in a 2d runner game. The user will see side view like the old game "Mario"
If I use tiled based map I can have only rectangular objects.
What is the best way to create tilted ground? Should I use tiled based map, or should I define corner points in the map and create the ground programatically?
And what are the difficulties in creating curved ground.
And what can be the possible logic while creating game "Flying Pengui" https://play.google.com/store/apps/details?id=com.topfreegames.penguinfree&feature=related_apps#?t=W251bGwsMSwyLDEwOSwiY29tLnRvcGZyZWVnYW1lcy5wZW5ndWluZnJlZSJd
Upvotes: 1
Views: 338
Reputation: 4411
Should I use tiled based map, or should I define corner points in the map and create the ground programatically?
The latter approach is much better. A linear interpolation between corner points will give you the height of the ground at any position. You just need to fill what's below with your tiles.
And what are the difficulties in creating curved ground.
It should be easy. All you have to do is replacing the linear interpolation with a higher order one. This link contains implementation of various spline functions with which you can make a curvy ground.
And what can be the possible logic while creating game "Flying Pengui"
I see a sin-wave like ground and splines will do the trick. Also, to avoid corner points you can build a repeated quadratic function that matches the shape that you want.
Upvotes: 1