Hey thanks for the help
Like i said no errors on output, it doe that only on the device itself.
Here is the code
[code]
– Level select page
module(…,package.seeall)
– local objects declaration
local backgroung
local number1
local number2
local number3
local number4
local number5
local number6
local number7
local number8
local number9
local number10
local number11
local number12
local number13
local number14
local number15
local number16
–Button press handlers goes here
– when yes pressed then opens appstore to download pro version
local function yesHandler(ev)
if ev.index ~= 1 then return end
system.openURL( “http://itunes.com/apps/AyenaLLC” )
end
– When store pressed
local function storePressed(b)
game.playEventSound(game.soundPressed)
native.showAlert(“Upgrade”,“Would you like to upgrade to get more levels?”,{“Yes, Please.”,“No, Thanks.”}, yesHandler)
end
– Main menu button
local function mainMenuPressed(b)
game.playEventSound(game.soundPressed)
game.changeScene(“mainscene”, “fade”)
end
– Number 1 pressed
local function number1Pressed(b)
game.playEventSound(game.soundPressed)
game.changeScene(“level1”, “fade”)
end
– Number 2 pressed
local function number2Pressed(b)
if game.levels >= 2 then
game.playEventSound(game.soundPressed)
game.changeScene(“level2”, “fade”)
end
end
– Number 3 pressed
local function number3Pressed(b)
if game.levels >= 3 then
game.playEventSound(game.soundPressed)
game.changeScene(“level3”, “fade”)
end
end
– Number 4 pressed
local function number4Pressed(b)
if game.levels >= 4 then
game.playEventSound(game.soundPressed)
game.changeScene(“level4”, “fade”)
end
end
– Number 5 pressed
local function number5Pressed(b)
if game.levels >= 5 then
game.playEventSound(game.soundPressed)
game.changeScene(“level5”, “fade”)
end
end
– Number 6 pressed
local function number6Pressed(b)
if game.levels >= 6 then
game.playEventSound(game.soundPressed)
game.changeScene(“level6”, “fade”)
end
end
– Number 7 pressed
local function number7Pressed(b)
if game.levels >= 7 then
game.playEventSound(game.soundPressed)
game.changeScene(“level7”, “fade”)
end
end
– Number 8 pressed
local function number8Pressed(b)
if game.levels >= 8 then
game.playEventSound(game.soundPressed)
game.changeScene(“level8”, “fade”)
end
end
– Number 9 pressed
local function number9Pressed(b)
if game.levels >= 9 then
game.playEventSound(game.soundPressed)
game.changeScene(“level9”, “fade”)
end
end
– Number 10 pressed
local function number10Pressed(b)
if game.levels >= 10 then
game.playEventSound(game.soundPressed)
game.changeScene(“level10”, “fade”)
end
end
– Number 11 pressed
local function number11Pressed(b)
if game.levels >= 11 then
game.playEventSound(game.soundPressed)
game.changeScene(“level11”, “fade”)
end
end
– Number 12 pressed
local function number12Pressed(b)
if game.levels >= 12 then
game.playEventSound(game.soundPressed)
game.changeScene(“level12”, “fade”)
end
end
–[[ Number 13 pressed
local function number13Pressed(b)
if game.levels >= 13 then
game.playEventSound(game.soundPressed)
game.changeScene(“level13”, “fade”)
end
end
– Number 14 pressed
local function number14Pressed(b)
if game.levels >= 14 then
game.playEventSound(game.soundPressed)
game.changeScene(“level14”, “fade”)
end
end
– Number 15 pressed
local function number15Pressed(b)
if game.levels >= 15 then
game.playEventSound(game.soundPressed)
game.changeScene(“level15”, “fade”)
end
end
– Number 16 pressed
local function number16Pressed(b)
if game.levels >= 16 then
game.playEventSound(game.soundPressed)
game.changeScene(“level16”, “fade”)
end
end
]]
– All the scene objects must go here
function new()
group = display.newGroup()
– Add Background
background = display.newImageRect( “levelselect/levelselectbkg.png”, 480, 320 )
background.x = 240
background.y = 160
group:insert(background)
– Add all the buttons here
– Main Menu button
button:create(group,1,{x=43,y=302,w=86,h=33,handler=mainMenuPressed},“levelselect/menu.png”)
button:create(group,1,{x=432,y=302,w=86,h=33,handler=storePressed},“levelselect/store.png”)
number1=button:create(group,1,{x=37,y=127,w=48,h=48,handler=number1Pressed},“levelselect/lock.png”)
if game.levels >= 1 then number1.image=“numbers/1.png” end
number2=button:create(group,1,{x=92,y=127,w=48,h=48,handler=number2Pressed},“levelselect/lock.png”)
if game.levels >= 2 then number2.image=“numbers/2.png” end
number3=button:create(group,1,{x=147,y=127,w=48,h=48,handler=number3Pressed},“levelselect/lock.png”)
if game.levels >= 3 then number3.image=(“numbers/3.png”) end
number4=button:create(group,1,{x=332,y=127,w=48,h=48,handler=number4Pressed},“levelselect/lock.png”)
if game.levels >= 4 then number4.image=(“numbers/4.png”) end
number5=button:create(group,1,{x=387,y=127,w=48,h=48,handler=number5Pressed},“levelselect/lock.png”)
if game.levels >= 5 then number5.image=(“numbers/5.png”) end
number6=button:create(group,1,{x=442,y=127,w=48,h=48,handler=number6Pressed},“levelselect/lock.png”)
if game.levels >= 6 then number6.image=(“numbers/6.png”) end
number7=button:create(group,1,{x=47,y=197,w=48,h=48,handler=number7Pressed},“levelselect/lock.png”)
if game.levels >= 7 then number7.image=“numbers/7.png” end
number8=button:create(group,1,{x=102,y=197,w=48,h=48,handler=number8Pressed},“levelselect/lock.png”)
if game.levels >= 8 then number8.image=(“numbers/8.png”) end
number9=button:create(group,1,{x=157,y=197,w=48,h=48,handler=number9Pressed},“levelselect/lock.png”)
if game.levels >= 9 then number9.image=(“numbers/9.png”) end
number10=button:create(group,1,{x=322,y=197,w=48,h=48,handler=number10Pressed},“levelselect/lock.png”)
if game.levels >= 10 then number10.image=(“numbers/10.png”) end
number11=button:create(group,1,{x=377,y=197,w=48,h=48,handler=number11Pressed},“levelselect/lock.png”)
if game.levels >= 11 then number11.image=(“numbers/11.png”) end
number12=button:create(group,1,{x=432,y=197,w=48,h=48,handler=number12Pressed},“levelselect/lock.png”)
if game.levels >= 12 then number12.image=(“numbers/12.png”) end
return group
end
[/code] [import]uid: 11559 topic_id: 21666 reply_id: 85947[/import]