Hi
based on Deep Thought's idea, i made a program that reduces the file size of lua with about 15% (several tests came out, average reduction..)
it does not yet change anything really coding to the code yet, but:
- tabs are removed
- spaces are removed where possible ( var = 5 changes into var=5 )
- empty new lines are removed
- \000\ changes in \0\ for images
- removes the == true in statements (not yet ==false, that will come later)
- changes platform.window:invalidate() into p() and adds 'function p() platform.window:invalidate() end' because this takes in less place when used more than 2 times (which prob is the case)
- comments are removed
- gc:setAlpha(..)'s are removed
- include external .lua files by using %, followed by the name of the file (without the .lua)example main file:
function on.create()
%varsinit
end
varsinit.lua file:
menu = true
game = false
highscore = (var.recall("HS") or 0)
score = 0
the resulting file is saved in the same directory as the source file, but with improved added to the name, so example.lua changes into exampleimproved.lua
i tried to remove the ,"top" from drawstring, and it all worked fine, but than it seems that it is drawn on baseline, i thought top was default?
anyway, here are screenies
