I had been trying to figure out a way to hide certain parts of the environment from the player and only reveal it when he gets close, like so:
This all ties into the players ghost form, but so far, not sure how I am going to implement it as a main mechanic. So bear with me…
I had never used surfaces before in GameMaker, even after using it for a couple of years. I should have learnt about it much sooner, but I didn’t. So I started searching and came across this link:
http://www.davetech.co.uk/gamemakermasking
Now, this was pretty much what I wanted to achieve. The only problem I had was it only works by placing an image on top of another image or background.
So in my GIF, this is pretty much the same implementation, except I’m not using any fancy shapes or using the mouse. I am also not drawing the surface across the whole room and only on the section I want to be hidden.
My only problem I have now, is this will only work on this kind of level setup and not anywhere else. Reason being, I basically drew a rectangle over the tiles that was the same colour as the background.
What I want to achieve is going to be more complex. I need to figure out a way to store a portion of that background and put it on a layer infront of the tiles I want to hide without covering anything else.
2 comments