package com.droidquest.items; import com.droidquest.Room; import com.droidquest.decorations.Arrow; import com.droidquest.materials.ElevatorOutPortal; import com.droidquest.materials.Switch; public class ElevatorSwitch extends Switch { int animationState=0; // 0=open // 1=closing // 2=closing // 3=switch arrow, switch outRoom // 4=opening // 5=opening transient static Room room; public ElevatorSwitch() { super(Switch.ROT_LEFT); } public void TouchedByItem(Item item) { room = item.room; if (animationState==0) animationState = 1; } public void Animate() { super.Animate(); switch (animationState) { case 0: value =false; break; case 1: // Play sound value=true; room.SetMaterial(0,7,4); room.SetMaterial(0,10,4); animationState++; break; case 2: room.SetMaterial(0,8,4); room.SetMaterial(0,9,4); animationState++; break; case 3: if (ElevatorOutPortal.outRoom == (Room) level.rooms.elementAt(11)) { for (int a=0; a