Thursday, 13 October 2011

Corona SDK protyping results

I thought I might be more at home with Corona SDK than GameSalad. This was purely on the hunch that it was aimed at a developer rather than designer. Having installed the SDK I went to the support pages to get a general feel. Having worked with a large number of commercial programming languages before I wasn't keen working in another, this one called Lua, and the fact it wasn't object-oriented. Also the lack of an IDE having to work in notepad was a move back to the nineties for me when working in HTML for the first time.

This, however, is where the negativity ends. I was very impressed with how little code you needed to write to achieve a lot of very clever effects. Coupled with the director class by Ricardo Rauber meant I could organise the project in a more logical sequence; i.e. a new script for each scene.

As an example please see a code excerpt for the results / restart page:

module(..., package.seeall)

--====================================================================--
-- SCENE: SCREEN 1
--====================================================================--

--[[

 - Version: 1.3
 - Made by Ricardo Rauber Pereira @ 2010
 - Blog: http://rauberlabs.blogspot.com/
 - Mail: ricardorauber@gmail.com

******************
 - INFORMATION
******************

  - Sample scene.

--]]

new = function ( params )
 
 ------------------
 -- Imports
 ------------------
 
 local ui = require ( "ui" )
 
 ------------------
 -- Groups
 ------------------
 
 local localGroup = display.newGroup()
  
 color = display.newRect(0,0,display.contentWidth,display.contentHeight)
 color:setFillColor(255, 255, 255)
 
 myMessage = display.newText( "Congratulations you", 40, 60, native.systemFont, 24 )
 myMessage:setTextColor(0,0,0 ) 
 myMessage2 = display.newText( "finished in a time of", 40, 90, native.systemFont, 24 )
 myMessage2:setTextColor(0,0,0 ) 
 timeText = display.newText(_G.minsText.. " mins and " .._G.secsText .. " secs", 40, 120, native.systemFont, 24)
 timeText:setTextColor(0,0,0)

    
 local bt01t = function ( event )
  if event.phase == "release" then
   _G.secsText = 00
   _G.minsText = 00
  
   director:changeScene( "screen2")
  end
 end
 
 local bt01 = ui.newButton{
     default = "restart.png",
     over = "restart.png",
     onEvent = bt01t,
     id = "bt01"
 }
 
 bt01.x = display.contentWidth / 2
 bt01.y = (display.contentHeight / 2) + 50 
  
 localGroup:insert( color )
 localGroup:insert( myMessage )
 localGroup:insert( myMessage2 )
 localGroup:insert( bt01 )
 
 return localGroup
 
end


So based on my test criteria my findings were as follows:
  • The ability to add in new scenes and transition between them was relatively straight forward when using the aforementioned director class class
  • The generation of boxes on clicks was an adaption of a support example but was implemented with just a few lines of code.
  • Scripting and the Lua language meant full control over conditional and game logic
  • The wrapper around Box2D physics engine gave some excellent and realistic results
The lack of IDE is of course a disadvantage and having written to the founders they took the time to respond to state they were looking in to it. Impressive.

Price point is also pretty good coming in about 25% cheaper than GameSalad.

My next investigation will be Cocos2D as it has a lot of similarities in particular the physics engine: Box2D.

Check out the video below for the corona sdk version in action.

0 comments:

Post a Comment

 
;