Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(1 edit)

That's just that like you said: took the building, cloned it then filled solid color then deformed. Only one new thing was: setting Restriction X = 4 so we have a series of windows, not a single big one.

 I will try to explain the deform formula

We know that the windows shape is empty in center so we want to "pull" all the vertex toward the center to fill the emptiness. Pull via x axis or y axis is enough. Here we choose the x axis. The generic formula to pull x value of vertex  to  center is:

deltaX = -A * sin(B * x ) ( x is normalized from -0.5 to 0.5)

sin(x) is symmetric crossing 0 and the amplitude -A is negative so if x > 0 then deltaX < 0 and if x < 0 then deltaX > 0 . It means in all cases vertex are pulled toward the center. Then I was going to  try several combination of A and B to obtain the desired result - completely filled the emptiness.

It turned out A = 0.3 and B = 4 work. It's just that, nothing magic here, just the basic of sin/cosine function.

And yes if you want to customize one shape properties based on another shape properties, you must use script but we don't need to access game state in this case, just shape properties are enough.