Create Objects for every TiledBG is used?

Get help using Construct 2

Post » Tue Feb 14, 2012 10:37 am

I use tiled background objects for my plattformer to walk on. The idea is to create rounded stones on the sides of the tiledbackground(blue) to make it look more natural. I have done it by hand for now, but I guess the best solution is to create them by the system. The problem is, that it only works for one tiledbackground.

The code I used is simple:

on start of layout:

System create object "sprite_left" on layer 0 at (TiledBackground.X,TildedBackground.Y)

System create object "sprite_right" on layer 0 at (TiledBackground.X+TiledBackground.Width,TildedBackground.Y)

Here is my capx:
CAPX

I guess there must be something like:
On start of the layout:

System create object <?for every tiled Background?>:

System create object "sprite_left" on layer 0 at (TiledBackground.X,TildedBackground.Y)

System create object "sprite_right" on layer 0 at (TiledBackground.X+TiledBackground.Width,TildedBackground.Y)TastyBytes2012-02-14 10:38:48
B
14
S
2
G
6
Posts: 110
Reputation: 3,849

Post » Tue Feb 14, 2012 10:53 am

it's very common in other game makers, they call it as tileset, where you'll have the corners, middle, bottom and top with different contents, when you paint the scenario with the selected tile, it'll detect the corners, the sides, the middle and will fill them with the right image.

I think C2 is good with his simple system, because doing the tiled system of RPG Maker don't give you the freedom to create the scenario in Coreldraw and import it, for example.

I prefer to manipulate mosaics outside the Game Maker software because revisions show be ease than edit them inside. But it's a personal preference.

But, C2 really need improvements around the layers and Z ordering, or Our job will become hard to maintain, for example is when you edit a middle ground on a finished scenario, you can't select it if you place grass over it, so, in complex scenarios, select a smaller thing between 3 or 4 objects can hurt your mind.
ImageImageImageImageImageImage
B
93
S
19
G
12
Posts: 1,192
Reputation: 18,301

Post » Tue Feb 14, 2012 11:25 am

@TastyBytes You guessed correctly, just add the for each as a sub event to on start of layout.
So:
Start of layout
-for each tiled bg, create left, right sprite.
Image Image
B
161
S
48
G
90
Posts: 7,347
Reputation: 66,749

Post » Tue Feb 14, 2012 1:00 pm

newt: Really such easy?

I have to try! Thank you!
B
14
S
2
G
6
Posts: 110
Reputation: 3,849

Post » Tue Feb 14, 2012 1:01 pm

tested: Works fine!
Thanks again!
B
14
S
2
G
6
Posts: 110
Reputation: 3,849


Return to How do I....?

Who is online

Users browsing this forum: Bad Wolf, davides, NRABrazil, Vallar, Walessio and 29 guests