• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
  • Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code [Solved]Is this possible with tiles?

Gamer-15

Member
Hi,

I have a block which consist of an inner fill sprite and an outer glow sprite:
2.png
3.png
The image below uses sprites:
1.png
Now I am trying to optimise the speed by using tiles instead of sprites. For the inner fill sprite I have this already set up.
But for the outer glow sprite I have difficulties getting it working, because the sprite boxes of the glow overlap:
4.png
Is it possible to use tiles for the outer glow?
 

Slyddar

Member
You might be best off just adding the glow section as separate tiles. You won't be able to do autotile with the glow, but if you made it as a separate tileset you could autotile the main and just manually insert the glow tiles afterwards.
 

kburkhart84

Firehammer Games
In GMS1 you could overlap tiles just fine, but with GMS2 tiles can't overlap on the same grid like that. GMS2 has what it calls "assets" which are something between objects and tiles. They use animated sprites and can be placed around your rooms similar to the way tiles used to be in GMS1, but they can be animated too. They don't have any overhead like objects do though. Maybe you could do your glow lines with that?!
 

Gamer-15

Member
Thanks for the replies.
I found a solution for the overlapping glowing tiles. I made the glow sprites 2 times the size of the inner fill bock size (by just adding extra transparent pixels around the glow sprites). Then I made the tile set from the sprites. Then I used 4 tilemaps for the glowing tile set to cover all cells of the inner fill grid: 1 set for x=odd y=odd, 1 for x=even y=odd, 1 for x=odd y=even and 1 for x=even y=even. The tilemaps are set with an offset for the origin of the glow sprite that I used + the inner fill size if x,y is odd. Then when creating the blocks the code check with (x mod 2 == 0) and (y mod 2 == 0) to determine which tilemap to set.
 
Top