dofile ("lua/libFenetre.lua")

RPGdatabase ()

img = Image.load("lua/images/digimon ľarena.PNG", VRAM)

bouton = Image.load("lua/images/Boutonmj1.PNG", VRAM)

bouton2 = Image.load("lua/images/Boutonmj2.PNG", VRAM)


fond = Image.load("lua/images/fond.png", VRAM)

x = 0
y = 0

Sound.loadBank("lua/son/soundbank.bin")
-- Load all mods and sfx in ram
Sound.loadSFX(0)
Sound.startSFX(0)

while true do
startDrawing()
	Controls.read()

if Stylus.released and Stylus.X > 20 and Stylus.X < 200 and Stylus.Y > 0 and Stylus.Y < 64 then
Image.destroy(img)
img = nil
Image.destroy(bouton)
bouton = nil
Image.destroy(bouton2)
bouton2 = nil
Image.destroy(fond)
fond = nil
x = nil
y = nil
var = nil
Sound.unloadSFX(0)
Sound.unloadBank()
dofile("lua/DigiDash.lua")
end

if Stylus.released and Stylus.X > 20 and Stylus.X < 220 and Stylus.Y > 120 and Stylus.Y < 184 then
Image.destroy(img)
img = nil
Image.destroy(bouton)
bouton = nil
Image.destroy(bouton2)
bouton2 = nil
Image.destroy(fond)
fond = nil
x = nil
y = nil
var = nil
Sound.unloadSFX(0)
Sound.unloadBank()
Sound.unloadSFX(0)
Sound.unloadBank()
dofile("lua/Get Egg.lua")
end


	screen.blit(SCREEN_DOWN, 0, 0, fond)
	screen.blit(SCREEN_UP, x, y, img)
	screen.blit(SCREEN_DOWN, 20, 0, bouton)
    screen.blit(SCREEN_DOWN, 20, 120, bouton2)

stopDrawing()

end


Image.destroy(img)
img = nil
Image.destroy(bouton)
bouton = nil
Image.destroy(bouton2)
bouton2 = nil
Image.destroy(bouton3)
bouton3 = nil
Image.destroy(bouton4)
bouton4 = nil
Image.destroy(bouton5)
bouton5 = nil
Image.destroy(bouton6)
bouton6 = nil
Image.destroy(fond)
fond = nil
Image.destroy(curseur)
curseur = nil
x = nil
y = nil
Sound.unloadSFX(0)
Sound.unloadBank()
