--Jewel Thief Version 0.10
--Coded by andyauff in lua
--Begun 8/25/07

screen:clear()
System.usbDiskModeActivate()
math.randomseed( os.time() )

busted = Image.load("Images/busted.png")

jewel1 = Image.load("Images/Jewels/gem1.png")
jewel2 = Image.load("Images/Jewels/gem2.png")
jewel3 = Image.load("Images/Jewels/gem3.png")

bg1 = Image.load("Images/Backgrounds/bg1.png")
bg2 = Image.load("Images/Backgrounds/bg2.png")
bg3 = Image.load("Images/Backgrounds/bg3.png")
bg4 = Image.load("Images/Backgrounds/bg4.png")
bg5 = Image.load("Images/Backgrounds/bg5.png")
bg6 = Image.load("Images/Backgrounds/bg6.png")
bg7 = Image.load("Images/Backgrounds/bg7.png")
bg8 = Image.load("Images/Backgrounds/bg8.png")
bg9 = Image.load("Images/Backgrounds/bg9.png")

thief_bk1 = Image.load("Images/Characters/Player/thief_bk1.png")
thief_bk2 = Image.load("Images/Characters/Player/thief_bk2.png")
thief_fr1 = Image.load("Images/Characters/Player/thief_fr1.png")
thief_fr2 = Image.load("Images/Characters/Player/thief_fr2.png")
thief_lf1 = Image.load("Images/Characters/Player/thief_lf1.png")
thief_lf2 = Image.load("Images/Characters/Player/thief_lf2.png")
thief_rt1 = Image.load("Images/Characters/Player/thief_rt1.png")
thief_rt2 = Image.load("Images/Characters/Player/thief_rt2.png")

enemy_bk1 = Image.load("Images/Characters/Enemy/enemy_bk1.png")
enemy_bk2 = Image.load("Images/Characters/Enemy/enemy_bk2.png")
enemy_fr1 = Image.load("Images/Characters/Enemy/enemy_fr1.png")
enemy_fr2 = Image.load("Images/Characters/Enemy/enemy_fr2.png")
enemy_lf1 = Image.load("Images/Characters/Enemy/enemy_lf1.png")
enemy_lf2 = Image.load("Images/Characters/Enemy/enemy_lf2.png")
enemy_rt1 = Image.load("Images/Characters/Enemy/enemy_rt1.png")
enemy_rt2 = Image.load("Images/Characters/Enemy/enemy_rt2.png")

ai1 = 1
ai2 = 2
ai3 = 3
ai4 = 4
level = 1
over = "false"
gem1 = "on"
gem2 = "on"
gem3 = "on"
gem4 = "on"
gem5 = "on"
gem6 = "on"
gem7 = "on"
gem8 = "on"
gem9 = "on"
gem10 = "on"
gem11 = "on"
gem12 = "on"
gem13 = "on"
gem14 = "on"
gem15 = "on"
gem16 = "on"
gem17 = "on"
gem18 = "on"
gem19 = "on"
gem20 = "on"
gem21 = "on"
gem22 = "on"
gem23 = "on"
enemy1_1 = "on"
enemy2_1 = "on"
enemy3_1 = "on"
enemy4_1 = "on"
enemy5_1 = "on"
enemy6_1 = "on"
enemy7_1 = "on"

--Set up player and enemy arrays--

player = {img = thief_fr1, x = 100, y = 200}

enemy1 = {img = enemy_fr1, x = 200, y = 100}
enemy2 = {img = enemy_fr1, x = 300, y = 50}
enemy3 = {img = enemy_fr1, x = 100, y = 150}
enemy4 = {img = enemy_fr1, x = 150, y = 200}

--Set up arrays for gems--

gem1_1 = {img = jewel1, x = math.random(30,100), y = math.random(50,200)}
gem1_2 = {img = jewel1, x = math.random(50,210), y = math.random(76,133)}
gem1_3 = {img = jewel1, x = math.random(250,400), y = math.random(33,100)}
gem1_4 = {img = jewel1, x = math.random(100,310), y = math.random(110,238)}

gem2_1 = {img = jewel2, x = math.random(300,380), y = math.random(150,240)}
gem2_2 = {img = jewel2, x = math.random(170,456), y = math.random(123,229)}
gem2_3 = {img = jewel2, x = math.random(40,250), y = math.random(188,218)}
gem2_4 = {img = jewel2, x = math.random(75,180), y = math.random(32,129)}

gem3_1 = {img = jewel3, x = math.random(99,340), y = math.random(10,199)}
gem3_2 = {img = jewel3, x = math.random(20,275), y = math.random(87,151)}
gem3_3 = {img = jewel3, x = math.random(180,370), y = math.random(64,230)}
gem3_4 = {img = jewel3, x = math.random(350,440), y = math.random(100,210)}

--Main Loop--

while true do

pad = Controls.read()

screen.waitVblankStart()
screen.flip()

dofile("game.lua")

end