white = Color.new(255, 255, 255) 


 dImages = {}
dImages[1] = Image.load("char3/tinkyCROSS.png")
dImages[2] = Image.load("char3/tinkyCIRCLE.png")
dImages[3] = Image.load("char3/tinkyTRIANGLE.png")
dImages[4] = Image.load("char3/tinkySQUARE.png")
dImages[5] = Image.load("char3/tinkyUP.png")
dImages[6] = Image.load("char3/tinkyDOWN.png")
dImages[7] = Image.load("char3/tinkyLEFT.png")
dImages[8] = Image.load("char3/tinkyRIGHT.png")
dImages[9] = Image.load("char3/tinkymain.png")
currentdImage = 9
 backroundTW = Image.load("backroundTW.png")

while true do
screen:clear()
screen:blit(0, 0, backroundTW, false) 
screen:blit(198, 40,dImages[currentdImage]) 
 
 
pad = Controls.read()
 
screen:print(135, 251, "Press 'Start' to restart", black)
screen:print(110, 261, "Press 'Select' for a screenshot", black)


if pad:l() then
dofile("main.lua")
end

 
if pad:cross() then
currentdImage = 1
tinkyCROSS:play()
end
 
if pad:circle() then
currentdImage = 2
tinkyCIRCLE:play()
end
 
if pad:triangle() then
currentdImage = 3
tinkyTRIANGLE:play()
end
 
if pad:square() then
currentdImage = 4
tinkySQUARE:play()
end
 
if pad:up() then
currentdImage =5
tinkyUP:play()
end
 
if pad:down() then
currentdImage = 6
tinkyDOWN:play()
end
 
if pad:left() then
currentdImage = 7
tinkyLEFT:play()
end
 
if pad:right() then
currentdImage = 8
tinkyRIGHT:play()
end

if pad:select() then screen:save("screenshot.tga") end
 
if pad:start() then		
break
end 
 screen.flip()
end