Dr. Eggman's most recent attempt to take over Sonic's planet had many stages to it's development, & many projects developed to ensure a long & continuous rule once Sonic was defeated. Unfortunately not all of those ideas had reached total realization before Sonic & the Resistance struck back with brute vigor & force. One of such projects; X, is a virus created by Dr. Eggman meant to corrupt any & all electronic systems within a given radius, blacking them out & turning them against any number of targets.
The virus was given bits of Sonic's bio-data & now takes on the Blue Blur's appearance, powered by Eggman's knowledge & Chaos Energy. Beyond the corruption of electronics, the virus has developed it's own twisted take on Sonic's personality, & uses it's abilities to trap the minds of living beings into a digitized world of it's own creation. X loves to play games, & those games always end in the death of it's victims. It deliberately chooses to make said games virtually impossible, claiming it fun to watch his victims squirm in desperation before closing in for the kill.