Hello friends, I would like to know that how can I create curved surfaces with grounds using tiles or textures similar to Hill Climb or Bug Climbing Games and also I want to know that how to set positions of character and coins along with curved surfaces, therefore, it is my humble request please tell me which expression or behavior should I use to create curved surfaces with grounds, I will be eternally grateful to any kind friend who could give/suggest me any examples or tutorials, please see/check the examples of game images for more information, so you can figure it out what I am trying to create. Thank You
Develop games in your browser. Powerful, performant & highly capable.
We don't have access to deformations in webgl yet so the only way now would be with the paster object, and a smooth curve would still be hard to pull off.
Then while the collision aspect would be easier to pull off, it's still a fairly involved task.
I should add that it's possible to do something similar in tilemaps, but the texture would have to be very simple.
There are two parts to that, visual and collisions.
For the visual you can either pre-draw the terrain or use the paster object to draw a bunch of quads to distort an image. Here's an example that distorts a image, so maybe it could be useful. The math may not be useful in your case but the gist of it is just have a bunch of quads next to each other with the corners moved to distort things. If you've done uv texturing in 3d software, the idea can be used here and the more quads you use the smoother it will be.
The collision portion is the next problem. Here's one that takes a vector image export and creates a bunch of lines to use as the terrain. Another option is to use the points of the quads from the visual portion and use them instead to place the collision lines.
On a side note the ground tile can be added by using a blend mode.
Here's a more specific example:
https://www.dropbox.com/s/mzfhqnp4u4isy ... .capx?dl=1
It creates the hills using sprites used as lines. I wasn't super creative so I made the shape of the hills the combination of two sine waves. Look at the set y action in event 2.
It also fills in the area below those sprites so it's a filled area. The tiled background is then pasted with the source in blend to texture that area.
The final step is to loop over the line sprites again draw a textured quad on the surface for each one.
It works, and shows a simple case, but it would need more work to do scrolling and such.
Hey R0J0hound Can you please update the capx link. Thanks