Fun facts!
Posted: Fri Aug 10, 2012 12:24 am
Here are some things that at some time probably made me go "Wow, I didn't know you could do that! I mean, until just now, that is." Feel free to add your own!
Did you know...
There are languages that have been used with LÖVE other than Lua: Killa (which I think is being used for the new Concerned Joe which is in-development) and Moonscript (used for the Ludum Dare entries Volcanox and Wulcan, by Leafo)
To insert that Ö character you can use Alt+153 in Windows, Ctrl+Shift+u then 00d6<Enter> in Ubuntu (maybe there is an easier way?), or Shift+Alt+V in gVim.
Methods can be used on literal strings and entries can be accessed from literal tables by putting parentheses around the strings/tables:
love.load can take command line arguments. You could use them to specify an input file, or a level to jump to, or to enable debugging mode...
To launch LÖVE games with their compatible version, you could install each version of LÖVE to a separate location (old versions can be found here), change the file extension of your .love files to represent their version number, (e.g. .love072), and change the default application with which they open with to the appropriate LÖVE executable.
Parentheses can be omitted from function calls if it has a single argument which is either a literal string...
or a table constructor.
You can share code with other people using pastebin services such as hastebin.
You can change the icon of Windows executable files using Resource Hacker.
Varargs (...) and the return values from functions can be put into tables using table constructors:
You can make your very own errors using assert, and you can also print error messages to the terminal.
You can reduce the filesize of PNG files using PNG optimization software such as PNGGauntlet.
LÖVE apparently works best with Ogg Vorbis audio, which other formats can be converted to using Audacity or SoX from the command line.
I hope someone knows something now that they didn't know before! If you have some fun facts which I didn't think of, you could totally post them here (they don't even need to be fun or factual!)
EDIT: Oh yeah, I forgot something!
To easily comment and uncomment a section like this:
Did you know...
There are languages that have been used with LÖVE other than Lua: Killa (which I think is being used for the new Concerned Joe which is in-development) and Moonscript (used for the Ludum Dare entries Volcanox and Wulcan, by Leafo)
To insert that Ö character you can use Alt+153 in Windows, Ctrl+Shift+u then 00d6<Enter> in Ubuntu (maybe there is an easier way?), or Shift+Alt+V in gVim.
Methods can be used on literal strings and entries can be accessed from literal tables by putting parentheses around the strings/tables:
Code: Select all
({'aquamarine', 'azure', 'auburn'})[math.random(1, 3)]
('This really should be in all caps'):upper()
love.load can take command line arguments. You could use them to specify an input file, or a level to jump to, or to enable debugging mode...
To launch LÖVE games with their compatible version, you could install each version of LÖVE to a separate location (old versions can be found here), change the file extension of your .love files to represent their version number, (e.g. .love072), and change the default application with which they open with to the appropriate LÖVE executable.
Parentheses can be omitted from function calls if it has a single argument which is either a literal string...
Code: Select all
require 'RequireIsAFunction'
love.graphics.setCaption 'Test'
Code: Select all
for i, v in ipairs{'a', 'b', 'c'}
end
You can share code with other people using pastebin services such as hastebin.
You can change the icon of Windows executable files using Resource Hacker.
Varargs (...) and the return values from functions can be put into tables using table constructors:
Code: Select all
function f(...)
args = {...}
print('The second argument is '..args[2])
end
Code: Select all
positions = {love.mouse.getPosition()}
print('x position is '..positions[1])
print('y position is '..positions[2])
You can make your very own errors using assert, and you can also print error messages to the terminal.
You can reduce the filesize of PNG files using PNG optimization software such as PNGGauntlet.
LÖVE apparently works best with Ogg Vorbis audio, which other formats can be converted to using Audacity or SoX from the command line.
I hope someone knows something now that they didn't know before! If you have some fun facts which I didn't think of, you could totally post them here (they don't even need to be fun or factual!)
EDIT: Oh yeah, I forgot something!
To easily comment and uncomment a section like this:
Code: Select all
---[[
The first "-" of ---[[ can be removed or added
to comment and uncomment these lines.
--]]