Game Template Wanted: Angry Bird Level Structure/Menu

I know there are a lot of game templates out there. Is anyone aware of one (paid or otherwise) that provides a level selection scheme like angry birds? By this I mean the ability to initially display a locked graphic for each level not yet completed and... then unlock each level as it is completed. Perhapse even display a number of stars to indicate how well the player did on the level.
Thanks!
Tim

It's very easy. This code come from my olllldd game :) First you need some data container:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
require "sqlite3"
require "toggle"
 
local path = system.pathForFile("thegolfwar.db", system.DocumentsDirectory)
db = sqlite3.open( path ) 
 
local function onSystemEvent( event )
        if( event.type == "applicationExit" ) then              
            db:close()
        end
end
 
--Setup the table if it doesn't exist
local tablesetup = [[CREATE TABLE IF NOT EXISTS audio (id INTEGER PRIMARY KEY, wartosc);]]
local pointsStore = [[CREATE TABLE IF NOT EXISTS points (id INTEGER PRIMARY KEY, current, best);]]
db:exec( tablesetup )
db:exec( pointsStore )
 
--First time sound init
local soundInit = function()
        local row_inConfig_count = 0 
        for row in db:nrows('SELECT * FROM audio') do 
                row_inConfig_count = row_inConfig_count + 1
        end
 
        local audioStartConfig = [[INSERT INTO audio VALUES(1, 1);]]
        
        if (row_inConfig_count == 0) then 
                db:exec( audioStartConfig )
                for i=1,36 do 
                        local pointsStoreInit = [[INSERT INTO points VALUES(']]..i..[[', 0, 0);]]
                        db:exec( pointsStoreInit )
                end
        end
end

Thanks gtatarkin! I appreciate you taking the time to share that.
Tim

thanks gata ,it's great for me.

views:1565 update:2012/2/9 11:37:26
corona forums © 2003-2011