-- arCard+Wii
-- a snailface homebrew
Sound.oggPlay("pics/coin.ogg",0,0)
a = 0
b = Screen.color(0,0,255)
c = 1
u = 0
s = 0

while true do
Controls.read(0) 

if Controls.press1() == 1 then
s = s + 1
end

if s == 8 then
s = 0
end

if s == 0 then
b = Screen.color(0,0,255)
end
if s == 1 then
b = Screen.color(0,255,0)
end
if s == 2 then
b = Screen.color(255,0,0)
end
if s == 3 then
b = Screen.color(255,0,255)
end
if s == 4 then
b = Screen.color(0,255,255)
end
if s == 5 then
b = Screen.color(255,255,0)
end
if s == 6 then
b = Screen.color(128,128,128)
end
if s == 7 then
b = Screen.color(0,0,0)
end

if Controls.pressA() == 1 then
Sound.oggStop()
Sound.oggPlay("pics/coin.ogg",0,0)
a = a + 1
end


if a == 0 then
Screen.imageLoad("pics/zns.png", 0,12)
Screen.print(0,15,"Hello!")
Screen.print(280,185,"arCard+Wii")
Screen.print(280,200,"by Snailface")
Screen.print(280,230,"Press A to change card")
Screen.print(280,245,"Press 1 to change B-gnd Color")
Screen.print(280,260,"Press Home to return to menu")
end
if a == 1 then
Screen.print(500,15,"D-Right or Left:" )
Screen.print(500,30,"Rotate card.")
Screen.print(500,45,"D-Up:")
Screen.print(500,60,"Toggle bird's eye.")

--control status
if Controls.pressLeft() == 1 then
Sound.oggStop()
Sound.oggPlay("pics/beep.ogg",0,0)
c = c - 1
end

if Controls.pressRight() == 1 then
Sound.oggStop()
Sound.oggPlay("pics/beep.ogg",0,0)
c = c + 1
end

if c == 5 then
c = 1
end

if c == 0 then
c = 4
end
 
if Controls.pressUp() == 1 then

u = u + 1
Sound.oggStop()
Sound.oggPlay("pics/beep2.ogg",0,0)

end

if u == 2 then
u = 0
end

--show which card
if c == 1 then
 
 if u == 0 then
 Screen.imageLoad("pics/jupiter.png", 120, -10)
 Screen.print(0,15,"Mystery")
 end
 
 if u == 1 then
 Screen.imageLoad("pics/moonnew.png", 170, 0)
 Screen.print(0,15,"Mystery")
 end

end

if c == 2 then
 
 if u == 0 then
 Screen.imageLoad("pics/moonfull.png", 0, 0)
 Screen.print(0,15,"Mystery")
 end
 
 if u == 1 then
 Screen.imageLoad("pics/planeet.png", 80, 90)
 Screen.print(0,15,"Mystery")
 end

end

if c == 3 then
 
 if u == 0 then
 Screen.imageLoad("pics/moonhalf.png", 120, -10)
 Screen.print(0,15,"Mystery")
 end
 
 if u == 1 then
 Screen.imageLoad("pics/zon.png", 170, 0)
 Screen.print(0,15,"Mystery")
 end

end

if c == 4 then
 
 if u == 0 then
 Screen.imageLoad("pics/moonland.png",0, 0)
 Screen.print(0,15,"Mystery")
 end
 
 if u == 1 then
 Screen.imageLoad("pics/zoo.png",80, 90)
 Screen.print(0,15,"Mystery")
 end

end
end

if a == 2 then
Screen.imageLoad("pics/ar2.png", 120, -10)
Screen.print(0,15,"Mario")
end
if a == 3 then
Screen.imageLoad("pics/ar3.png", 120, -10)
Screen.print(0,15,"Link")
end
if a == 4 then
Screen.imageLoad("pics/ar4.png", 120, -10)
Screen.print(0,15,"Kirby")
end
if a == 5 then
Screen.imageLoad("pics/ar5.png", 120, -10)
Screen.print(0,15,"Samus")
end
if a == 6 then
Screen.imageLoad("pics/ar6.png", 120, -10)
Screen.print(0,15,"Pikmin")
end
if a == 7 then
Screen.imageLoad("pics/zq1.png", 20, 0)
Screen.imageLoad("pics/zq2.png", 220, 0)
Screen.imageLoad("pics/zq3.png", 420, 0)
Screen.imageLoad("pics/zq4.png", 20, 240)
Screen.imageLoad("pics/zq5.png", 220, 240)
Screen.imageLoad("pics/zq6.png", 420, 240)
Screen.print(0,15,"C")
Screen.print(0,30,"u")
Screen.print(0,45,"r")
Screen.print(0,60,"t")
Screen.print(0,75,"a")
Screen.print(0,90,"i")
Screen.print(0,105,"n")
Screen.print(0,135,"C")
Screen.print(0,150,"a")
Screen.print(0,165,"l")
Screen.print(5,165,"l")

c = 1
u = 0

end


Screen.flip()
Screen.clear(b)

if a == 8 then
a = 0
end

if Controls.pressHome() == 1 then
System.exitHBC() 
end


end