sábado, 25 de fevereiro de 2012

Quick Tip - Lua and Mac OSX

This more fast than a bullet tip can seem misplaced but as I`m closer to Lua, in result of my development on CoronaSDK, somethings I started to try on this new frontier script language (she is quite nice).

So what if you get in love with lua and say ok I`m having fun but I want to get further using it for development in Mac and Windows and Linux WOW.

I going to show you the easiest way possible for Mac (that I`m aware of), follow the steps:

Step One

We are going to use brew to install Lua, this link has more info about brew http://mxcl.github.com/homebrew/
Open your terminal (command+space and type terminal then enter)
Now type: /usr/bin/ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
Wait it to finish but don`t close the terminal yet

*UPDATE*: The ruby script has moved from https://raw.github.com/gist/323731 to https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb

Step Two

In terminal type: brew install lua
Now wait to the magic to finish...

Step Three

There is no step three, really you only have to use it.
To use it from terminal type Lua. You should see something like this:

bla:bla user$ lua
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> _

Try typing print("yay it works!")

Bonus Tip

Hey this is nice, fun and I want some extra sweet chocolate on it. This time the chocolate is love2d, a cross-plataform game development framework tat uses Lua as programming language. 

Try to download it and use by yourself.
But I promise that love2d will come back in another post.... soon enough.... I hope.