Doors and Room Transitions

While developing the lost woods I realise my old method of making doors is completely useless and far too time-consuming. So I set out to develop a new type.

While I was at home, thinking about this I thought about how my wolfs even though they are all the same object, don't have the same hp. I thought to myself "they must be their own instances". So I was looking for a way to change the code in the individual instance. So I did what anyone else would do, go to the forms and in my searching, I found this. Link to the post



This code uses the creation code to set a room, and an X and Y location that room. Then once the player collides with the individual door instance it gets the "target room, X and Y". Once it does this you can send the player (as long as the object is persistent) to a new room. These mean you only have to make one room and just add 3 lines of code to the individual door. This was far more efficient.

Did change the cold a little to make it more efficient.  I took out the if statement as I saw no need for it. and I didn't use the step event I just used the collision event.



This is a far better method compared to my old one. Here's the link.




Comments