Hi community ^^
I'm trying to make door which can be unlocked by using a switch. Each door and switch has a color.
I want to create a géneric collider. When the player collide with it, it open the good color door.
I Know how to attribute variable to this object. But I don't know how to do this variable affect the doors.
Could you help me please. :]
Thanks for your advices
Not sure if I understood you correctly.
So when player collides with red switch, you want to open the red door? On collision with blue switch, open blue door and so on?
Add "Color" instance variable to both Switch and Door sprites. Set correct Color for each switch and door ("red", "blue", "green" etc.)
Your code could look something like this:
Player on collision with Switch
Door compare instance variable Color=Switch.Color -> Door set isOpen=1
Door set animation to "Open"
You understood what I meant. Sorry for my poor english. ^^
I will try it asap.
Develop games in your browser. Powerful, performant & highly capable.
It works and it's very powerful. Thanks a lot Dop2000
Finally, I used your method for my "help boxes".
When the player collide with a generic box, the correct message is visible.