Random Texture Placement?

New releases and general discussions.

Post » Tue Dec 25, 2007 3:22 am

I'm trying to do something similar to some basic random terrain, and I'm having a difficult time. I have a dirt texture covering the whole layout, and am trying to randomly place a tiling rock texture, then randomly SHAPE it, I can rotate and resize it, but I can't give it a unique shape for the life of me. I was thinking maybe through creative use of a variety of mask objects chosen at runtime?

EDIT: On this note - do we have an IRC room somewhere yet, so I can ask dumb questions there?
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Tue Dec 25, 2007 1:19 pm

Thats not a dumb question ;)

I'm not sure if we can mask objects with other objects in Construct, I know you can't in MMF2. So if you can in construct, i'll be very happy.

I'm afraid I can't help, I look forward to someone who knows to answer this :) I'd be interested in the solution.
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Wed Dec 26, 2007 9:29 pm

That's an interesting idea actually...

I can't really think of any simple way of doing it the way you want using Construct.

I'm not sure how well masking would work the way you want... There is also the collisions issue to deal with... (actually, is overhead or side scrolling?)



As far as an IRC channel... All it would take is for someone to make a room for construct somewhere on freenode or rizon or wherever... Of course, it would be nice if Ashley approves and such...
B
4
S
1
G
5
Posts: 65
Reputation: 1,932

Post » Wed Dec 26, 2007 10:11 pm

I'm not sure what you're trying to do exactly... but masking may help. If you create a separate layer and place a tiled background, some Sprites with a Mask effect, and set the layer opacity to 99% (a hack for another feature I need to implement) - then the Sprites will cut shapes out of the tiled background. Does this help what you want to do?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Thu Dec 27, 2007 4:18 pm

Ashley i cant get that to work. That sounds awesome though, thats exactly what i need for a project.

Can you make it so that masks only affect certain layers? You should attach masks to layers or something. So that way we could mask things on the upper layers without it affecting the below ones.
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Thu Dec 27, 2007 6:01 pm

Here's an example:
http://www.scirra.com/files/masking.cap ( made in 0.88 )

Sorry, turns out you have to use the 'Erase' effect :P but that file demonstrates how it works. Note the 'Masking' layer has an opacity of 99%, this is a workaround to a missing "Use own texture" option for layers that I'm going to add for 0.89.

The sprite with the erase effect cuts a hole in the layer and shows whatever is underneath. That is what I was describing, is it helpful at all?
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610

Post » Thu Dec 27, 2007 6:34 pm

Yes that is kind of the idea I was going for. The shapes of the individual masks I guess can be rotated/chosen/scaled randomly based on position in the world I guess.
B
5
S
2
G
5
Posts: 221
Reputation: 2,272

Post » Thu Dec 27, 2007 10:20 pm

Is this the best way to make a circular minimap? Because im gonna need one ;)
B
2
S
2
G
5
Posts: 448
Reputation: 2,546

Post » Thu Dec 27, 2007 10:51 pm

Yeah, you could use an Erase effect on a layer, or just put another sprite on top of it :)
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,610


Return to Construct Classic Discussion

Who is online

Users browsing this forum: No registered users and 7 guests