Edited project.json to change scope of variables in renderer to make it easier to code in another sprite without hundreds of variables. Considerably faster now for some reason. Do not attempt to rename the variables as this causes weird scoping issues, as there are variables which for some reason are both local and global.