You must collect all the treasures; the yellow lines are doors, the red are walls. The joystick moves your ghost; hold down the button to stop and aim a gun, then release the button to fire the gun. In addition, certain keys on the keyboard turn you into different tools to help you solve puzzles...I don't remember them all, but I think "H" turns you into a hammer. Just try all the letter keys to find out which tools are available.
Maneuver carefully, time things properly, solve the puzzles, and it IS a really fun game!