The player takes control of either Ruff or Tumble, a brother and sister who are sleeping and trying to free 40 "Winks" from a man named Nitekap and his accomplice, Threadbear. In the game's plot, "Winks" are small, white creatures which make dreams, and "Hoodwinks", which are green and of a similar size are what are responsible for nightmares.
Throughout the game, the player can collect moon-shaped tokens, which are used to scream at dreamy apparitions, and Z-shaped tokens, which stop the player's character from waking up. Floating cogs are also collected to open doors. The character travels through dream worlds, such as haunted houses, ship wrecks, planets and prehistoric lands. The player can also transform into various types of beings.
Source: Wikipedia, "40 Winks," available under the CC-BY-SA License.