blue = Color.new(56,172,236)
startbox = Image.load("startbox.png") 
selector = Image.load("selector.png")
statpage = Image.load("statpage.png")
choice_box = Image.load("choicebox.png")
textarrow = Image.load("text_arrow.png")
textbox = Image.load("talkbox.png")
s = 1
statpg = 0
selecty = 188
x = 0
while s ==1 do
pad = Controls.read()
screen:blit(71,170, textbox)
screen:print(101, 190, "now it's time for you to ", blue)
screen:print(101, 210, "choose the pokemon you would like.", blue)
screen:blit(376, 173, choice_box)
screen:blit(386, selecty, selector)
if x == 0 then
screen:print(404, 194, "nincada", blue)
screen:print(404, 214, "shinx", blue)
screen:print(404, 234, "gible", blue)
screen:print(404, 254, "riolu", blue)
screen:print(404, 188, "->", blue)
counter = counter +1
if pad:r() and oldpad:r() ~= pad:r() and selecty == 188 and counter >= 25 then
	counter = 0
	dofile("./pokemon/nincada/nincada_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 208 and counter >= 25 then
	counter = 0
	dofile("./pokemon/shinx/shinx_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 228 and counter >=25 then
	counter = 0
	dofile("./pokemon/gible/gible_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 248 and counter >= 25 then
	counter = 0
	dofile("./pokemon/riolu/riolu_get.lua")
end
if pad:right() and oldpad:right() ~= pad:right() and counter >= 25 then
	x = 2
	counter = 0
end
end
if pad:down() and oldpad:down() ~=pad:down() and selecty < 233 then
	selecty = selecty + 20
end
if pad:up() and oldpad:up() ~= pad:up() and selecty > 188 then
	selecty = selecty -20
end

if x == 2 then
counter = counter +1
screen:print(404, 194, "hoppip", blue)
screen:print(404, 214, "poliwag", blue)
screen:print(404, 234, "aron", blue)
screen:print(404, 254, "larvitar", blue)
screen:print(404, 188, "->", blue)
if pad:r() and oldpad:r() ~= pad:r() and selecty == 188 and counter >= 25 then
	counter = 0
	dofile("./pokemon/hoppip/hoppip_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 208 and counter >= 25 then
	counter = 0
	dofile("./pokemon/poliwag/poliwag_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 228 and counter >=25 then
	counter = 0
	dofile("./pokemon/aron/aron_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 248 and counter >= 25 then
	counter = 0
	dofile("./pokemon/larvitar/larvitar_get.lua")
end
	if pad:right() and oldpad:right() ~= pad:right() and counter >= 25 then
		x = 3
		counter = 0
	end	
end
if x == 3 then
screen:print(404, 194, "ralts", blue)
screen:print(404, 214, "zubat", blue)
screen:print(404, 234, "Eevee", blue)
screen:print(404, 254, "swinub", blue)
screen:print(404, 188, "->", blue)
counter = counter +1
if pad:r() and oldpad:r() ~= pad:r() and selecty == 188 and counter >= 25 then
	counter = 0
	dofile("./pokemon/ralts/ralts_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 208 and counter >= 25 then
	counter = 0
	dofile("./pokemon/zubat/zubat_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 228 and counter >=25 then
	counter = 0
	dofile("./pokemon/eevee/eevee_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 248 and counter >= 25 then
	counter = 0
	dofile("./pokemon/swinub/swinub_get.lua")
end


	if pad:right() and oldpad:right() ~= pad:right() and counter >= 25 then
		x = 4
		counter = 0
	end
end
if x == 4 then
screen:print(404, 194, "hippopotas", blue)
screen:print(404, 214, "Swablu", blue)
screen:print(404, 234, "Numel", blue)
screen:print(404, 254, "Misdreveous", blue)
screen:print(404, 188, "->", blue)
counter = counter +1
if pad:r() and oldpad:r() ~= pad:r() and selecty == 188 and counter >= 25 then
	counter = 0
	dofile("./pokemon/hippopotas/hippopotas_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 208 and counter >= 25 then
	counter = 0
	dofile("./pokemon/swablu/swablu_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 228 and counter >=25 then
	counter = 0
	dofile("./pokemon/numel/numel_get.lua")
end
if pad:r() and oldpad:r() ~= pad:r() and selecty == 248 and counter >= 25 then
	counter = 0
	dofile("./pokemon/misdreveous/misdreveous_get.lua")
end

	if pad:right() and oldpad:right() ~= pad:right() and counter >= 25 then
		x = 0
		counter = 0
	end

end
screen.waitVblankStart()
screen.flip()



oldpad = pad
end