Yes it is indeed true. Way back in 1981, the founder of Microsoft, Bill Gates along with Neil Thompson wrote a computer game called DONKEY.BAS for IBM.
When IBM was developing the PC in the late 1970s and early 1980s it contracted Microsoft to develop an operating system and a version of the BASIC programming language to release with
the new computer. The operating system was released as PC-DOS when included with IBM PCs. Bill and Neil co-wrote the Donkey.Bas to demonstrate the capabilities of IBM PC and BASIC programming language.
While extremely simple compared to later PC games, and to games available for other systems at the time of its release, DONKEY.BAS is arguably a predecessor of all IBM PC games. The game continues to generate interest in part because of the involvement of Gates at a time when Microsoft was relatively small and only six years old. According to a speech delivered by Gates in 2001:
"Actually, it was myself and Neil at four in the morning with this prototype IBM PC sitting in this small room. IBM insisted that we had to have a lock on the door and we only had this closet that had a lock on it, so we had to do all our development in there and it was always over 100 degrees, but we wrote late at night a little application to show what the Basic built into the IBM PC could do. And so that was Donkey.bas. It was at the time very thrilling."