Question about In-game mini-game

Hello everyone!
I want to make mini-game (Maze-like) inside my game.
Can you tell me please some advices/concepts/principles how I can do it?
Question is not about “generate maze”. It’s about tracking collisions with wall.
So the player should move mouse cursor from start to end through maze and not just ignoring walls.
I can’t find out working way for my idea.