Let's make an app the QUICK way

Developers that have been working with some of the mainstream Lua frameworks are aware of names like CoronaSDK, GiderosStudio, Moai, Love, Codea but then there are some lesser known frameworks that are available. Today we shall look at one such option, Quick
Quick is an option brought to the development community by Marmalade, it was called AirplaySDK when it was released around 2009. At the time it was a high end C++ engine, even today it remains so but with Quick they have made it easier to develop for those not wanting to use C++. They also have another option called OpenQuick which is the open source version of Marmalade Quick. We shall look at the pro's and cons of both in a bit.

How does the code look

The code when using Marmalade Quick looks like any other Lua code written in CoronaSDK or Gideros Studio, in fact it is more geared towards CoronaSDK as it does not adhere to an object oriented style like that present in Gideros.

Here's an example of adding an image between the three frameworks

CoronaSDK
 local image = display.newImage("image1.png",10,10)

Gideros Studio
 local image = Bitmap.new(Teture.new("image1.png"))
 image:setPosition(10,10)
 stage:addChild(image)

Marmalade Quick
 local image = director:createSprite(10, 10, "image1.png")

Is Marmalade Quick based on something

Yes, Marmalade is like other frameworks based on the same principles that the underlying layer is that of OpenGL and then the Lua code is responsible for all of the UI and interaction. Additionally, Marmalade Quick is based on Cocos2D and tolua to provide the Cocos2D elements to the code, you will therefore notice the presence of director.

What about the events, etc

Surprisingly or rather aptly, the events system in Marmalade Quick is quite easy to use. It works with the similar keywords as in any of the three frameworks mentioned above, for example

CoronaSDK
 image:addEventListener("touch", onTouch)

Gideros Studio

 image:addEventListener("touch", onTouch)

Marmalade Quick
 image:addEventListener("touch", onTouch)
and to remove the events the keyword is the same for all the frameowrks, removeEventListener.

What are the advantages of Marmalade Quick

The major advantage of Marmalade Quick over the other two frameworks is that it has a slightly larger deployable target range than just iOS and Android, it can support BBPlaybook and the new BB10.

What are the disadvantages of Marmalade Quick

On the surface there seem to be none, however Marmalade has just entered the mass market as AirplaySDK/Marmalade was earlier only for use by large studios and the entry bar was very high with C++ and the license pricing. Even now Lua might have tried to make it easier to attempt but the licensing costs are comparable to the other frameworks. The only difference being that the other frameworks offer a FREE version to not only try but also to publish on the app stores. Marmalade Quick is an add-on with Marmalade and an evaluation license or a purchased license is required to try Quick. The evaluation license is available for 30 days only which is quite unusable for hobbyists or Indie that might want to look at this option between their other projects and life. The pricing is a bit steep but then Marmalade also offer something called OpenQuick, which is open source and free.

What is the cost of FREE

OpenQuick is opensource and available on GitHub as source code, there is no binary that can be downloaded and for the average Lua developer, if they wanted to dabble with Compilers, etc then why would they look at Lua? The entry is a barrier. Secondly Marmalade Quick comes with it's own simulator and debug console which would cease to work if the license is not valid, the instructions and details on how to use OpenQuick are sketchy and unclear. So for now it is hardly an option. So back to Marmalade Quick.

First Impressions

Getting past all of those issues and orienting myself with the Marmalade tools, my Hello World looked like

 print("Hello World")

 function onTouch(event)
  for i,j in pairs(event) do
    print(i,j)
  end
 end

 system:addEventListener("touch", onTouch)

This also explained the event object for touch which had a name, phase, x, y, time and id. About the same as available in CoronaSDK. Custom Events can also be created and called using the same addEventListener and sendEvent. It also has a built in Tweening function that can be used to animate on screen objects using tween:to which is similar to the CoronaSDK's transition.to

One major difference

While most of the frameworks have the top-left corner as origin, (0,0), The screen on Marmalade Quick is set inversely, the bottom-left corner is (0,0) and the Y-axis increases as it ascends, like a Graph axis.

Lasting Impressions

There are a couple of things available in Marmalade that make it special,

The ability to build iOS apps on a windows PC, the only time you will require a Mac is to upload the app to the store as Application Loader is the only way to do so at this point of time. The

C++ engine can create binaries for a lot more platforms than the Mobile options offered by Quick, so these could be extended to Quick in the near future.

On the not so good side are the facts

The documentation is quite sparse and unclear, specially if you are used to the documentation with other frameworks.

The licensing process is painful and before I could get it working, I had to send emails to the support several times. However the support was quite helpful and prompt, thought not on other matters relating to Marmalade but not setting up, etc.

Personally I had been looking at AirplaySDK about the same time that CoronaSDK was released, then looked at it when the name was changed, but when Quick was launched, it was something to consider and giving a closer look to. It was OpenQuick that was attractive but it is not in a usable form (binary) and Marmalade Quick is too much hassle to get it going.

If i can get through to the team at Marmalade, there could be an in-depth review of Marmalade and Marmalade Quick on the ReviewMe site. However after the mixed reaction with the experience with the Helpdesk, it is uncertain.

More code


-- Your app starts here!
print("This is my app!")

ox, oy = 10,10
rect = director:createRectangle{x=ox, y=oy, w=200, h=50, color=color.red, name="red", xAnchor=0.5, yAnchor=0.5}


function onTouch(event)
 if event.phase == "began" then
  system:addEventListener("touch", whateverOut)
 end 
 
 if event.phase == "ended" then 
  system:removeEventListener("touch", whateverOut)
  system:sendEvent("custom",{x=event.x, y=event.y})
 end 
end

function whateverOut(event)
 if event.phase == "ended" then 
  tween:to(rect,{x=event.x, y=event.y, time=0.5})
  system:removeEventListener("touch", whateverOut)
 end 
end

function custom(event)
 print("Called at", event.x, event.y)
end 

rect:addEventListener("touch", onTouch)
system:addEventListener("custom", custom)

Now start your touch on the red rectangle and drag your touch up to any point on the screen, the rectangle moves to that point and centers itself there.

Comments

  1. I checked the Marmalade Quick website and IMHO they're target developers are not indies. Their requirement of Marmalade attribution within the app (unless you put out about $3,500) boarders on absurd. Constraints like annual revenue limits - WTF?

    While I have a big wishlist for Corona SDK I get allot more bang for my buck with them than I'd ever get with Marmalade Quick.

    However, thanks for your review!

    ReplyDelete
  2. I am not sure where you got your facts from. There are a lot of licenses depending on your requirements.

    Starting from $149/yr Community, $499/yr Indie, $1,499/yr Plus and the $3,499/yr Professional.

    I do not work for Marmalade and wouldn’t be able to comment on their pricing and would not be a supporter of the attribution, etc after charging a fee. However they do offer free licenses for a year (they are running a promo at this time)

    If CoronaSDK works for you, please by all means stick with it, it has been made available for free.

    This was an introductory article, a detailed review highlighting features available or not available in Marmalade Quick will be on the reviewme site soon.

    ReplyDelete
  3. Dear Anonymous, your concerns were addressed in the response. perhaps you did not read the fact "and would not be a supporter of the attribution, etc after charging a fee" I agree with you on the fact that attribution is not such a good idea specially if you charge for a product. Other frameworks have attribution but then that is for the free versions only. It is like buying an app for full price and it still has ADs, no one likes it.
    Personally, if a framework is too constraining, I would rather focus on the one that suits my need. I guess the guys at Marmalade would realise that soon and make changes (hopefully) otherwise we have plenty other options.

    You are a CoronaSDK user, have you looked at GeminiSDK? It's openSource, maybe that's another option.

    ReplyDelete

Post a Comment

Popular Posts