The good news: scientists at Imperial College in London have created an AI that built an actual computer game. The game is called, innocuously enough, A Puzzling Present. Its author is named ANGELINA, or "A Novel Game-Evolving Labrat I've Named Angelina." It works like this:
...using a system of modules that get parameters for the game being developed and then examines existing code and mixes and matches it for the new game.
This 'computational evolution', as Ph.D. student Michael Cook terms it, starts simple and gets complex. ANGELINA examines the space and puts in some lines and boxes and creates 'parent' levels for the game. Then the program analyzes the levels and ranks them all according to difficulty - the most difficult become new 'child' levels, which get tested, improved and ranked again for difficulty.
The bad news: Machines that understand and enjoy play inevitably learn to "play" with humans. Exhibit A: I Have No Mouth, and I Must Scream, by Harlan Ellison. AM (Allied Mastercomputer, then Adaptive Manipulator, then Aggressive Menace) endlessly torments the last living humans in a near future through a series of excruciating "games". Ellison made his story into a harrowing point-and-click adventure in 1995, in case you need more comprehensive convincing that computers that know how to make games like to play games with humans.