The final obstacle we’ll implement will be a spike trap. It will teach you a new concept and give you more practice with the concepts we learned in previous chapters, like Lerping over time, working with state, and Invoking methods to time transitions in the state.
Our spike trap will be a thin, square “plate” laid out on the floor which has lots of little “spikes” sticking out of it. For simplicity’s sake, we’ll make the whole thing out of cubes. When the trap activates, the spikes quickly raise, poking up out of the plate. They’ll remain raised for a moment and then slowly lower ...