How do I combine multiple sprites to 1

Get help using Construct 2

Post » Sun Oct 30, 2016 10:04 am

Hello!
I am working on a MOBA now and just added bushes or gras where you can hide.
Those grasses are made off like 5 grass tiles, but is there a way I can combine them together? Like tag all 5 and select something like "combine" ? (As in Gimp2 or PS)

It would save me some memory I guess since the object is still the same as the single ones. But when I enter a bush now, only the parts I collision with are changes to opacity 25 (so I have vision in the bush) for me. After that all the bush tiles are visible as long as I am in the complete bush-part. When I leave the bush, all the bush tiles are back to opacity 100.

When I could combine those tiles, it would be possible for them to behave as they are 1 bush all together, rather than 5 different.

Since I want some more bushes with different sizes in my game, I had to do way more coding + sprites for each bush <.<

P.S. The game is splitscreen and the bushes behave different for both players. So when player 1 enters a bush, the bush is still at opacity 100 for player 2, just for make some clarity. I also want to add a online multiplayer with photon later so don't complain on how useless bushes are in 1vs1 splitscreen xD
B
13
S
2
Posts: 80
Reputation: 821

Post » Sun Oct 30, 2016 10:42 am

You'll want to use containers for this I think. Put all grass tiles into a container object. Pick one grass tile, all tiles in the bush are picked. Destroy one grass tile, all tiles in the bush are destroyed. Set the opacity of one tile, all tiles in the bush change opacity. Not sure why you don't just have one bush object though, seems like it would be easier. If you have to make the bush from 5 grass tiles then containers are the way.
B
47
S
18
G
84
Posts: 2,271
Reputation: 49,796

Post » Sun Oct 30, 2016 11:33 am

Hm thanks, I guess I just make bush objects for every bush with all the tiles in it already.
With the grass tiles I would only have 1 sprite but could make bushes in many different sizes out of it, that's why I wanted to combine them.

P.S. I found a solution. (Somehow like yours but no containers) I just made invisible bush hitboxes and whenever a player is overlapping it, it will set all the bushes overlapping this hitbox to opacity 25.
B
13
S
2
Posts: 80
Reputation: 821


Return to How do I....?

Who is online

Users browsing this forum: RIDETHEPIG and 9 guests