Posts Tagged → lua
Corona SDK
It seems I can develop some games much, much faster with the Corona SDK. It will cost me $99, and it’s not as macho as mastering Objective-C, but I think I’ll end up saving hundreds of hours with this kit.
I think Corona is a great kit for writing games in general, especially arcade games and board games. There’s no built-in support yet for tiled maps, and it looks like Cocos2D will have that built-in first. But even with that disadvantage, developing on Lua is so much more productive than developing on Objective-C that I’ll still come out ahead.
Some apps aren’t a good fit, though:
- those that extensively use the CocoaTouch UI controls. In Corona, you have to create your own buttons, text fields, etc. There’s the ui library, but it only covers a few controls.
- those that access APIs that aren’t wrapped yet by Corona. For example, access to the address book seems to be missing.
There’s the worry that Corona SDK will violate section 3.3.1. Folks from Corona gave some reassuring messages, but of course, with Apple, you can’t have absolute uncertainty. My take is that even if Apple gives Corona the boot, Corona will become Android-only, and Corona SDK is worth $99 even as an Android
I’m taking the $99 plunge. If nothing else, I think Lua will give me a refreshing break from my day-to-day Ruby and Javascript coding.
This post by Rad Batnag is from Radamanthus Batnag.
Lua Day 1: So near yet so far
So far Lua is strikingly similar to ruby. This of course only appears to be the case for very simple scripts.
Some common things so far:
- Condition expressions accepts any value, and false / nil are the only things which are failures. 0 and ”” are both true.
- The concept of a
Nilclass which only has nil as a value. - The use of
endto denote closing blocks for if, for, function definitions, etc. - The general way in which a program feels.
Lua Fibonacci:
Ruby Fibonacci:
The differences?
- Lua statements can’t be taken as returning a value, hence in the fibonacci example we need to explicitly use
return. - Lua has a boolean type, unlike in ruby, which has a FalseClass and a TrueClass.
- Lua only has only double precision floating point numbers to represent any number. Ruby has Fixnum, Bignum, Float.
- Lua takes the more
functionalapproach for converting between types, e.g.tonumber,tostringinstead of Ruby, which has a toi, tos method for numeric and string types. - Lua requires parenthesis when calling functions. I guess Ruby is very unique in this regard.
- Accessing any variable, even undefined ones, are legal, and always returns nil. This also applies to
tables, i.e. accessing an undefined key returnsnil. - Lua has a somewhat weird looking concatenation operator
... Ruby just uses+for concatenating strings. - Tables (which are kinda like Arrays and Hashes in one) use a 1-based index.
This post by cyx is from pipe :to => /dev/null.
Recent Comments