Trap with a moving spiked part

I want to create a pitfall trap that has a rust-coloured, spiked mechanism that moves up and down. What is the best way to create it?

I would just add two animations for the spikes, with the same image, and use a timer to switch them from going up and down. You can do the “How do I…” add moving platform tutorial to learn about this mechanics.