System.usbDiskModeActivate()
y = 0
pink = Color.new(255, 0 , 153)
white = Color.new(255, 255, 255)
blue = Color.new(0 , 153, 255)
orange = Color.new(255, 102, 0)
gray = Color.new(153, 153, 153)
black = Color.new(0 , 0 , 0) 
screen:print(185, 136, "Loading: 0%", orange)
screen.flip()
e8v = Sound.load("media/electric/e8v.wav")
ab = Sound.load("media/electric/ab.wav")
gb = Sound.load("media/electric/gb.wav")
db = Sound.load("media/electric/db.wav")

background = Image.load("media/background4.png")


screen:clear()
screen:print(185, 136, "Loading: 40%", orange)
screen.flip()

l = Image.load("media/left_trigger.png")

screen:clear()
screen:print(185, 136, "Loading: 60%", orange)
screen.flip()

right = Image.load("media/eb.png")
b = Sound.load("media/electric/b.wav")
ld = Sound.load("media/l.wav")
c = Sound.load("media/electric/c.wav")
d = Sound.load("media/electric/d.wav")
f = Sound.load("media/electric/f.wav")
g = Sound.load("media/electric/g.wav")
eb = Sound.load("media/electric/eb.wav")
a = Sound.load("media/electric/a.wav")
bb = Sound.load("media/electric/bb.wav")
opening = Sound.load("media/opening3.wav")
e = Sound.load("media/electric/e.wav")
screen:clear()
screen:print(185, 136, "Loading: 80%", orange)
screen.flip()


screen:clear()
screen:print(185, 136, "Loading: 90%", orange)
screen.flip()

x = Image.load("media/e.png")
 screen:clear()
screen:print(185, 136, "Welcome To PSPlay: Electric Guitar", orange)
screen:print(185, 150, "Press 'X' To Start", white)
screen:print(290, 260, "Programmed By Amrcidiot", blue)
screen.flip()
opening:play()
screen.waitVblankStart(60)
Music.volume(128)

oldpad = Controls.read()

while true do
          screen:blit(0, 0, background, false)

pad = Controls.read()

if pad:r() then
y = 1
end

	  if pad:cross() and not oldpad:cross() then
			screen:blit(28, 0, x)
			screen.flip()
			e:play()
			Music.volume(128)
			
	  end
 		if pad:circle() and not oldpad:circle() then
			if y == 0 then
				a:play()
				Music.volume(128)
			end
			if y == 1 then
				ab:play()
				Music.volume(128)
			end
          end

          if pad:triangle() and not oldpad:triangle() then
			if y == 0 then
				g:play()
				Music.volume(128)
			end
			if y == 1 then
				gb:play()
				Music.volume(128)
			end
          end

          if pad:square() and not oldpad:square() then
			f:play()
			Music.volume(128)
          end

          if pad:up() and not oldpad:up() then
			if y == 0 then
				d:play()
				Music.volume(128)
			end
			if y == 1 then
				db:play()
				Music.volume(128)
			end
          end

          if pad:right() and not oldpad:right() then
			if y == 0 then
				e8v:play()
				Music.volume(128)
			end
			if y == 1 then
				eb:play()
				Music.volume(128)
			end
          end

          if pad:down() and not oldpad:down() then
			if y == 0 then
				b:play()
				Music.volume(128)
			end
			if y == 1 then
				bb:play()
				Music.volume(128)
			end
          end

         

          if pad:left() and not oldpad:left() then
			c:play()
			Music.volume(128)

          end

          if pad:l() and not oldpad:l() then
                    screen:blit(134, 219, l)
                    screen.flip()
			ld:play()
			Music.volume(128)
          end

          if pad:r() then
	  if pad:start() and not oldpad:start() then
                    screen:blit(20, 180, r)
                    screen.flip()
			rd:play()
			Music.volume(128)
          end
	end


if pad:select() and not oldpad:select() then
screen:save("screenshot3.png") 
end 

if  pad:start() then
dofile("script.lua")
end

oldpad = pad
y = 0
end
