Advice on implementing a driving portion

I'm interested in making a section of my game a sidescrolling dodging style level. Not sure how to describe it but basically like this section in Battletoads.


Any thoughts on implementing this? I'm thinking a track having events come at the player, but not sure how to restrict movement or keep the player moving forward.

Original thread: https://forums.rpgmakerweb.com/threads/advice-on-implementing-a-driving-portion.108108/