How do I create curved surfaces using tiles or textures?

Get help using Construct 2

Post » Sun Mar 13, 2016 9:00 pm

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

Hill Climb
Image

Bug Climbing
Image
B
3
Posts: 1
Reputation: 177

Post » Sun Mar 13, 2016 11:19 pm

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.
Image ImageImage
B
168
S
50
G
163
Posts: 8,221
Reputation: 105,061

Post » Mon Mar 14, 2016 1:16 am

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.
viewtopic.php?f=183&t=166708&p=1006165&hilit=trail#p1006165

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.
viewtopic.php?f=147&t=167397&p=1008607&hilit=curve#p1008607


On a side note the ground tile can be added by using a blend mode.


Here's a more specific example:
https://dl.dropboxusercontent.com/u/542 ... climb.capx

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.
B
91
S
31
G
103
Posts: 5,234
Reputation: 67,754


Return to How do I....?

Who is online

Users browsing this forum: Exabot [Bot], Yahoo [Bot] and 5 guests