10 years ago by Asim
I'm wondering how a push-button entity could be designed using Impact. A push-button that opens a door when the player walks over it. And closes the door after X seconds after he walks off of it.
The solution I've been able to think of is:
1. Place a trigger entity (Platform) on top of the platform tile. Link it to Door entity and two PlatformOff entites (described below).
2. Place two trigger entities (PlatformOff) 1 tile away from Platform on either side. Set these triggers as disabled. Link it to the Platform and Door entities.
3. When the Platform entity is triggered, it is itself disabled and the PlatformOff entities are enabled.
4. When the PlatformOff entities are triggered, they are themselves disabled and the Platform entity is re-enabled.
5. When the Door entity is triggered by Platform, it opens. When it is triggered by PlatformOff, it closes after X seconds.
The problem with this solution is that it is plain ugly. I'll have to place 3 entites and link them together for every push-button I need to create. Is there a more elegant solution, preferably using a single entity?
The solution I've been able to think of is:
1. Place a trigger entity (Platform) on top of the platform tile. Link it to Door entity and two PlatformOff entites (described below).
2. Place two trigger entities (PlatformOff) 1 tile away from Platform on either side. Set these triggers as disabled. Link it to the Platform and Door entities.
3. When the Platform entity is triggered, it is itself disabled and the PlatformOff entities are enabled.
4. When the PlatformOff entities are triggered, they are themselves disabled and the Platform entity is re-enabled.
5. When the Door entity is triggered by Platform, it opens. When it is triggered by PlatformOff, it closes after X seconds.
The problem with this solution is that it is plain ugly. I'll have to place 3 entites and link them together for every push-button I need to create. Is there a more elegant solution, preferably using a single entity?