Transparent Roof When Hero Under(RPG Style)

C

CJ K

Guest
This is a semi-repost. I was going to use a tileset collision in my game for this, but realized that its only the newest version of gamemaker, which I do not have.

My goal is to have the roof of my house disappear when my hero walks underneath. So lets say that I have Hero_1 and Roof_1. Should I make Roof_1 an object that disappears when Hero_1 collides? This method seems like it would be laggy since all the roofs would be separate objects? Also added to this I would like it to be a slight fade when the roof disappears, not an abrupt on\off feel

I'm looking for the best options that wont take up too much space as this will be an "open world" rpg style game. Any tips, code and hints are greatly appreciated.

Cheers :)
 
B

Bayesian

Guest
This method seems like it would be laggy since all the roofs would be separate objects?
You would give all your roof objects the same parent object and make changes to the parent so it affects all it's children
 

NightFrost

Member
Create a trigger object, give it a 1x1 sprite with semi-transparent color and scale it up in the room editor to cover the area where you want the roof fade to work. The trigger object polls for player collision and when necessary sets to fade out/in the attached roof. As how to link relevant roof parts to a trigger: you could throw each roof piece in as an object and have it figure which trigger it belongs to by checking a collision with a trigger object in their create; you could have unique trigger objects for each roof and manually write sprite draws for each to set the visuals in place; you could make each roof their own tile layer and have unique trigger object for each, controlling that layer's fade logic. Turn visibility off on the trigger objects once you have them working correctly.
 
Top