Door Object, open and walk through?

W

Warren Long

Guest
Hi All,

I have a door object, I've set it's parent to my obj_solid so the player can not walk through it when closed.

What I'm trying to attempt is when the player object collides with it, the door animation plays (door opens) and then the player can walk through it..

I imagined and attempted this with a collision event and have image_speed set for the door.... did not work.
I then imagined that I would need a line of code that removes the collision so he can walk through (i use place_meeting and while !place-meeting for my collision with obj_solid).

Can someone pass me a bit of advise to get me going please.

Many Thanks

Warren
 

Jakylgamer

Member
you can change the mask_index of the door to a sprite that has no bounding box or just create a non solid door at its position and then destroy the solid one.
 

RangerX

Member
Also, depending how you did code your collision, you could allow the player to pass when it collides by checking a variable of your own that would track the state of your door. (open/close)
 
W

Warren Long

Guest
hmm the object_delete code is obsolete according to manual.

How would I delete a object and replace with another?
 
hmm the object_delete code is obsolete according to manual.

How would I delete a object and replace with another?
For future reference, you'll want to learn the difference between and Object and an Instance. An Object is more like a template. It has no actual existence in the scope of your game. What you do end up using in your game are Instances of those Objects. They are what you're thinking of in the scope of your question. If you come to understand this difference, it will help you in the future to be able to better direct yourself, as it seems you tried to do when you discovered the obsolete 'object_delete'. Good luck!
 
W

Warren Long

Guest
I understand the diffrence between a object and instance.

Did I come across as if I did not?

Apologies if I d.
 
Top