Change color(s) of blocks used in random blocks?

Get help using Construct 2

Post » Thu May 04, 2017 11:06 pm

Hey!

Me again. Thanks for all the help so far! I think my game is coming along quite nicely!

I have a new question:

Is it possible to make the custom blocks in the Endless Runner template be built from different color blocks? As you can see, right now all my blocks are green.

Image

Is there a way for the big blocks to be built out of a random array of colored blocks? Some blue, some yellow, some green, etc?

Thanks! <3
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Thu May 04, 2017 11:19 pm

Use Tilemaps. Not a TiledBackground.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu May 04, 2017 11:26 pm

99Instances2Go wrote:Use Tilemaps. Not a TiledBackground.


Thank you so much!

If I understand that correctly, I would "build" (in my graphics editor) a big Tilemap with all of my colored blocks already distributed, and then it would just build using that instead of the single block, right?

If that's the case, what changes, if any, do I need to make to the event that generates the blocks?

Image

This is my event as it stands right now.
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Fri May 05, 2017 1:02 am

@marcoscodas Do you want all the tiles to be unique, or just each platform of tiles to be a different color?
B
21
S
3
Posts: 53
Reputation: 1,100

Post » Fri May 05, 2017 1:42 am

Message: marcoscodas can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
angryscientist wrote:@marcoscodas Do you want all the tiles to be unique, or just each platform of tiles to be a different color?


First off, cool handle @angryscientist !

Secondly, I'm attaching a new screenshot to showcase what I mean:

Image
https://imgbb.com/ upload picture

Is it possible?
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Fri May 05, 2017 12:36 pm

Close to this.

Image

But you will have a nested loop voor horizontal and vertical.

Where horizontal iterates from zero to tilemap.widht / size of the tile
and vertical iterates from zero to tilemap.height / size of the tile

Each tile in your graphics has a zero based index. Should read manual for Tilemaps.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri May 05, 2017 3:41 pm

@marcoscodas I think @99Instances2Go has what you need. Also, glad you liked my handle. :p
B
21
S
3
Posts: 53
Reputation: 1,100

Post » Fri May 05, 2017 4:01 pm

Thank you @99Instances2Go! I'll give it a read and see what I can come up with. Much appreciated.

@angryscientist, thank you!
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Sat May 06, 2017 12:52 am

Message: marcoscodas can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
For some reason I can't post my reply, so here's the pastebin of it. Please help @99Instances2Go or @angryscientist ?

https://pastebin.com/KNnRVui3
B
15
S
5
Posts: 78
Reputation: 1,173

Post » Sun May 07, 2017 10:25 pm

https://www.dropbox.com/s/34xkvb8mfjazo ... .capx?dl=0

Stay out of trouble with this 1 little rule: Do not destroy&recreate when not absolutely necessarily.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Next

Return to How do I....?

Who is online

Users browsing this forum: brunopalermo and 6 guests