I have many doors in my game, each door is opened and closed by a 'power cell', when the player hits the cell, (for the sake of animation) every 0.2 seconds I add one to a 'power cell charge' variable, when the charge reaches 7 I set a 'charged' bool to true.
At this point, the door opens along with some lights surrounding it.
To open the door I give every effected sprite a 'cellNumber' variable and I say:
When PowerCell is 'charge'
When PowerCell "PowerCellNumber" is 1
When Door "PowerCellNumber" is 1
When lights "PowerCellNumber" is 1
Open door & turn on lights.
I've got tens of doors in my levels, there's got to be a more simple way of doing this but I've wrestled with it for hours. This current system doesn't even work particularly well.
Can anyone help me out?