System.usbDiskModeActivate()
oldpad=nil
dofile("Settings/settings.lua")
dofile("Settings/credits.lua")
click = Sound.load("music/click.wav")
square = Image.load("images/square.png")
circle = Image.load("images/circle.png")
triangle = Image.load("images/triangle.png")
cross = Image.load("images/cross.png")
pad_up = Image.load("images/up.png")
pad_down = Image.load("images/down.png")
background = Color.new(0, 255, 0)
bg=0
dofile("libcard.lua")
myfont = Font.createProportional()
backsample=Image.load("decks/big/back/deck".. myback ..".png")
decksample=Image.load("decks/big/"..mydeck.."/12.png")
repeat
myfont:setPixelSizes(0,48)
clear_screen()
screen:fontPrint(myfont,60,126,"All or nothing!",Color.new(140,0,0))
myfont:setPixelSizes(0,16)
screen:fontPrint(myfont,150,156," Start",Color.new(140,0,0))
screen:fontPrint(myfont,150,172," Change deck",Color.new(140,0,0))
screen:fontPrint(myfont,150,188," Change deck back",Color.new(140,0,0))
screen:fontPrint(myfont,150,204," Change background color",Color.new(140,0,0))
screen:fontPrint(myfont,150,220," Quit",Color.new(140,0,0))
myfont:setPixelSizes(0,8)
screen:fontPrint(myfont,10,270,"   (c) ElPresi 2006 - visit www.elotrolado.net ",Color.new(0,0,0))
screen:blit(136,143,cross)
screen:blit(137,159,pad_up)
screen:blit(136,175,circle)
screen:blit(136,191,square)
screen:blit(136,207,triangle)
screen:blit(20,150,decksample)
screen:blit(404,150,backsample)
screen.flip()
pad=Controls.read()

if not (pad == oldpad) then

	if pad:cross() then
	if credits<20 then credits=20 end
	dofile("game1.lua")
	elseif pad:circle() then
	myback =myback+1
	if myback==25 then myback=0 end
	backsample=Image.load("decks/big/back/deck".. myback ..".png")
	elseif pad:square() then
		bg=bg+1
		if bg==4 then bg=0 end
		if bg ==0 then background = Color.new(0, 255, 0) end
		if bg ==1 then background = Color.new(0, 240, 240) end
		if bg ==2 then background = Color.new(100, 0, 50) end
		if bg ==3 then background = Color.new(150, 150, 150) end
	elseif pad:up() then
		mydeck=mydeck+1
		if mydeck==11 then mydeck=0 end
		decksample=Image.load("decks/big/"..mydeck.."/12.png")
	elseif pad:triangle() then
	    savecredits()
		break
	end

oldpad=pad
end


screen.waitVblankStart()
until (1==0)
