Well there are many things that can improve your games speed jezlee, I am not going to look though 5k lines of code in a crazy web of function hunting though to optimize it. If you want some serious help i would recommend putting all the functions that do not run in the active Game play loop into a separate include file off to the side. and re-upload it. Upon a quick examination there are a few functions that are repeated that do not need to be repeated and you have far to much tied into the sync system that i think is slowing it down from its potential. That said u can change 1 line sync() to render() swap() and ull get more performance but not much my phone goes from 56 to 60. might go higher but i feel ur sync system is limiting it. There are different ways to control the sync(). I prefer to never actually use sync because it rarely is optimized. Running everything within the sync loop is also a bad idea because the entire game loop is limited to the refresh rate. syncrate(30) do print"hi"sync()loop will print hi 30 times a second. when in actuality it can print hi about 4k times a second at its full potential but you only need to show it 30 times a second.
I use something like this to control multiple loop speeds things that need to run fast and things that dont and manually syncing things that need a visual update im sure this can be improved upon.
myloopcounter=0
howmanyloopsasecond=0
Do
inc mainloopcycle,1
if mainloopcycle >=250
//!!!!!!!!!logic cycle!!!!!!!!!
mainloopcycle =0
//do math and anything you want here stuff here that needs to run fast^^^
// you can add a second timer to run things that dont need to run as often at a slower speed
inc myloopcounter,1
endif
/////////////////////Timer to start cync loop///////////////////////////////////////////////////////
if startfps=0:fps#=timer():startfps=1:endif
if starttimer=0:starttime#=timer():starttimer=1:endif
if starttimer=1:inc howmanyloopsasecond,1
if timer()-starttime# >=1.00000:starttimer=2:endif:endif
if timer()-fps# > 0.03
//anything to sync below
//drawstuff
render()
swap()
startfps=0
endif
loop
that said your game looks great and well designed code runs smooth and identical on multiple devices. very clear to read and variables have nice names, organization could be a little better for your dev purposes.
this is what i mean by organizing. this is a main source file. the entire game will run from this screen. first function is ran. it goes into its own loop that it stays in until it exits then the second function is ran back into its own loop again. and since a large function like login has its own source file names after it so there never any guessing where the function is. each source has its own global that are used inside of it as for easy programming. But to each their own. Give 100 programmers the same short task and you will get 100 different results. so what it comes down to is did you make a good product that works and are you happy with it lol.