Researchers have used a video game projected into a fish tank to study the behavior of bluegill sunfish.
The simple “game” featured red dots which moved and swarmed in different ways against a translucent screen.
They found that the fish were less likely to try to attack the dots when they moved in a group formation.
The research has been published in the journal, Science.
Senior researcher Dr Iain Couzin is from the Department of Ecology and Evolutionary Biology at Princeton University.
“By creating an immersive video game for the fish we were able to have complete control over the parameters,” he told BBC News.
“Trying to do this experiment with natural grouping prey items, it would have been impossible to understand or control what was going on.”
The size and colour of the simple prey graphics were carefully designed, he said.
“An undergraduate student worked the entire summer on the exact type of dot to use. We tested out a whole range of different types of dots.
“We knew they liked to target slightly red objects, we knew the speed of their natural prey.
“As far as we know the fish were not aware that (our graphics) were just little dots.”
He said it was important that the game had been coded so that the movement of the dots did not become predictable.