Heiankyo Alien (平安京エイリアン Heian-kyō Eirian ) is a video game created by the University of Tokyo's Theoretical Science Group (TSG) in 1979. The game was originally developed as a personal computer game, and was first published by Denki Onkyō Corporation as an arcade game in January, 1980. The game has been ported to several other gaming systems since its original release.
The player controls a Heian period police officer (kebiishi) who must defend the capital city (Heian-kyō) from an alien invasion by digging holes in the ground and filling them back up after an alien falls inside. The player scores points for every alien trapped, and the quicker the hole is filled up after the alien falls in, the higher the amount of points are scored. The aliens increase in number as the levels progress, and they can escape from holes after a certain period of time elapses or if another alien passes above their hole. The player loses if they come in contact with an alien. There is a time limit for each level, and the number of aliens increases drastically when this limit is reached, essentially preventing the player from completing the level.
The player can enter their name on the arcade machine if a high-score is reached. In the original version of the game, a unique cursor is employed where the player selects a letter by having their character walk through the street that displays the desired letter. The game also contains a two-player mode, where the players can either alternate turns or play on the same screen simultaneously.
The original version uses a Zilog Z80 microprocessor, and the arcade system board used is a copied version of the one used by Sega's Head On. Since the original system board itself was a copy, Heian-kyō Alien's system board was easily duplicated, and many of the units distributed to arcade centers were "copies of a copy" created by other companies. Few of the original units manufactured by Denki Onkyō remain in place today. 
Many copied arcade versions of the game exist with differences in background color and sound effects. Taito Corporation produced a version with a light-blue background that recycled many sound effects from Head On. The unit's cabinet and instruction card were created specifically for the version by Taito, but it is not known whether the version was a licensed manufacture or a copy. Hōei Sangyō (now Banpresto) produced an arranged version called Time Alien where alien movements are much quicker (however, the game lags whenever the player tries to dig or fill up a hole). In 1980, a North American version titled Digger (unrelated to the Canadian computer game Digger) was created by Sega and Gremlin Industries, with minor changes in appearance.
Meldac released a Game Boy version of the game in Japan and North America in 1990. This port includes a remake version where a new type of alien appears to chase after the player's character. The game was also ported to the Super Famicom by Nihon Bussan in 1995 as Nichibutsu Arcade Classics 2: Heiankyo Alien. The company had previously released a licensed remake titled Kid no Hore Hore Daisakusen. The game was also made available for the Microsoft Windows operating system in 1999 by Hyperware, and various mobile phone versions are available on i-mode, Vodafone live!, and EZweb.
Heiankyo Alien is perhaps the first example of the "trap-em-up" genre and most likely the first game to feature digging. Further "trap-em-up" platform games bear similarities to Heiankyo Alien in that the player must dig holes to lure and trap enemies. Space Panic (1980) also features trappable aliens while Lode Runner's (1983) enemies are human guards. Doraemon Meikyū Daisakusen (1989) and Boomer's Adventure in ASMIK World (1989) are later examples. The Commodore VIC-20 cartridge game Alien appears to be a direct clone of Heiankyo Alien.
- 東大の頭脳に挑戦！「平安京エイリアン」 (Japanese). IT Media +D Games (2008-04-20). Retrieved on 2008-07-31
- G-mode Press Release. G-Mode. Archived from the original on July 3, 2007 Retrieved on 2008-07-31
- Tane, Kiyoshi; Shinichi Yamoto, Hiroki Abe (2002). 超アーケード. Ohta Books. pp. 10–23. ISBN 4872336704.
- Digger Videogame by Sega/Gremlin (1980). International Arcade Museum. Retrieved on 2008-07-31
- Heiankyo Alien on GameFAQs. GameSpot. Retrieved on 2008-07-31
- Nichibutsu Arcade Classics 2:Heiankyo Alien. GameSpot. Retrieved on 2008-07-31