Neuroadaptive gaming is a closed-loop concept wherein real-time neuro-physiological data are converted into a control signal that dynamically ad-justs the parameters of the game. The purpose of this neuroadaptive system is to generate a level of gaming demand that is personalised to the skill level of the player and maximises attentional engagement. This closed-loop sys-tem is designed to create a personalised form of intelligent adaptation that promotes a specific psychological state, e.g. high engagement with the game-related stimuli and maximum distraction from those stimuli unrelated to the game. Distraction is frequently used as a strategy for coping with pain, particularly in the clinic. It is known that attention plays an important role in the modulation of pain perception and pain tolerance. An activity that effectively draws attention from pain-related stimuli will increase tolerance of pain and reduce emotional distress associated with painful sensations. This paper will describe the design and development of a neuroadaptive game designed to distract from pain. The development of the game is de-scribed from concept and foundational experiments to the creation of a working prototype. The final prototype utilised measurement of neuro-physiological activation via functional near-infrared spectroscopy (fNIRS) to adapt the difficulty of a racing game in real-time, in order to maximise the attentional engagement of each player. The paper will focus on the design of the adaptive logic the game, which incorporates techniques from neurosci-ence with machine learning algorithms to create an implicit interaction with the player.