Fixed up the NPC input to work with an unlimited number of sprites