A team of researchers are using a video game to study the affect sleep apnea has on a person’s memory.

Doctors at New York University had volunteers play a maze game before they went to sleep and again when they woke up, MyFoxNY.com reported.

The participants who suffered from sleep apnea, which interferes with the REM stage of sleep, had a difficult time completing the task the next morning.

“They would make the wrong turn, make a left when they were supposed to turn right, or sometimes go in circles,” Dr. Andrew Varga, study author and lead researcher at the NYU Sleep Disorders Center told MyFoxNY.com.

“When sleep is normal, people ordinarily get a lot better to the tune of about 30 percent in terms of completion times,” Varga said, “but when you have sleep apnea during REM sleep which interestingly accounted for only about 10 to 15 percent of total sleep time, that improvement that ordinarily occurs overnight was completely lost.”

The researchers say that the impact sleep apnea has on spatial memory can affect everyday life, like causing a person to forget where a car is parked, or where keys are located.

Sleep apnea is a common disorder that causes breathing to stop or become shallow for a few seconds or minutes. The breathing pauses can occur 30 times or more an hour, according to the National Institutes of Health.

Researchers are calling for more tests to determine what mechanisms are causing sleep apnea to affect a person’s memory.

Click for more from MyFoxNY.com.