Tilemap object changing in-game?

Get help using Construct 2

Post » Wed Feb 26, 2014 11:54 pm

I have Tilemap object working in-game no problem.
Love it's functions.
BUT...
Is it possible to have the tilemap object change the sprite it uses while keeping all the tiles positions/types the same?

At the moment it is an alien planet, but I'd like it that sometimes when player spawns its a desert wasteland... but the tiles positions are the same.
Hope I'm making sense.

If it cannot be done, is there any suggestions for changing the tilemaps image that doesn't include webgl effects?

Thanks,
B
22
S
7
G
2
Posts: 188
Reputation: 3,575

Post » Thu Feb 27, 2014 12:14 am

You can't change Tilemap image on runtime.
What you can do is to make few Tilemaps with different textures and just swap them - they should be exactly the same but with different look/style.
For example if Tilemap1 have tiles:
0 - alien sand
1- alien grass
2- alien rock
then Tilemap2 must have:
0 - desert sand
1 - desert grass
2 - desert rock
So if you swap them they will have same id's on screen but with different image.

Other thing you could do is to make one tilemap with all graphics. Let say tiles id 0 - 16 would be alien planet, and tiles id 20-36 - desert.
Then if you will need to swat texture you need only add 20 to every tile id.
ImageImageImageImage
B
157
S
66
G
42
Posts: 2,603
Reputation: 35,343


Return to How do I....?

Who is online

Users browsing this forum: BreadCrowns and 17 guests