global  WhichGame
global Initialcard6
global InitialYet



on Opencard 1
disable menu "Options"
disable menu "Index"
ExplanationMenuName help
put 0 into grade_level
put 0 into thefirsttime
put 0 into InitialYet
wait 1 ticks
play windx
wait 1 seconds
play pyu_
set bitmap of btn bigger1 to bigger2 
wait 1 ticks
repeat 2 times
set bitmap of btn bigger1 to bigger3 
wait 7 ticks
set bitmap of btn bigger1 to bigger4 
wait 5 ticks
set bitmap of btn bigger1 to bigger5 
wait 5 ticks
set bitmap of btn bigger1 to bigger4 
wait 7 ticks
end repeat
set bitmap of btn bigger1 to bigger3 
wait 5 ticks
set bitmap of btn bigger1 to bigger4 
wait 6 ticks
set bitmap of btn bigger1 to bigger5 
wait 7 ticks
set bitmap of btn bigger1 to bigger6



set loc of btn satelite to 680, 274
show btn satelite
play ufo
--repeat with i = 1 to 40
--set loc of btn satelite to 680 - (i-1)*20, 274 + (346-274)/34 *(i - 1)
--if i = 30 then
--  play asianpo1
--end if
--end repeat
set loc of btn satelite to -30, 49
show btn satelite
set loc of btn satelite to 10, 109
set loc of btn satelite to 30, 151
set loc of btn satelite to 72, 205
set loc of btn satelite to 113, 255
set loc of btn satelite to 187, 308
set loc of btn satelite to 267, 349
set loc of btn satelite to 387, 359
set loc of btn satelite to 485, 319
set loc of btn satelite to 508, 277
set loc of btn satelite to 509, 246
set loc of btn satelite to 456, 224
set loc of btn satelite to 396, 226
set loc of btn satelite to 369, 242
--set loc of btn satelite to 383, 272
--set loc of btn satelite to 429, 266
--set loc of btn satelite to 429, 252
--set loc of btn satelite to 415, 242
--wait 30 ticks
hide btn satelite
play pyu_
wait 10 ticks
set bitmap of btn bigger1 to bigger6 
wait 20 ticks
set bitmap of btn bigger1 to bigger5 
wait 20 ticks
set bitmap of btn bigger1 to bigger4
wait 20 ticks
set bitmap of btn bigger1 to bigger3
wait 20 ticks
set bitmap of btn bigger1 to bigger2
wait 20 ticks
set bitmap of btn bigger1 to bigger1
wait 20 ticks


show btn title

play asianpo1
--show btn allright
wait 200 ticks
show btn narator
wait 100 ticks
put 1 into ntx
play alright
naratoranimex

wait 200 ticks
go cd 9
end Opencard

On satelitemove2
repeat with i = 1 to 200
lock screen
set loc of btn satelite to 670 - (i-1)*10, 133-30
set loc of btn allright to 670 - (i-1)*10 + 340, 133+107-30
unlock screen
wait 1 ticks
if  i = 25 then
play horncall
end if
if 670 - (i -1) * 10 + 340 < 295 then
exit repeat
end if
if mouseclick() then
 exit satelitemove2
end if
end repeat
End satelitemove2


On Other27s_back



     go cd 7
     set loc of btn other27s to -200, 466
     show btn other27s
      put (669 + 200)/10 into k
    repeat with i = 1 to k
    set loc of btn other27s to -200 + (i-1)*10, 466 - (466 +80)/k *(i-1)
     if i = 10 then
       play horncall
     end if
     wait 2 ticks
     if mouseclick() then
   exit repeat
   end if
    end repeat

     go cd 4
     set loc of btn other27s to -200, 380
    show btn other27s
      put (669 + 200 + 200)/10 into k

    repeat with i = 1 to k
     set loc of btn other27s to -200 + (i-1)*10, 380 - (380-100)/k *(i-1)
 if i = 10 then
  play Hallel2
  end if
  if mouseclick() then
   exit repeat
     end if

     end repeat


End Other27s_back



On gocd3andopen
go cd 3
refreshcd3

End gocd3andopen


On ss033moveinitial
put (x0 -xm)/15 into k
play windx
repeat with i = 1 to k
 set loc of btn ss033 to x0 - (i-1)*15 , y0 + (ym - y0)/k * (i -1 ) 
end repeat
End ss033moveinitial

On ss033moveLast
ss033setnormal
put (x0 -xe)/15 into k 
play windx
repeat with i = 1 to k
 set loc of btn ss033 to x0 - (i-1)*15, y0 + (ye - y0)/k * (i-1)
end repeat
End ss033moveLast

On ss033setFirst
put (424 + 217) / 2 into xm
put (349 + 116) /2 into ym
put 424 into x0
put 116 into y0
set loc of btn ss033 to x0, y0
set loc of btn cover6 to 320, 219
End ss033setFirst
On ss033setnormal
put 217  into xe
put 349 into ye
put (424 + 217) / 2 into x0
put (349 + 116) /2 into y0
set loc of btn ss033 to x0, y0
set loc of btn cover6 to 320, 219
end ss033setnormal


-------------------card3------------------------
On notabletogo
End notabletogo

On set_gradel
play switchb

 put 0 into grade_level
End set_gradel

On set_gradem
play switchb

 put 1 into grade_level
End set_gradem

On set_gradeh
play switchb

 put 2 into grade_level
End set_gradeh





On initialize
put 2 into step1_1
put 36 into step1_2
put 3 into step2_1
put 1 into step2_2
put 0 into step2_egg
put 4 into step3_1
put 19 into step3_2
put 2 into step3_3
put 20 into step3_4
put 5 into step4_1
put 3 into step4_2
put 6 into step5_1
put 4 into step5_2
put 0 into step5_egg
put 7 into step6_1
put 5 into step6_2
put 8 into step7_1
put 6 into step7_2
put 28 into step7_3
put 29 into step7_4
put 9 into step8_1
put 7 into step8_2
put 0 into step8_egg
put 10 into step9_1
put 8 into step9_2
put 11 into step10_1
put 9 into step10_2
put 12 into step11_1
put 10 into step11_2
put 32 into step11_3
put 24 into step11_4
put 33 into step11_5
put 25 into step11_6
put 13 into step12_1
put 11 into step12_2
put 14 into step13_1
put 12 into step13_2
put 15 into step14_1
put 13 into step14_2
put 0 into step14_egg
put 999 into step15_1
put 14 into step15_2
put 17 into step16_1
put 36 into step16_2
put 37 into step16_3
put 18 into step17_1
put 16 into step17_2
put 19 into step18_1
put 17 into step18_2
put 0 into step18_egg
put 3 into step19_1
put 18 into step19_2
put 21 into step20_1
put 3 into step20_2
put 22 into step21_1
put 20 into step21_2
put 0 into step21_egg
put 23 into step22_1
put 21 into step22_2
put 0 into step22_egg
put 24 into step23_1
put 22 into step23_2
put 0 into step23_egg
put 11 into step24_1
put 23 into step24_2
put 26 into step25_1
put 11 into step25_2
put 0 into step25_egg
put 999 into step26_1
put 25 into step26_2
put 0 into step26_egg
put 28 into step27_1
put 37 into step27_2
put 7 into step28_1
put 27 into step28_2
put 0 into step28_egg
put 30 into step29_1
put 7 into step29_2
put 31 into step30_1
put 29 into step30_2
put 32 into step31_1
put 30 into step31_2
put 0 into step31_egg
put 11 into step32_1
put 31 into step32_2
put 0 into step32_egg
put 34 into step33_1
put 11 into step33_2
put 35 into step34_1
put 33 into step34_2
put 0 into step34_egg
put 999 into step35_1
put 34 into step35_2
put 1 into step36_1
put 16 into step36_2
put 37 into step36_3
put 27 into step37_1
put 16 into step37_2
put 36 into step37_3
put 18000 into final_time
put 720 into limit_time
put 1 into correct_ans
put 1 into math_answer
put 600 into math_time
--------------------------------------------------
put 0 into step38_egg
put 0 into step39_egg
put 0 into step41_egg
put 0 into step42_egg
put 1 into step43_egg
put 1 into step44_egg
put 0 into step45_egg
put 0 into step46_egg
put 0 into step47_egg
put 0 into step49_egg
put 0 into step50_egg
put 0 into step51_egg
---------------------------------
put 2 into eggnumber
put 0 into crackedegg
put 50 into maxcrackedegg
put 8 into maxeggnumber
-----------------------------
put 0 into zone1
put 0 into zone2
put 0 into zone3
put 0 into zone4
put 0 into zone5
put 0 into zone6
put 0 into zone7
put 0 into zone8
-----------------------
put 0 into dragontimeup
put 0 into selectedzone
put 0 into clicked
put 0 into game_on
repeat with xxx = 1 to 101
 put 0 into Item xxx of xquiztbl
end repeat
put 0 into quizongoing

put 0 into thnderbridge24
put 0 into thnderbridge21



End initialize

On finalize
wait 10 ticks
End finalize

On clickfrogbutton
  click at clickh(), clickv()
end clickfrogbutton


On witchanime1
repeat w1x times
if mouseclick() then
  put 999 into xend
  exit witchanime1
end if

set bitmap of btn witchl1 to witchl2
if random(10) = 1 then
   wait 6 ticks
else 
   wait 10 ticks
end if
set bitmap of btn witchl1 to witchl1
if random(25) = 8 then
   wait 15 ticks
else
wait 10 ticks

end if
set bitmap of btn witchl1 to witchl3
if random(30) = 1 then
   wait 20 ticks
else
wait 10 ticks

end if

set bitmap of btn witchl1 to witchl1
wait 10 ticks
if mouseclick() then
  put 999 into xend
  exit witchanime1
end if
set bitmap of btn witchl1 to witchl2
wait 10 ticks
if random(20) = 8 then
   wait 15 ticks
end if
set bitmap of btn witchl1 to witchl1
wait 10 ticks
end repeat
End witchanime1


On witchanime2
repeat with j = 1 to 4
if mouseclick() then
  exit witchanime2
end if
set bitmap of btn witch1 to witch2
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
set bitmap of btn witch1 to witch3
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
if mouseclick() then
  exit witchanime2
end if
set bitmap of btn witch1 to witch2
wait 6 ticks
if random(15) = 8 then
  wait 15 ticks
end if
set bitmap of btn witch1 to witch1
wait 6 ticks
end repeat
End witchanime2


On witchanime3
repeat with j = 1 to w3x
if mouseclick() then
  exit witchanime3
end if
set bitmap of btn witch1 to witch2
wait 10 ticks
if mouseclick() then
   put 999 into xend 
   exit witchanime3
end if
set bitmap of btn witch1 to witch1
wait 10 ticks
set bitmap of btn witch1 to witch3
wait 10 ticks
set bitmap of btn witch1 to witch1
wait 10 ticks
if mouseclick() then
   put 999 into xend 
   exit witchanime3
end if
set bitmap of btn witch1 to witch2
wait 10 ticks
set bitmap of btn witch1 to witch1
wait 10 ticks
end repeat
End witchanime3


On witchspranime
repeat 5 times
set bitmap of btn witch1 to wichspra
wait 2 ticks
set bitmap of btn witch1 to wichsprb
wait 2 ticks
set bitmap of btn witch1 to wichsprc
wait 2 ticks
set bitmap of btn witch1 to wichsprd
wait 2 ticks
set bitmap of btn witch1 to wichspre
wait 2 ticks
end repeat
set bitmap of btn witch1 to witchspr
wait 10 ticks
End witchspranime

On Showwitch_surprised
put 0 into surprised
End Showwitch_surprised

On show_frog_good
put 3 into ntx
naratoranimex
wait 30 ticks
End show_frog_good


On k_froganime2
repeat with j = 1 to 2
set bitmap of btn satelite to satelite
wait 2 ticks
set bitmap of btn satelite to k_frog3
wait 2 ticks
set bitmap of btn satelite to k_frog4
wait 2 ticks
set bitmap of btn satelite to k_frog3
wait 2 ticks
end repeat
set bitmap of btn satelite to k_frog2
wait 2 ticks

End k_froganime2


On k_froganime3
   put 0 into xend

repeat with j = 1 to f3x
if mouseclick() then
  put 999 into xend
exit k_froganime3
end if
set bitmap of btn narator1 to narator1
wait 7 ticks
set bitmap of btn narator1 to narator2
wait 7 ticks
set bitmap of btn narator1 to narator3
wait 7 ticks
set bitmap of btn narator1 to narator2
wait 7 ticks
end repeat
set bitmap of btn narator1 to narator1
wait 7 ticks

End k_froganime3





On kiddyanime
if xend = 999 then
    exit kiddyanime
end if
set bitmap of btn witch1 to kiddy1
wait 10 ticks
set bitmap of btn witch1 to kiddy2
wait 10 ticks
set bitmap of btn witch1 to kiddy3
wait 10 ticks
repeat with j = 1 to 3
if mouseclick() then
   put 999 into xend
   exit kiddyanime 
end if
set bitmap of btn witch1 to kiddy4
wait 5 ticks
set bitmap of btn witch1 to kiddy5
wait 5 ticks
set bitmap of btn witch1 to kiddy4
wait 5 ticks
set bitmap of btn witch1 to kiddy3
wait 5 ticks
end repeat

end kiddyanime




On kiddyanime16
if xend = 999 then
    exit kiddyanime16
end if
set bitmap of btn kiddy1 to kiddy1
wait 5 ticks
set bitmap of btn kiddy1 to kiddy2
wait 5 ticks
set bitmap of btn kiddy1 to kiddy3
wait 5 ticks
repeat with j = 1 to 4
if mouseclick() then
   put 999 into xend
   exit kiddyanime16 
end if
set bitmap of btn kiddy1 to kiddy4
wait 5 ticks
set bitmap of btn kiddy1 to kiddy5
wait 5 ticks
set bitmap of btn kiddy1 to kiddy4
wait 5 ticks
set bitmap of btn kiddy1 to kiddy3
wait 5 ticks
end repeat

end kiddyanime16








On mdragonanime1
repeat with j = 1 to 3
set bitmap of btn mdragon1 to mdragon2
wait 10 ticks
set bitmap of btn mdragon1 to mdragon3
wait 10 ticks
set bitmap of btn mdragon1 to mdragon2
wait 10 ticks
set bitmap of btn mdragon1 to mdragon1
wait 10 ticks
end repeat
end mdragonanime1



On ldragonanime
repeat with j = 1 to 3
set bitmap of btn ldragon1 to ldragon2
wait 10 ticks
set bitmap of btn ldragon1 to ldragon3
wait 10 ticks
set bitmap of btn ldragon1 to ldragon2
wait 10 ticks
set bitmap of btn ldragon1 to ldragon1
wait 10 ticks
end repeat
end ldragonanime




On k_froganime1
set the loc of btn k_froga to 93,318
show btn k_froga
repeat with j = 1 to 6
set bitmap of btn k_froga to k_frogc
wait 2 ticks
set bitmap of btn k_froga to k_frogd
wait 2 ticks
set bitmap of btn k_froga to k_frogc
wait 2 ticks
set bitmap of btn k_froga to k_froga
wait 2 ticks
end repeat
set bitmap of btn k_froga to k_frogb
wait 100 ticks
set the loc of btn k_froga to -250,318

set bitmap of btn k_froga to k_froga
hide btn k_froga

End k_froganime1


On naratoranime
show btn narator1
repeat 3 times
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator1
wait 5 ticks
if random(10) = 8 then
 wait 10 ticks
end if
set bitmap of btn narator1 to narator2
wait 5 ticks
set bitmap of btn narator1 to narator3
wait 5 ticks
if random(10) = 8 then
 wait 10 ticks
end if
end repeat

End naratoranime

On naratoranimex
show btn narator1
repeat ntx times
set bitmap of btn narator1 to narator2
wait 5 ticks
if mouseclick() then
 exit naratoranimex
end if
if random(15) = 8 then
 wait 10 ticks
if mouseclick() then
 exit naratoranimex
end if
end if
set bitmap of btn narator1 to narator1
wait 5 ticks
if random(15) = 8 then
 wait 10 ticks
if mouseclick() then
 exit naratoranimex
end if
end if
set bitmap of btn narator1 to narator2
wait 5 ticks
if mouseclick() then
 exit naratoranimex
end if
set bitmap of btn narator1 to narator3
wait 5 ticks
if random(15) = 8 then
 wait 10 ticks
if mouseclick() then
 exit naratoranimex
end if
end if
end repeat

End naratoranimex



On naratoranimedummy
show btn narator1
repeat 3 times
set bitmap of btn narator1 to narator1
wait 5 ticks
set bitmap of btn narator1 to narator1
wait 5 ticks
end repeat

End naratoranimedummy







On opencard 3
---------------testing
if testingxyz  = 1 and game_on = 1 then

   put 2 into thnderbridge21 
end if
if testingxyz  = 2 and game_on = 1  then

   put 2 into thnderbridge24 
end if

---------------------


if game_on = 1 or game_on = 2 then

lock screen

if thnderbridge24 = 1 then
  set bitmap of btn stp24 to stp24_2
end if
if thnderbridge24 = 2 then
  set bitmap of btn stp24 to stp24_3
end if
if thnderbridge24 = 3 then
  set bitmap of btn stp24 to stp24_4
end if

if thnderbridge21 = 1 then
  set bitmap of btn stp21 to stp21_2
end if
if thnderbridge21 = 2 then
  set bitmap of btn stp21 to stp21_3
end if
if thnderbridge21 = 3 then
  set bitmap of btn stp21 to stp21_4
end if



set the loc of btn satelite to locH of btn %frogloc%, locV of btn %frogloc%
show btn satelite



unlock screen





All_Egg_REfresh2
SoundRandom


end if




------------tesintg

if testingxyz  = 3 and game_on = 1 then
put 15 into frogloc
put 0 into  testingxyz  
end if

--------------------






if game_on = 1  then
 put random(20) into x
---------------------------testing
if testingxyz  = 1 then

   put 1 into x
put 0 into  testingxyz  
end if
if testingxyz  = 2 then

   put 3 into x
put 0 into  testingxyz  
end if
--------------------------
 if x = 1 or x=2 then
      lock screen
      set loc of btn thnder21 to 368, 246
      unlock screen
      play thunder
      repeat 2 times
     show btn thnder21
      hide btn thnder21
      end repeat
     put thnderbridge21 +1 into thnderbridge21
        if thnderbridge21 = 1 then
          set bitmap of btn stp21 to stp21_2
        end if
        if thnderbridge21 = 2 then
         set bitmap of btn stp21 to stp21_3
         end if
        if thnderbridge21 = 3 then
         set bitmap of btn stp21 to stp21_4
        if ((frogloc >= 17 and frogloc <= 21) or (frogloc <= 3 and frogloc >= 1)) then
           if  time_resque = 999 then
             game_over
            exit opencard
           else
             go cd 17

              exit opencard

       end if
-----
      end if 
    end if

   wait 30 ticks
end if

if x = 3 or x = 4 then
  lock screen
  set loc of btn thnder24 to 542, 181
  unlock screen
  play thunder
  repeat 2 times
  show btn thnder24
  hide btn thnder24
  end repeat
  put thnderbridge24 +1 into thnderbridge24
  if thnderbridge24 = 1 then
   set bitmap of btn stp24 to stp24_2
  end if
  if thnderbridge24 = 2 then
    set bitmap of btn stp24 to stp24_3
  end if
  if thnderbridge24 = 3 then
    set bitmap of btn stp24 to stp24_4
    if ((frogloc >= 17 and frogloc <= 24) or (frogloc <= 3 and frogloc >= 1)) then
      if  time_resque = 999 then
        game_over
        exit opencard
      else
       go cd 18

         exit opencard
     end if
   end if
  end if
wait 30 ticks
end if


if  x = 5  or x > 10 then
dragonlittlemove
end if

if  x = 6    and random(2) = 1 then
rafolnksmove
end if

if  x = 7   and random(2) = 1 then
Sanyomove
end if

if  x = 8    and random(2) = 1 then
Taiyochumove
end if


if  x = 9    then
ty_an12move
end if

if  x = 10   then
c64auafmove
end if
--if game_on = 1 then
--checkroute
--end if

--put 1 into game_on

end if



if game_on = 0 then
lock screen
set loc of btn satelite to 630, 71
show btn satelite
unlock screen
--------------
play ufo
set loc of btn satelite to 630, 71
set loc of btn satelite to 521, 95
set loc of btn satelite to 391, 121
set loc of btn satelite to 268, 146
set loc of btn satelite to 181, 155
set loc of btn satelite to 138, 174
set loc of btn satelite to 136, 191
set loc of btn satelite to 173, 204
set loc of btn satelite to 245, 213
set loc of btn satelite to 345, 209
set loc of btn satelite to 404, 190
set loc of btn satelite to 408, 174
set loc of btn satelite to 354, 158
set loc of btn satelite to 248, 149
set loc of btn satelite to 150, 160
set loc of btn satelite to 85, 182
set loc of btn satelite to 37, 220
set loc of btn satelite to 28, 254
set loc of btn satelite to 41, 297
set loc of btn satelite to 104, 339
set loc of btn satelite to 195, 377
set loc of btn satelite to 285, 391
set loc of btn satelite to 401, 396
if initialroute = 1 then
set loc of btn satelite to 473, 386
set loc of btn satelite to 541, 362
set loc of btn satelite to 584, 342
else
set loc of btn satelite to 435, 377
set loc of btn satelite to 431, 365
set loc of btn satelite to 393, 360
set loc of btn satelite to 355, 356
set loc of btn satelite to 319, 366
set loc of btn satelite to 315, 383
set loc of btn satelite to 352, 408
set loc of btn satelite to 392, 418
set loc of btn satelite to 429, 424
end if
---------------

  put 1 into game_on



end if









put 0 into xend
End opencard

--------------------------------------------
On returncard3
go cd 3
refreshcd3

exit returncard3
end returncard3

On All_Egg_REfresh
lock screen
put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
unlock screen

End All_Egg_REfresh



On All_Egg_REfresh2
put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg

End All_Egg_REfresh2



On opencard 8
lock screen
if game_on = 1 then
SoundRandom


put step2_egg into egg_cond_number

put 2 into target_egg
refreshegg
put step5_egg into egg_cond_number
put 5 into target_egg
refreshegg
put step8_egg into egg_cond_number
put 8 into target_egg
refreshegg
put step14_egg into egg_cond_number
put 14 into target_egg
refreshegg
put step18_egg into egg_cond_number
put 18 into target_egg
refreshegg
put step21_egg into egg_cond_number
put 21 into target_egg
refreshegg
put step22_egg into egg_cond_number
put 22 into target_egg
refreshegg
put step23_egg into egg_cond_number
put 23 into target_egg
refreshegg
put step25_egg into egg_cond_number
put 25 into target_egg
refreshegg
put step26_egg into egg_cond_number
put 26 into target_egg
refreshegg
put step28_egg into egg_cond_number
put 28 into target_egg
refreshegg
put step31_egg into egg_cond_number
put 31 into target_egg
refreshegg
put step32_egg into egg_cond_number
put 32 into target_egg
refreshegg
put step34_egg into egg_cond_number
put 34 into target_egg
refreshegg
--------------------------------------------------
put step38_egg into egg_cond_number

put 38 into target_egg
refreshegg
put step39_egg into egg_cond_number
put 39 into target_egg
refreshegg
put step41_egg into egg_cond_number
put 41 into target_egg
refreshegg
put step42_egg into egg_cond_number
put 42 into target_egg
refreshegg
put step43_egg into egg_cond_number
put 43 into target_egg
refreshegg
put step44_egg into egg_cond_number
put 44 into target_egg
refreshegg
put step45_egg into egg_cond_number
put 45 into target_egg
refreshegg
put step46_egg into egg_cond_number
put 46 into target_egg
refreshegg
put step47_egg into egg_cond_number
put 47 into target_egg
refreshegg
put step49_egg into egg_cond_number
put 49 into target_egg
refreshegg
put step50_egg into egg_cond_number
put 50 into target_egg
refreshegg
put step51_egg into egg_cond_number
put 51 into target_egg
refreshegg
else
put 0 into game_on
end if

if frogloc  = 24 or  frogloc = 32 or frogloc = 10 then
wait 1 ticks
else
set the loc of btn satelite to locH of btn %frogloc%, locV of btn %frogloc%
show btn satelite
end if



unlock screen

put 0 into xend
End opencard





--------------------------------------------




On refreshegg
if egg_cond_number = 1 then 
   set bitmap of btn %target_egg% to egg
   show btn %target_egg% 
else
   if egg_cond_number = 2 then
   set bitmap of btn %target_egg% to crackegg
   show btn %target_egg% 
   end if
   if egg_cond_number = 3 then
   set bitmap of btn %target_egg% to mdragon1
   show btn %target_egg% 
   end if
end if
   
End refreshegg










On kingdomtest
initialize
put 1 into game_on
put 0 into timecounter
lock screen
--hide btn 64
--show btn 66
hide btn 67
--hide btn gradeh
--hide btn gradem
--hide btn gradel
--hide fld easy
--hide fld soso
--hide fld hard
set the loc of btn satelite to 565,251
show btn satelite
unlock screen
if grade_level = 0 then
  put 10 into dragontimes
  put 14 into responselimit
  put 17 into  maxeggnumber
end if
if grade_level = 1 then
  put 7 into dragontimes
  put 12 into responselimit
  put 14 into  maxeggnumber
end if
if grade_level = 2 then
  put 6 into dragontimes
  put 11 into responselimit
  put 12 into  maxeggnumber
end if

repeat with pointx = 1 to 12
  put 0 into Item pointx of checkcardlist
 end repeat  
put 0 into  minimum_level

SoundRandom
put random(3) into initialroute
if initialroute = 1 then
    put 25 into frogloc
     step25
  else
    if initialroute = 2 then
          put 25 into frogloc
          step25
     else
          put  25 into frogloc
          step25
     end if
 end if
End kingdomtest















On kingdom
play synthri

initialize
put 0 into game_on
put 0 into timecounter
put 0 into time_resque
put 0 into gamestptemporary
if grade_level = 0 then
  put 6 into dragontimes
  put 35 into responselimit
  put 13 into  maxeggnumber
end if
if grade_level = 1 then
  put 3 into dragontimes
  put 30 into responselimit
  put 10 into  maxeggnumber
end if
if grade_level = 2 then
  put 3 into dragontimes
  put 25 into responselimit
  put 10 into  maxeggnumber
end if

repeat with pointx = 1 to 12
  put 0 into Item pointx of checkcardlist
 end repeat  
put 0 into  minimum_level

SoundRandom
put random(2) into initialroute
if initialroute = 1 then
    put 1 into frogloc
  else
    put 17 into frogloc
 end if
   go cd 3
refreshcd3

 click at btn %frogloc%
 exit kingdom
End kingdom




On checkegg

if crackedegg < maxcrackedegg then
put random(26) into j
repeat 2 times
 
if quiz_quit = 1 then
   exit repeat
end if
if  step2_egg = 1 and j < 1 then
    set bitmap of btn 2 to crackegg
    put 2 into step2_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if

if   step5_egg = 1 and j < 2 then
    set bitmap of btn 5 to crackegg
    put 2 into step5_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step8_egg = 1 and j < 3 then
    set bitmap of btn 8 to crackegg
    put 2 into step8_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
----------------------Adjustment 11/15/2000
--if   step14_egg = 1 and j < 4 then
--    set bitmap of btn 14 to crackegg
--    put 2 into step14_egg
--    put crackedegg + 1 into crackedegg
--    exit repeat
--end if
if  step18_egg = 1  and j < 5 then
    set bitmap of btn 18 to crackegg
    put 2 into step18_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step21_egg = 1  and j < 6 then
    set bitmap of btn 21 to crackegg
    put 2 into step21_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
----------------------Adjustment 11/15/2000
--if   step22_egg = 1 and j < 7 then
--    set bitmap of btn 22 to crackegg
--    put 2 into step22_egg
--    put crackedegg + 1 into crackedegg
--    exit repeat
--end if
--if   step23_egg = 1 and j < 8 then
--    set bitmap of btn 23 to crackegg
--    put 2 into step23_egg
--    put crackedegg + 1 into crackedegg
--    exit repeat
--end if
if   step25_egg = 1 and j < 9 then
    set bitmap of btn 25 to crackegg
    put 2 into step25_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step26_egg = 1 and j < 10 then
    set bitmap of btn 26 to crackegg
    put 2 into step26_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step28_egg = 1 and j < 11 then
    set bitmap of btn 28 to crackegg
    put 2 into step28_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step31_egg = 1 and j < 12 then
    set bitmap of btn 31 to crackegg
    put 2 into step31_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step32_egg = 1 and j < 13 then
    set bitmap of btn 32 to crackegg
    put 2 into step32_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step34_egg = 1 and j < 14 then
    set bitmap of btn 34 to crackegg
    put 2 into step34_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if


if   step38_egg = 1 and j < 15 then
    set bitmap of btn 38 to crackegg
    put 2 into step38_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step39_egg = 1 and j < 16 then
    set bitmap of btn 39 to crackegg
    put 2 into step39_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step41_egg = 1 and j < 17 then
    set bitmap of btn 41 to crackegg
    put 2 into step41_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step42_egg = 1 and j < 18 then
    set bitmap of btn 42 to crackegg
    put 2 into step42_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step43_egg = 1 and j < 19 then
    set bitmap of btn 43 to crackegg
    put 2 into step43_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
 if  step44_egg = 1 and j < 20  then
    set bitmap of btn 44 to crackegg
    put 2 into step44_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
 if  step45_egg = 1 and j < 21  then
    set bitmap of btn 45 to crackegg
    put 2 into step45_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step46_egg = 1 and j < 22  then
    set bitmap of btn 46 to crackegg
    put 2 into step46_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step47_egg = 1 and j < 23  then
    set bitmap of btn 47 to crackegg
    put 2 into step47_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step49_egg = 1 and j < 24  then
    set bitmap of btn 49 to crackegg
    put 2 into step49_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step50_egg = 1 and j < 25  then
    set bitmap of btn 50 to crackegg
    put 2 into step50_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
if   step51_egg = 1 and j < 26  then
    set bitmap of btn 51 to crackegg
    put 2 into step51_egg
    put crackedegg + 1 into crackedegg
    exit repeat
end if
put 0 into j
end repeat
end if

if  eggnumber >= maxeggnumber  and  quizongoing = 0 then
Game_Over
exit checkegg
end if


End checkegg

 
On checkzone1
if zone1 = 0 then
put random(6) into j
repeat with i = 1 to 6
if  step38_egg = 0  and j = 1 then
    show btn 38
    set bitmap of btn 38  to egg
    put 1 into step38_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step39_egg = 0  and j = 2 then
    show btn 39
    set bitmap of btn 39 to egg
    put 1 into step39_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step26_egg = 0  and j = 3 and frogloc is not 26 then
    show btn 26 
    set bitmap of btn 26 to egg
    put 1 into step26_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step25_egg = 0  and j = 4 and frogloc is not 25 then
    show btn 25 
    set bitmap of btn 25 to egg
    put 1 into step25_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step34_egg = 0  and j = 5 and frogloc is not 34 then
    show btn 34 
    set bitmap of btn 34 to egg
    put 1 into step34_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
----------------------Adjustment 11/15/2000
--if  step14_egg = 0  and j = 6 and frogloc is not 14 then
--    show btn 14 
--    set bitmap of btn 14 to egg
--    put 1 into step14_egg
--    put eggnumber + 1 into eggnumber
--    exit repeat
--end if

put j + 1 into j

if j > 6 then
put 1 into j
end if

end repeat
end if 

if step38_egg = 1 and step39_egg = 1  and step26_egg = 1  and step25_egg = 1  and step34_egg = 1  and step14_egg = 1 then
put 1 into zone1
end if

end checkzone1


On checkzone2
if zone2 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step41_egg = 0  and j = 1 then
    show btn 41 
    set bitmap of btn 41 to egg
    put 1 into step41_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step42_egg = 0  and j = 2 then
    show btn 42 
    set bitmap of btn 42 to egg
    put 1 into step42_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
----------------------Adjustment 11/15/2000
--if  step23_egg = 0  and j = 3 and frogloc is not 23 then
--    show btn 23 
--    set bitmap of btn 23 to egg
--    put 1 into step23_egg
--    put eggnumber + 1 into eggnumber
--    exit repeat
--end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if step41_egg = 1 and step42_egg = 1  and step23_egg = 1 then
put 1 into zone2
end if

end checkzone2


On checkzone3
if zone3 = 0 then
put random(4) into j
repeat with i = 1 to 4
if  step43_egg = 0  and j = 1 then
    show btn 43
    set bitmap of btn 43 to egg
    put 1 into step43_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step44_egg = 0  and j = 2 then
    show btn 44 
    set bitmap of btn 44 to egg
    put 1 into step44_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step31_egg = 0  and j = 3 and frogloc is not 31 then
    show btn 31 
    set bitmap of btn 31 to egg
    put 1 into step31_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

if  step32_egg = 0  and j = 4 and frogloc is not 32 then
    show btn 32 
    set bitmap of btn 32 to egg
    put 1 into step32_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if


put j + 1 into j

if j > 4 then
put 1 into j
end if

end repeat
end if 


if  step43_egg = 1  and step44_egg = 1  and step31_egg = 1  and step32_egg = 1 then
put 1 into zone3
end if

end checkzone3


On checkzone4
if zone4 = 0 then
put random(3) into j
repeat with i = 1 to 3
--if  step21_egg = 0  and j = 1 and frogloc is not 21 then
--    show btn 21 
--    set bitmap of btn 21 to egg
--    put 1 into step21_egg
--    put eggnumber + 1 into eggnumber
--    exit repeat
--end if
----------------------Adjustment 11/15/2000

--if  step22_egg = 0  and j = 2 and frogloc is not 22 then
--    show btn 22 
--    set bitmap of btn 22 to egg
--    put 1 into step22_egg
--    put eggnumber + 1 into eggnumber
--    exit repeat
--end if
if  step50_egg = 0  and j = 3 then
    show btn 50 
    set bitmap of btn 50 to egg
    put 1 into step50_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if  step21_egg = 1  and step22_egg = 1  and step50_egg = 1 then
put 1 into zone4
end if

end checkzone4


On checkzone5
if zone5 = 0 then
put random(3) into j
repeat with i = 1 to 3
if  step49_egg = 0  and j = 1 then
    show btn 49 
    set bitmap of btn 49 to egg
    put 1 into step49_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step2_egg = 0  and j = 2 and frogloc is not 2 then
    show btn 2 
    set bitmap of btn 2 to egg
    put 1 into step2_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step18_egg = 0  and j = 3 and frogloc is not 18  then
    show btn 18 
    set bitmap of btn 18 to egg
    put 1 into step18_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 3 then
put 1 into j
end if

end repeat
end if 

if  step49_egg = 1  and step2_egg = 1  and step18_egg = 1 then
put 1 into zone5
end if

end checkzone5



On checkzone6
if zone6 = 0 then
put random(2) into j
repeat with i = 1 to 2
if  step5_egg = 0  and j = 1 then
    show btn 5 
    set bitmap of btn 5 to egg
    put 1 into step5_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step51_egg = 0  and j = 2 then
    show btn 51 
    set bitmap of btn 51 to egg
    put 1 into step51_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

put j + 1 into j

if j > 2 then
put 1 into j
end if

end repeat
end if 

if  step5_egg = 1  and step51_egg = 1 and frogloc is not 5  then
put 1 into zone6
end if

end checkzone6

On checkzone7
if zone7 = 0 then

if  step47_egg = 0   then
    show btn 47 
    set bitmap of btn 47 to egg
    put 1 into step47_egg
    put eggnumber + 1 into eggnumber
    
end if
    put 1 into zone7
end if


end checkzone7


On checkzone8
if zone8 = 0 then
put random(4) into j
repeat with i = 1 to 4
if  step8_egg = 0  and j = 1 and frogloc is not 8 then
    show btn 8
    set bitmap of btn 8 to egg
    put 1 into step8_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step45_egg = 0  and j = 2 then
    show btn 45 
    set bitmap of btn 45 to egg
    put 1 into step45_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if
if  step46_egg = 0  and j = 3 then
    show btn 46 
    set bitmap of btn 46 to egg
    put 1 into step46_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if

if  step28_egg = 0  and j = 4 and frogloc is not 28 then
    show btn 28 
    set bitmap of btn 28 to egg
    put 1 into step28_egg
    put eggnumber + 1 into eggnumber
    exit repeat
end if


put j + 1 into j

if j > 4 then
put 1 into j
end if

end repeat
end if 

if  step8_egg = 1 and step45_egg = 1  and step46_egg = 1  and step28_egg = 1 then
put 1 into zone8
end if

end checkzone8

On dragonmoves
put random(8) into pos
repeat with m = 1 to 8
 if zone1 = 0 and pos = 1 then
   if random(4) = 2 then
   play eatingc
   else 
    SoundRandom
   end if
    put 1 into selectedzone
    dragonmove1
      if clicked = 1 or quiz_quit = 1 then
         exit repeat
      end if
    if timecounter > 2 then
      checkzone1
      put 0 into timecounter
    end if
  exit repeat
 end if

if zone2 = 0 and pos = 2 then
     if random(4) = 2 then
     play eatingc
      else 
    SoundRandom
    end if
 put 2 into selectedzone
    dragonmove2
         if clicked = 1 or quiz_quit = 1 then
          exit repeat
         end if
       if timecounter > 2 then
         checkzone2
       put 0 into timecounter
       end if
    exit repeat
 end if

if zone3 = 0 and pos = 3 then
   if random(4) = 2 then
    play eatingc
      else 
    SoundRandom
    end if
  put 3 into selectedzone
    dragonmove3
          if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

   if timecounter > 2 then
         checkzone3
       put 0 into timecounter
       end if
 

  exit repeat
 end if


if zone4 = 0 and pos = 4 then
     if random(4) = 2 then
     play eatingc
      else 
       SoundRandom
     end if
 put 4 into selectedzone
    dragonmove4
      if clicked = 1 or quiz_quit = 1  then
         exit repeat
      end if

      if timecounter > 2 then
         checkzone4
       put 0 into timecounter
       end if


       exit repeat
 end if

if zone5 = 0 and pos = 5 then
     if random(4) = 2 then
     play eatingc
     else 
    SoundRandom
     end if
 put 5 into selectedzone
    dragonmove5
      if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone5
       put 0 into timecounter
       end if


  exit repeat
 end if

if zone6 = 0 and pos = 6 then
    if random(4) = 2 then
    play eatingc
    else 
    SoundRandom
    end if
  put 6 into selectedzone
       if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if
   dragonmove6

  if timecounter > 2 then
         checkzone6
       put 0 into timecounter
       end if

  exit repeat
 end if

if zone7 = 0 and pos = 7 then
  if random(4) = 2 then
  play eatingc
     else 
    SoundRandom
   end if
    put 7 into selectedzone
    dragonmove7
      if clicked = 1  or quiz_quit = 1 then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone7
       put 0 into timecounter
       end if

  exit repeat
 end if

if zone8 = 0 and pos = 8 then
  if random(4) = 2 then
   play eatingc
     else 
    SoundRandom
   end if
    put 8 into selectedzone
    dragonmove8
      if clicked = 1 or quiz_quit = 1  then
         exit repeat
      end if

  if timecounter > 2 then
         checkzone8
       put 0 into timecounter
       end if


  exit repeat
 end if

put pos + 1 into pos
if pos > 8 then
  put 1 into pos
end if

end repeat





End dragonmoves

On basicdragonmove

repeat dragontimes times
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks
if quiz_quit = 1 then 
exit repeat
end if
set bitmap of btn mdragon1 to mdragon3
wait 7 ticks
 
set bitmap of btn mdragon1 to mdragon2
wait 7 ticks

set bitmap of btn mdragon1 to mdragon1
wait 7 ticks
end repeat
put timecounter + 1 into timecounter
end basicdragonmove


On dragonmove1
show btn mdragon1
repeat 2 times
put random(6) into k
if quiz_quit = 1 then
exit repeat
end if
if k =1 then
  set the loc of btn mdragon1 to 32,130
end if
if k = 2 then
  set the loc of btn mdragon1 to 44,130
end if
if k =3 then
  set the loc of btn mdragon1 to 59,127
end if
if k =4 then
  set the loc of btn mdragon1 to 75,122
end if
if k =5 then
  set the loc of btn mdragon1 to 98,124
end if
if k =6 then
  set the loc of btn mdragon1 to 109,115
end if
basicdragonmove
end repeat



End dragonmove1

On dragonmove2
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(3) into k
if k =1 then
  set the loc of btn mdragon1 to 12,236
end if
if k = 2 then
  set the loc of btn mdragon1 to 19,243
end if
if k =3 then
  set the loc of btn mdragon1 to 7,251
end if
basicdragonmove
end repeat

End dragonmove2

On dragonmove3
show btn mdragon1
put 0 into dragontimeup
repeat 3 times
if quiz_quit = 1 then
exit repeat
end if
put random(5) into k
if k =1 then
  set the loc of btn mdragon1 to 117,272
end if
if k = 2 then
  set the loc of btn mdragon1 to 136,276
end if
if k = 3 then
  set the loc of btn mdragon1 to 157,287
end if
if k =4 then
  set the loc of btn mdragon1 to 145,297
end if
if k =5 then
  set the loc of btn mdragon1 to 171,298
end if
basicdragonmove
end repeat


End dragonmove3

On dragonmove4
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 22,351
end if
if k = 2 then
  set the loc of btn mdragon1 to 36,361
end if
if k =3 then
  set the loc of btn mdragon1 to 47,373
end if
if k =4 then
  set the loc of btn mdragon1 to 37,384
end if
basicdragonmove
end repeat


End dragonmove4


On dragonmove5
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 192,419
end if
if k = 2 then
  set the loc of btn mdragon1 to 218,415
end if
if k =3 then
  set the loc of btn mdragon1 to 238,423
end if
if k =4 then
  set the loc of btn mdragon1 to 264,430
end if
basicdragonmove
end repeat


End dragonmove5


On dragonmove6
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 328,371
end if
if k = 2 then
  set the loc of btn mdragon1 to 344,372
end if
if k =3 then
  set the loc of btn mdragon1 to 364,373
end if
if k =4 then
  set the loc of btn mdragon1 to 374,374
end if
basicdragonmove
end repeat


End dragonmove6

On dragonmove7
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(3) into k
if k =1 then
  set the loc of btn mdragon1 to 261,322
end if
if k = 2 then
  set the loc of btn mdragon1 to 276,321
end if
if k =3 then
  set the loc of btn mdragon1 to 288,320
end if
basicdragonmove
end repeat


End dragonmove7

On dragonmove8
show btn mdragon1
put 0 into dragontimeup
repeat 2 times
if quiz_quit = 1 then
exit repeat
end if
put random(4) into k
if k =1 then
  set the loc of btn mdragon1 to 340,197
end if
if k = 2 then
  set the loc of btn mdragon1 to 353,207
end if
if k =3 then
  set the loc of btn mdragon1 to 361,222
end if
if k =4 then
  set the loc of btn mdragon1 to 344,230
end if
basicdragonmove
end repeat



End dragonmove8

On idle 3
put random(40) into x3
if game_on = 1 then

   if x3 = 1 then
   dragonmoves
    end if

   if x3 = 2 then
   checkegg
    end if

   if x3 = 3 then
   eggtodragon
    end if

   if x3 = 4 then
   randomdragonmove
    end if



end if




end idle

On exitkingdom
put 0 into game_on
initialize
go cd 6
exit exitkingdom
end exitkingdom


On entrancemessage
show btn t_writer
message2 141, 28, 9, "You must proceed from here toward the goal step by step!"
hide btn t_writer

End entrancemessage


global frogloc
On step36
if game_on = 1 then
put frogloc into pre_frogloc
put 36 into frogloc
basicstepaction
end if
End step36

On step16
if game_on = 1 then
put frogloc into pre_frogloc
put 16 into frogloc
basicstepaction
end if
End step16

On step37
if game_on = 1 then
put frogloc into pre_frogloc
put 37 into frogloc
basicstepaction
end if
End step37

On step1
if game_on = 1 then
put 1 into pre_frogloc
put 1 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
frogmovestep
go cd 29
basicstepaction
end if
End step1


On step2
if game_on = 1 then
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put frogloc into pre_frogloc
put 2 into frogloc
frogmovestep
basicstepaction
end if
End step2

On step3
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 3 into frogloc
frogmovestep3
go cd 24
basicstepaction
end if
End step3


On step11
if game_on = 1 then
put frogloc into pre_frogloc
put 11 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
frogmovestep
go cd 28
basicstepaction
end if
End step11

On step12
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 12 into frogloc
frogmovestep
basicstepaction
end if
End step12

On step13
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 13 into frogloc
frogmovestep
basicstepaction
end if
End step13

On step14
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 14 into frogloc
frogmovestep
if random(2) = 1 then
go cd 21
else
go cd 15
end if
basicstepaction
end if
End step14


On step15
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 15 into frogloc
frogmovestep
go cd 22
basicstepaction
end if
End step15


On step17
if game_on = 1 then
put 17 into pre_frogloc
put 17 into frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
frogmovestep
go cd 29
basicstepaction
end if
End step17


On step18
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 18 into frogloc
frogmovestep
basicstepaction
end if
End step18


On step19
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 19 into frogloc
show btn stp20
frogmovestep19
basicstepaction
end if
End step19

On step20
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 20 into frogloc
frogmovestep
go cd 20
basicstepaction
end if
End step20


On step21
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 21 into frogloc
frogmovestep
go cd 25
basicstepaction
end if
End step21


On step22
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 22 into frogloc
frogmovestep22
go cd 26
basicstepaction
end if
End step22


On step23
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 23 into frogloc
show btn stp12
frogmovestep23
if random(2) =1 then
go cd 27
else
go cd 30
end if
basicstepaction
end if
End step23


On step24
if game_on = 1 then
put frogloc into pre_frogloc
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%
put 24 into frogloc
frogmovestep24
basicstepaction
end if
End step24




On frogmovestep


play ufo


put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc% - x0 into xfmove
put locV of btn %frogloc% - y0 into yfmove
put xfmove/10 into xftimes
if xftimes < 0 then
  put xftimes * (-1) into xftimes
end if
repeat with ix = 1 to xftimes
if xfmove > 0 then
set the loc of btn satelite to  x0 + (ix-1)*10  , y0 + (yfmove/xftimes)*(ix-1)
end if
if xfmove < 0 then
set the loc of btn satelite to  x0 - (ix-1)*10  , y0 + (yfmove/xftimes)*(ix-1)
end if

end repeat

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat

End frogmovestep





On frogmovestep19
play ufo

put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc%  into xe
put locV of btn %frogloc%  into ye

set loc of btn satelite to 325, 396
wait 5 ticks
set loc of btn satelite to 312, 375
wait 5 ticks
set loc of btn satelite to xe, ye

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat

End frogmovestep19


On frogmovestep3
play ufo
if pre_frogloc = 2 then
frogmovestep
else
put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc%  into xe
put locV of btn %frogloc%  into ye

set loc of btn satelite to 392, 362
wait 5 ticks
set loc of btn satelite to 425, 365
wait 5 ticks
set loc of btn satelite to 435, 372
wait 5 ticks
set loc of btn satelite to xe, ye

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat
end if
End frogmovestep3



On frogmovestep21
play ufo

put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc%  into xe
put locV of btn %frogloc%  into ye

set loc of btn satelite to 295, 390
wait 5 ticks
set loc of btn satelite to 180, 372
wait 5 ticks
set loc of btn satelite to xe, ye

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat

End frogmovestep21



On frogmovestep22
play ufo

put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc%  into xe
put locV of btn %frogloc%  into ye

set loc of btn satelite to 80, 342
wait 5 ticks
set loc of btn satelite to 51, 317
wait 5 ticks
set loc of btn satelite to 38, 298
wait 5 ticks
set loc of btn satelite to 28, 267
wait 5 ticks
set loc of btn satelite to 26, 248
wait 5 ticks
set loc of btn satelite to xe, ye

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat

End frogmovestep22



On frogmovestep23
play ufo

put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc%  into xe
put locV of btn %frogloc%  into ye

set loc of btn satelite to 45, 212
wait 5 ticks
set loc of btn satelite to 94, 179
wait 5 ticks
set loc of btn satelite to 148, 164
wait 5 ticks
set loc of btn satelite to 237, 158
wait 5 ticks
set loc of btn satelite to xe, ye

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat

End frogmovestep23




On frogmovestep24
play ufo

put locH of btn satelite into x0
put locV of btn satelite into y0

put locH of btn %frogloc%  into xe
put locV of btn %frogloc%  into ye

set loc of btn satelite to 365, 159
wait 5 ticks
set loc of btn satelite to 400, 172
wait 5 ticks
set loc of btn satelite to 411, 183
wait 5 ticks
set loc of btn satelite to 400, 195
wait 5 ticks
set loc of btn satelite to xe, ye

repeat 2 times
set bitmap of btn satelite to satelit2
wait 10 ticks
set bitmap of btn satelite to satelit3
wait 10 ticks
set bitmap of btn satelite to satelit4
wait 10 ticks
set bitmap  of btn satelite to satelite
wait 10 ticks

end repeat

End frogmovestep24





On SoundRandom
put random(5) into basicsnd
if basicsnd = 1 then 
   play mendel1
end if
if basicsnd = 2 then 
   play mendel2
end if
if basicsnd = 3 then 
   play mendel3
end if
if basicsnd = 4 then 
   play mendel5
end if
wait 20 ticks
End SoundRandom


On basicstepaction
show btn satelite
if game_on is not 1 then
   exit basicstepaction
end if
SoundRandom
set the loc of btn satelite to  locH of btn %frogloc% , locV of btn %frogloc%



if (frogloc >= 1) and (frogloc < 36) and (frogloc is not 16) then

   if(frogloc = 3 or frogloc = 18 or frogloc = 5 or frogloc = 7 or frogloc = 8 or frogloc = 30 or frogloc = 2 or frogloc = 6)  then
      if random(3) is not 1 then
        put 0 into  quiz_quit
       m_KingdomTours
      if math_answer = 1 then
        checkroute
           exit basicstepaction

       else
            checkzonex
         click at btn %frogloc%
           exit basicstepaction

       end if


      end if
   end if

   if(frogloc = 21 or frogloc = 23 or frogloc = 11 or frogloc = 13 or frogloc = 25 or frogloc = 34 or frogloc = 22 or frogloc = 33 or frogloc = 14)  then
      if random(3) is not 1 then
       put 0 into  quiz_quit
 
        m_KingdomTours
       if math_answer = 1 then
        checkroute
           exit basicstepaction

       else
         checkzonex
         click at btn %frogloc%
           exit basicstepaction

       end if
--           exit basicstepaction
      end if
   end if






  put 0 into  quiz_quit
 
     if grade_level = 0 then
                quiz100
     end if

     if grade_level = 1 then
           quiz101
    end if

      if grade_level = 2 then
                quiz102
      end if

if game_on = 0 then
    exit basicstepaction
end if



if math_answer = 1 and math_time <= responselimit then
  if frogloc = 19 or frogloc = 18 or frogloc = 24 or frogloc=12 or frogloc = 13 or frogloc= 15  then
       wait 1 ticks
       if frogloc= 15 then
          go cd 7
          exit basicstepaction

       end if
  else
     go cd 3
      refreshcd3

  end if
     checkroute
     exit basicstepaction

else


    if   frogloc = 19 or frogloc = 18 or frogloc = 24 or frogloc=12 or frogloc = 13 then
        wait 1 ticks
    else
       go cd 3
      refreshcd3

    end if

 checkzonex
dragonmoves
checkegg
 eggtodragon


click at btn %frogloc%
 exit basicstepaction
         
 end if


dragonmoves
checkegg
 eggtodragon


if game_on is not 1 then
   exit basicstepaction
end if













wait 30 ticks
SoundRandom


checkzonex

end if

End basicstepaction




On checkzonex

 if pos = 1 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone1
 end if

if pos = 2 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone2
 end if

 if pos = 3 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone3
 end if
if pos = 4 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone4
 end if

 if pos = 5 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone5
 end if
if pos = 6 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone6
 end if
if pos = 7 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone7
 end if
if pos = 8 and (math_time > responselimit or  math_answer is not 1 ) then
   checkzone8
 end if


End checkzonex






















On quiz100
put 98 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(98) into chosenedquiz


repeat 101 times
----------------------


if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then

QuizDlg2 "0.1 x 5 = ?", 5, 0.5, 0.55,0.05, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.7 x 7 = ?", 0.049, 0.49, 4.9, 49, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.8 x 3 = ?", 2.4, 24, 0.24, 0.024, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.5 x 6 = ?", 0.03, 0.3, 3, 30, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.2 x 5 = ?", 0.01, 0.1, 1, 10, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.3 x 8 = ?", 2.4, 24, 0.24, 0.024, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.2 x 3 = ?", 6, 0.6, 0.06, 60, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "1.5 x 6 = ?", 9,10, 11, 12, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "2.8 x 5 = ?",11, 12, 13,  14, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "2.5 x 8 = ?", 20, 21, 22, 23, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "4.8 x 5 = ?", 21, 22, 23,24, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "11.5 x 2 = ?",21, 22, 23, 24, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.6 x 10 = ?", 5,6, 7, 8, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "4.2 x 10 = ?", 40, 41, 42, 43, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "1.4 x 20 = ?", 26, 27, 28, 29, 3


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "2.4 x 30 = ?", 70, 71, 72, 73, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "5.6 x 30 = ?", 158, 168, 178, 188, 2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "7.8 x 30 = ?", 34, 134, 234, 334, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "5.3 x 2 = ?", 10.6, 11.6, 12.6, 13.6, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "1.8 x 9 = ?", 16.1,16.2, 16.3, 16.4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "2.4 x 30 = ?", 70, 71, 72, 73, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "2.8 x 5 = ?",  11, 12, 13, 14, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
----------------------------------------------------------------------------
if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "0.2 x 10 = ?", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "0.4 x 10 = ?", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "1.8 x 10 = ?", 18
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "3.5 x 100 = ?", 350

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "0.3 x 100 = ?", 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "+", 5bun1,  "= ?" , 5, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "-", 5bun1,  "= ?" , 5, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "-", 4bun1,  "= ?" , 4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "+", 4bun1,  "= ?" , 4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "+", 4bun1,  "= ?" , 4, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 2bun1,  "= ?" , 2, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 2bun1,  "= ?" , 2, 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 7bun3,  "= ?" , 7, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun6, "-", 7bun3,  "= ?" , 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun4, "+", 7bun3,  "= ?" , 7, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun7,  "= ?" , 9, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "-", 9bun2,  "= ?" , 9, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun2,  "= ?" , 9, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 7bun4,  "= ?" , 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 8bun4,  "= ?" , 8, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 5bun4,  "= ?" , 5, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------------------
if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the product of 1.2 x 3  to the nearest integer!", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the product of 0.1 x 3   to the nearest integer!", 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the product of 0.2 x 3  to the nearest integer! ", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the product of 8.1 x 3  to the nearest integer! ", 24
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the product of 7.2 x 3  to the nearest integer! ", 22
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "31 multiplied by 1000 is ___", 31000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the product of 40 x 3  to the nearest hundred!", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------------
if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the sum of 370 + 20 to the nearest hundred!", 400
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-------------------
if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the sum of 440 + 15 to the nearest tenth!", 460
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the sum of 440 + 448 to the nearest thousand!", 1000

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the difference of 458 - 440 to the nearest hundred!", 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the difference of 640 - 358 to the nearest hundred!", 300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the difference of 840 - 448 to the nearest hundred!", 400
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the sum of 440 + 448 to the nearest hundred!", 900
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round the sum of 234 + 448 to the nearest tenth!", 680
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "5 out of 25 animals are rabbits. That is ___%.", 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "15 out of 50 people are male. That is ___%.", 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "20 out of 200 stems are camellias. That is ___%.", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



-------------------------------------------------


if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 7bun1,  "= ?" , 7, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "+", 9bun1,  "= ?" , 9, 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "+", 3bun2,  "= ?" , 3, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 3bun1,  "= ?" , 3, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 2bun1,  "= ?" , 2, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



--------------------
if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 1999 to the nearest thousand!", 2000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 1949 to the nearest hundred!", 1900
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 733 to the nearest hundred!", 700
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 99 to the nearest hundred!", 100
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "___ x  3  = 9.6", 3.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 " ___  x  4  = 9.6 ", 2.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 " ___  x  5  = 2.5", 0.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 " ___  x  10  = 4", 0.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "  ___  x  15  = 4.5", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "  ___  x  2  = 0.8", 0.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "  ___  x  9  = 2.7", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "  ___  x  6  = 3.6", 0.6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "  ___  x  6  = 180.6", 30.1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "  ___  x  3  = 21.6", 7.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------------
if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Five divided by five is equal to __", 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Twelve divided by six is equal to __", 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Fifteen divided by five is equal to __", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Eighteen divided by six is equal to __", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Twenty-four divided by eight is equal to __", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Twenty-four divided by two is equal to __", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

---------------


if chosenedquiz = 90  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 3 cm, the area is ___ cm2.",en1, 27
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 91  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 4 cm, the yellow area is __ cm2.",en1, 48
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 92  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 5 cm, the yellow area is ___ cm2",en1, 75



put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 93  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi =3 and A = 2 cm, the yellow area is ___ cm2",en1, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 94  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming A = 3 cm and B = 2 cm. the area is __ cm2",parallel, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 95  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming A = 4 cm and B = 2 cm, the area is __ cm2",tri, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 96  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 5cm and B = 3cm, the area is ___cm2.",parallel, 15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 97  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 6 cm and B = 4 cm, the area is ___ cm2",tri, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 98  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 7 cm, the area is ___ cm2.",en1, 147
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



















------------------------
put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




repeat while quiz_quit = 0

if gamestptemporary is not 999 then
dragonmoves
checkegg
 eggtodragon
end if
wait 30 ticks
end repeat








put 0 into quizongoing

-- mathtime is set by system and the time unit is 

 if gamestptemporary is not 999 then

    if math_answer = 1 then 
        if  math_time <= responselimit then
            randomok
        else
            play bong
            wait 30 ticks

        end if


   else
        if math_answer = -1 then
           play uhoohhh
           wait 170 ticks

            play Beethovn
           wait 6 seconds
           exitkingdom

          exit quiz100
        end if

           play jawharp


         if (math_time > responselimit) then 
         checkzonex
         end if

      end if
end if
end quiz100
















On quiz101
put 98 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(98) into chosenedquiz


repeat 101 times
----------------------

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then

QuizDlg2 "0.1 x 5 = ?", 5, 0.5, 0.55,0.05, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.7 x 7 = ?", 0.049, 0.49, 4.9, 49, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.8 x 3 = ?", 2.4, 24, 0.24, 0.024, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.5 x 6 = ?", 0.03, 0.3, 3, 30, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.2 x 5 = ?", 0.01, 0.1, 1, 10, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

---------

if chosenedquiz = 6  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round  875.5 / 80 to the nearest integer", 1, 3, 7, 11,4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 9 / 90 to the nearest integer", 0, 1, 2, 3, 1

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 256.5 / 40 to the nearest integer", 4, 5, 6, 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 182.5 / 30 to the nearest integer",5, 6, 7, 8,  2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 412.5 / 20 to the nearest integer", 18, 19,20, 21, 4

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





-----------




if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "0.6 / 2 = ?", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "0.9 / 3 = ?", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "0.8 / 4 = ?", 0.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.6 / 4 = ?", 0.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.8 / 6 = ?", 0.3


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "5.6 / 8 = ?", 0.7

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.4 / 7 = ?", 0.2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.4 / 8 = ?", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.4 / 3 = ?", 0.8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.5 / 5 = ?", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.8 / 7 = ?", 0.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.8 / 4 = ?", 0.7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
----------------------------------------------------------------------------
if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "3.6 / 3 = ?", 1.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "9.6 / 4 = ?", 2.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "11.2 / 8 = ?", 1.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "8.4 / 4 = ?", 2.1

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "13.5 / 9 = ?", 1.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
---------------------------------  12/27
if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "+", 5bun1,  "= ?" , 5, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "-", 5bun1,  "= ?" , 5, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "-", 4bun1,  "= ?" , 4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "+", 4bun1,  "= ?" , 4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "+", 4bun1,  "= ?" , 4, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 2bun1,  "= ?" , 2, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 2bun1,  "= ?" , 2, 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 7bun3,  "= ?" , 7, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun6, "-", 7bun3,  "= ?" , 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun4, "+", 7bun3,  "= ?" , 7, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun7,  "= ?" , 9, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "-", 9bun2,  "= ?" , 9, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun2,  "= ?" , 9, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 8bun2,  "= ?" , 8, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 7bun4,  "= ?" , 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 8bun4,  "= ?" , 8, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 5bun4,  "= ?" , 5, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------------------
if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "17.5 / 3 makes a quotient 5.8 with a remainder __", 0.1, 0.2, 0.3, 0.4, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "16.3 / 7  makes a quotient 2.3 with a remainder __.", 0.1, 0.2, 0.3, 0.4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "24.2 / 9 makes a quotient 2.6 with a remainder __", 0.6, 0.7, 0.8, 0.9, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "10.1 / 7 makes a quotient 1.4 with a remainder __", 0.1, 0.2, 0.3, 0.4, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 163.2 / 4 to the nearest integer", 40, 41, 42, 43, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round  77.6 / 9 to the nearest integer", 7, 8, 9, 10, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round  52.7 / 6 to the nearest integer", 9, 10, 11, 12, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------------
if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round  180.6 / 8 to the nearest integer", 20, 21, 22,23, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-------------------
if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 75.5 / 8 to the nearest integer", 8,9,10,11,2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 64.9 / 9 to the nearest integer", 7, 8, 9, 10, 1

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "Round 138 / 40 to the nearest integer", 1, 2, 3, 4, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2m is ____times a 4m length.", 0.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "8m is ____times a 4m length", 2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "5m is ____times a 2m length", 2.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2m is ____times a 5m length", 0.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "25% of 40 rabbits is ___ rabbits", 10
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "30% of 50 people is  ___ people", 15
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "20% of 200 stalks is  ___stalks", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



-------------------------------------------------


if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 7bun1,  "= ?" , 7, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "+", 9bun1,  "= ?" , 9, 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "+", 3bun2,  "= ?" , 3, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 3bun1,  "= ?" , 3, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 2bun1,  "= ?" , 2, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



--------------------
if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Rounded 1664 to the nearest tenth", 1660
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Rounded 4959 to the nearest hundred", 5000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 553 to the nearest hundred", 600
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 94 to the nearest tenth", 90
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A rectangle area, 4.5m long and 3m wide is ___m2", 13.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "A rectangle area, 4m long and 3.5m wide  is  ___m2", 14
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the circumference of a square = 4.8m, each side is ___m?", 1.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the circumference of a square = 8.8m, each side is ___m?", 2.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the circumference of a square = 16.4m, each side is __m?", 4.1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If the area of a square = 16m2, each side is __m", 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "If the area of a square = 64m2, each side is __m", 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

-----------------------------
if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "___  x  12  = 7.2 ", 0.6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "___  x  6  = 4.8.", 0.8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "___  x  3  = 27.6", 9.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------------
if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which has a pair of unparallel opposite sides?", m_heiko, m_daikei, m_hisi, m_square, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "Which has a pair of opposite sides of unequal length?", m_heiko, m_daikei, m_hisi, m_square, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "It's diagonals intersect perpendicular to each other", m_heiko, m_daikei, m_hisi, m_rect, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "If a diagonal is drawn, 2 isosceles triangles will appear", m_heiko, m_daikei, m_hisi, m_rect, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "It's diagonals are of equal length", m_heiko,  m_hisi, m_daikei,m_square, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "24 / 2 is equal to __ ", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 90  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 " Assuming pi = 3 and A = 2 cm, the area is ___ cm2,",en1, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 91  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 4cm and B = 4cm, the purple area is __cm2",en4, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 92  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi=3 and A=10cm and B=10cm, the purple area is ___cm2",en4, 25



put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 93  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi=3 and A=6cm and B=6cm, the purple area is __cm2",en4, 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 94  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 15cm and B = 10cm, the area is ___cm2",parallel, 150
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 95  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 4cm and B = 2cm, the area is ___cm2",tri, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 96  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 45cm and B = 30cm, the area is ___cm2",parallel, 1350
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 97  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 6cm and B = 4cm, the area is ___cm2",tri, 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 98  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 " Assuming pi = 3 and A = 8 cm, the area is ___ cm2",en1, 192
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if








------------------------
put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




repeat while quiz_quit = 0
if gamestptemporary is not 999 then
dragonmoves
checkegg
 eggtodragon
end if
wait 30 ticks
end repeat







put 0 into quizongoing

-- mathtime is set by system and the time unit is 

 if gamestptemporary is not 999 then

    if math_answer = 1 then 
        if  math_time <= responselimit then
            randomok
        else
            play bong
            wait 30 ticks

        end if


   else
        if math_answer = -1 then
           play uhoohhh
           wait 170 ticks

            play Beethovn
           wait 6 seconds
           exitkingdom

          exit quiz101
        end if

           play jawharp


         if (math_time > responselimit) then 
         checkzonex
         end if

      end if
end if
----------------


end quiz101











On quiz102
put 98 into totalquiznum
put 0 into quiz_quit
put 0 into foundquiz
put 1 into quizongoing
put random(98) into chosenedquiz


repeat 101 times
----------------------

if chosenedquiz = 1 and Item chosenedquiz of xquiztbl is not 1 then

QuizDlg2 "0.1 x 3 = ?", 3, 0.3, 0.33,0.03, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 2 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.7 x 7 = ?", 0.049, 0.49, 4.9, 49, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat

end if

if chosenedquiz = 3 and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.8 x 4 = ?", 3.2, 32, 0.32, 0.032, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 4  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg2 "0.6 x 5 = ?", 0.03, 0.3, 3, 30, 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 5 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.5 x 2 = ?", 0.01, 0.1, 1, 10, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 6 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.8 x 3 = ?", 2.4, 24, 0.24, 0.024, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 7 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg2 "0.3 x 2 = ?", 6, 0.6, 0.06, 60, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 8 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg8 "2.5 x 6 = ?", 15.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 9 and Item chosenedquiz of xquiztbl is not 1  then
QuizDlg8 "1.8 x 5 = ?", 9.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 10  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.1 x 8 = ?", 16.8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 11  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.2 / 2 = ?", 0.6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 12  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "0.9 / 3 = ?", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 13  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.8 / 2 = ?", 0.9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 14  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "3.6 / 4 = ?", 0.9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 15  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.8 / 3 = ?", 0.6


put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 16  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "6.4 / 8 = ?", 0.8

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 17  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "1.4 / 7 = ?", 0.2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 18  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.4 / 4 = ?", 0.6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 19  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.4 / 3 = ?", 0.8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 20  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.5 / 5 = ?", 0.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 21  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.8 / 7 = ?", 0.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 22  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2.8 / 4 = ?", 0.7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
----------------------------------------------------------------------------
if chosenedquiz = 23  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "4.8 / 4 = ?", 1.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 24  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "9.6 / 4 = ?", 2.4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 25  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "12.0 / 8 = ?", 1.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 26  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "8.8 / 4 = ?", 2.2

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 27  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "14.4 / 9 = ?", 1.6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
---------------------------------  12/27
if chosenedquiz = 28  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "+", 5bun1,  "= ?" , 5, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 29  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   5bun3, "-", 5bun1,  "= ?" , 5, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 30  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "-", 4bun1,  "= ?" , 4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 31  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun1, "+", 4bun1,  "= ?" , 4, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 32  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   4bun3, "+", 4bun1,  "= ?" , 4, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 33  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 2bun1,  "= ?" , 2, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 34  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "-", 2bun1,  "= ?" , 2, 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 35  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 7bun3,  "= ?" , 7, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 36  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun6, "-", 7bun3,  "= ?" , 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 37  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun4, "+", 7bun3,  "= ?" , 7, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 38  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 39  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun7,  "= ?" , 9, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 40  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "-", 9bun2,  "= ?" , 9, 6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 41  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun1, "+", 9bun4,  "= ?" , 9, 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 42  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun2,  "= ?" , 9, 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 43  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 9bun1,  "= ?" , 9, 8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 44  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 7bun4,  "= ?" , 7, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 45  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 8bun4,  "= ?" , 8, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 46  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   1n, "-", 5bun4,  "= ?" , 5, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
--------------------------------------


if chosenedquiz = 47  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "21.6 / 3 = 7.2 with a remainder ____", 0.0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 48  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "16.2 / 7 = 2.3 with a remainder ____", 0.1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 49  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "10.2 / 9  = 1.1 with a remainder ____", 0.3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 50  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "10.3 / 7 = 1.4 with a remainder ____", 0.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 51  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 63.2 / 9 to the nearest integer", 7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 52  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 77.6 / 3 to the nearest integer", 26
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 53  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 2.7 / 6 to the nearest integer", 0
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-----------------------
if chosenedquiz = 54  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 180.6 / 20 to the nearest integer", 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
-------------------
if chosenedquiz = 55  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 97.6 / 30 to the nearest integer", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 56  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 64.9 / 11 to the nearest integer", 6

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 57  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 130 / 40 to the nearest integer", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 58  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "2m is __ times longer than 10m.", 0.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 59  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "13.5m is __ times longer than 4.5m", 3

put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 60  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "12.5m is __ times longer than 2.5m", 5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 61  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "40.8m is __ times longer than 8m", 5.1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 62  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "How many are 25% of 160 animals?", 40
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 63  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "How many are 25% of 80 dolphins ?", 20
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 64  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "How many are 30% of 50 lives?", 35
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



-------------------------------------------------


if chosenedquiz = 65  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   7bun1, "+", 7bun1,  "= ?" , 7, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 66  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   9bun8, "+", 9bun1,  "= ?" , 9, 9
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 67  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun1, "+", 3bun2,  "= ?" , 3, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 68  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   3bun2, "-", 3bun1,  "= ?" , 3, 1
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if




if chosenedquiz = 69  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg13   2bun1, "+", 2bun1,  "= ?" , 2, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



--------------------
if chosenedquiz = 70  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 21669 to the nearest ten thousand", 20000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 71  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 54959 to the nearest ten thousand", 50000
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 72  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 55341 to the nearest hundred", 55300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if


if chosenedquiz = 73  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "Round 294 to the nearest hundred", 300
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 74  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A  yard 4.2m long and 9m wide is ___m2.", 37.8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 75  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "A yard 4m long and 3.2m wide is ___m2", 12.8
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 76  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the circumference of a square = 44.8m, a side is __m", 11.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 77  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the circumference of a square = 14.4m, a side is __m", 3.6
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 78  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the circumference of a square = 10m, a side is __m", 2.5
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 79  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the area of a square = 121 m2, a side is ___m", 11
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 80  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If the area of a square = 144 m2, a side is ___m", 12
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

-----------------------------

if chosenedquiz = 81  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If ?  x  12  = 8.4,  ? is ___", 0.7
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 82  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If  ?  x  3  = 180.6,  ? is ___", 60.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 83  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg8 "If  ?  x  3  = 72.6,  ? is ___", 24.2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if
------------------
if chosenedquiz = 84  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "A pair of opposite sides are unparallel", m_heiko, m_daikei, m_hisi, m_square, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if





if chosenedquiz = 85  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "A pair of opposite sides are  of unequal length?", m_heiko, m_daikei, m_hisi, m_square, 2
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 86  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "It's diagonals are perpendicular to each other", m_heiko, m_daikei, m_hisi, m_rect, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 87  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "If a diagonal line is drawn, 2 isosceles triangles will appear", m_heiko, m_daikei, m_hisi, m_rect, 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 88  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg1 "It's diagonal lines are of equal length", m_heiko,  m_hisi, m_daikei,m_square, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 89  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg4 "48 / 16 is equal to __", 3
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 90  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 " Assuming pi = 3 and A = 3 cm, the area is ___ cm2,",en1, 27
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 91  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 8cm and B = 8cm, the red area is  ___cm2",en3, 32
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 92  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 10cm and B = 10cm, the red area is ___ cm2",en3, 50



put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 93  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi=3 and A=4cm and B=4cm, the purple area is __cm2",en4, 4
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if

if chosenedquiz = 94  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 15cm and B = 10cm, the area is ___cm2",parallel, 150
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 95  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 50cm and B = 30cm, the area is ___cm2",tri, 750
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 96  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 45cm and B = 30cm, the area is ___cm2",parallel, 1350
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 97  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "If A = 10cm and B = 6cm, the area is ___cm2",tri, 30
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if



if chosenedquiz = 98  and Item chosenedquiz of xquiztbl is not 1 then
QuizDlg16 "Assuming pi = 3 and A = 9 cm, the area is ___ cm2",en1, 243
put 1 into Item chosenedquiz of xquiztbl
exit repeat
end if






------------------------
put chosenedquiz +1 into chosenedquiz
if chosenedquiz > totalquiznum then
put 1 into chosenedquiz
end if

end repeat




repeat while quiz_quit = 0
if gamestptemporary is not 999 then
dragonmoves
checkegg
 eggtodragon
end if
wait 30 ticks
end repeat






put 0 into quizongoing

-- mathtime is set by system and the time unit is 

 if gamestptemporary is not 999 then

    if math_answer = 1 then 
        if  math_time <= responselimit then
            randomok
        else
            play bong
            wait 30 ticks
        end if


   else
        if math_answer = -1 then
           play uhoohhh
           wait 170 ticks

            play Beethovn
           wait 6 seconds
           exitkingdom

          exit quiz102
        end if

           play jawharp


         if (math_time > responselimit) then 
         checkzonex
         end if

      end if
end if
----------------




end quiz102























On randomok

put random(2) into rdmok
if rdmok = 1 then
   play good
end if
if rdmok = 2 then
   play alright
end if
show btn narator1
repeat 2 times
set bitmap of btn narator1 to narator2
wait 3 ticks
if mouseclick() then
  play muon
  exit repeat
end if
set bitmap of btn narator1 to narator1
wait 3 ticks
set bitmap of btn narator1 to narator2
wait 3 ticks
set bitmap of btn narator1 to narator3
wait 3 ticks
end repeat
wait 70 ticks
End randomok




On randomng
play muon
wait 30 ticks
put random(2) into rdmng
if rdmng = 1 then
   play jawharp
end if
if rdmng = 2 then
   play uhoh2
end if
wait 50 ticks
End randomng

On eggtodragon

if  step2_egg = 2 then
   put 2 into fuka_btn_no
    put 3 into step2_egg
    
    littledragonmove
end if

if   step5_egg = 2 then
   put 5 into fuka_btn_no
    put 3 into step5_egg
    
    littledragonmove
end if
if   step8_egg = 2  then
   put 8 into fuka_btn_no
    put 3 into step8_egg
    
    littledragonmove
end if
----------------------Adjustment 11/15/2000
--if   step14_egg = 2  then
--   put 14 into fuka_btn_no
--    put 3 into step14_egg
    
--    littledragonmove
--end if
if  step18_egg = 2  then
   put 18 into fuka_btn_no
    put 3 into step18_egg
    
    littledragonmove
end if
if   step21_egg = 2  then
   put 21 into fuka_btn_no
    put 3 into step21_egg
    
    littledragonmove
end if
 
if quiz_quit = 1 then
   exit eggtodragon
end if

----------------------Adjustment 11/15/2000
--if   step22_egg = 2 then
--   put 22 into fuka_btn_no
--    put 3 into step22_egg
    
--    littledragonmove
--end if
--if   step23_egg = 2  then
--   put 23 into fuka_btn_no
--    put 3 into step23_egg
    
--    littledragonmove
--end if
if   step25_egg = 2  then
   put 25 into fuka_btn_no
    put 3 into step25_egg
    
    littledragonmove
end if
if   step26_egg = 2  then
   put 26 into fuka_btn_no
    put 3 into step26_egg
    
    littledragonmove
end if
if   step28_egg = 2  then
   put 28 into fuka_btn_no
    put 3 into step28_egg
    
    littledragonmove
end if
if   step31_egg = 2  then
   put 31 into fuka_btn_no
    put 3 into step31_egg
    
    littledragonmove
end if


if   step32_egg = 2  then
   put 32 into fuka_btn_no
    put 3 into step32_egg
    
    littledragonmove
end if
if   step34_egg = 2 then
   put 34 into fuka_btn_no
    put 3 into step34_egg
    
    littledragonmove
end if


if   step38_egg = 2  then
   put 38 into fuka_btn_no
    put 3 into step38_egg
    
    littledragonmove
end if
if   step39_egg = 2  then
   put 39 into fuka_btn_no
    put 3 into step39_egg
    
    littledragonmove
end if


if quiz_quit = 1 then
   exit eggtodragon
end if


if   step41_egg = 2  then
   put 41 into fuka_btn_no
    put 3 into step41_egg
    
    littledragonmove
end if
if   step42_egg = 2  then
   put 42 into fuka_btn_no
    put 3 into step42_egg
    
    littledragonmove
end if
if   step43_egg = 2  then
   put 43 into fuka_btn_no
    put 3 into step43_egg
    
    littledragonmove
end if
 if  step44_egg = 2  then
   put 44 into fuka_btn_no
    put 3 into step44_egg
    
    littledragonmove
end if
if   step46_egg = 2   then
   put 46 into fuka_btn_no
    put 3 into step46_egg
    
    littledragonmove
end if
if   step47_egg = 2  then
   put 47 into fuka_btn_no
    put 3 into step47_egg
    
    littledragonmove
end if
if   step49_egg = 2  then
   put 49 into fuka_btn_no
    put 3 into step49_egg
    
    littledragonmove
end if
if   step50_egg = 2   then
   put 50 into fuka_btn_no
    put 3 into step50_egg
    
    littledragonmove
end if
if   step51_egg = 2   then
   put 51 into fuka_btn_no
    put 3 into step51_egg
    
    littledragonmove
end if

end eggtodragon


On littledragonmove

repeat 2 times
if quiz_quit = 1 then
 exit repeat
end if
set bitmap of btn %fuka_btn_no% to mdragon2
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon3
wait 5 ticks
--if mouseclick() and quizongoing = 0  then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon2
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
set bitmap of btn %fuka_btn_no% to mdragon1
wait 5 ticks
--if mouseclick()  and quizongoing = 0 then
--   click at clickh(), clickv()
--   exit littledragonmove
--end if
end repeat

End littledragonmove




On dragonlittlemove

repeat 2 times
if quiz_quit = 1 then
 exit repeat
end if
set bitmap of btn mdragon1 to mdragon2
wait 5 ticks
set bitmap of btn mdragon1 to mdragon3
wait 5 ticks
set bitmap of btn mdragon1 to mdragon2
wait 5 ticks
set bitmap of btn mdragon1 to mdragon1
wait 5 ticks
--end if
end repeat

End dragonlittlemove






On randomdragonmove
put random(25) into jjj
repeat  25 times
if  step2_egg = 3 and jjj=1 then
   put 2 into fuka_btn_no
    littledragonmove
    exit repeat
end if

if   step5_egg = 3and jjj=2 then
   put 5 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step8_egg = 3 and jjj=3  then
   put 8 into fuka_btn_no
    littledragonmove
    exit repeat
end if
----------------------Adjustment 11/15/2000
--if   step14_egg = 3 and jjj=4 then
--   put 14 into fuka_btn_no
--    littledragonmove
--    exit repeat
--end if
if  step18_egg = 3 and jjj=5 then
   put 18 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step21_egg = 3 and jjj=6 then
   put 21 into fuka_btn_no
    littledragonmove
    exit repeat
end if
----------------------Adjustment 11/15/2000
--if   step22_egg = 3 and jjj=7 then
--   put 22 into fuka_btn_no
--    littledragonmove
--    exit repeat
--end if
--if   step23_egg = 3 and jjj=8 then
--   put 23 into fuka_btn_no
--    littledragonmove
--    exit repeat
--end if
if   step25_egg = 3 and jjj=9 then
   put 25 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step26_egg = 3 and jjj=10 then
   put 26 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step28_egg = 3 and jjj=11 then
   put 28 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step31_egg = 3 and jjj=12 then
   put 31 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step32_egg = 3 and jjj=13 then
   put 32 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step34_egg = 3 and jjj=14 then
   put 34 into fuka_btn_no
    littledragonmove
    exit repeat
end if


if   step38_egg = 3 and jjj=15 then
   put 38 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step39_egg = 3  and jjj=16 then
   put 39 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step41_egg = 3  and jjj=17 then
   put 41 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step42_egg = 3  and jjj=18 then
   put 42 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step43_egg = 3  and jjj=19 then
   put 43 into fuka_btn_no
    littledragonmove
    exit repeat
end if
 if  step44_egg = 3 and jjj=20  then
   put 44 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step46_egg = 3  and jjj=21 then
   put 46 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step47_egg = 3 and jjj=22 then
   put 47 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step49_egg = 3 and jjj=23 then
   put 49 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step50_egg = 3  and jjj=24 then
   put 50 into fuka_btn_no
    littledragonmove
    exit repeat
end if
if   step51_egg = 3  and jjj=25 then
   put 51 into fuka_btn_no
    littledragonmove
    exit repeat
end if
put jjj + 1 into jjj
if jjj > 25 then
put 1 into jjj
end if
end repeat
end randomdragonmove





On checkroute1
put 0 into route1
if step2_egg = 0 then
   put 0 into route1
else
   put 1 into route1
end if
End checkroute1

On checkroute2
put 0 into route2
if step21_egg = 0 and step22_egg = 0 and step23_egg = 0 then
   put 0 into route2
else
   put 1 into route2
end if

End checkroute2

On checkroute3
put 0 into route3
if step18_egg = 0 then
   put 0 into route3
else
   put 1 into route3
end if

End checkroute3

On checkroute4
put 0 into route4
if step5_egg = 0 then
   put 0 into route4
else
   put 1 into route4
end if

End checkroute4

On checkroute5
put 0 into route5
if step31_egg = 0 and step32_egg = 0 then
   put 0 into route5
else
   put 1 into route5
end if

End checkroute5

On checkroute6
put 0 into route6
if step8_egg = 0  then
   put 0 into route6
else
   put 1 into route6
end if

End checkroute6

On checkroute7
put 0 into route7
if step28_egg = 0  then
   put 0 into route7
else
   put 1 into route7
end if

End checkroute7

On checkroute8
put 0 into route8
if step14_egg = 0  then
   put 0 into route8
else
   put 1 into route8
end if

End checkroute8


On Route8clear
put 0 into  step14_egg

End Route8clear







On checkroute9
put 0 into route9
if step25_egg = 0 and step26_egg = 0 then
   put 0 into route9
else
   put 1 into route9
end if

End checkroute9

On checkroute10
put 0 into route10
if step34_egg = 0 then
   put 0 into route10
else
   put 1 into route10
end if

End checkroute10

On checkroute
 if game_on is not 1 then
   exit checkroute
 end if

   put 0 into frogaction
    checkroute1
    checkroute2
    checkroute3
    checkroute8


if route8 = 1  and  (frogloc is not 15) then
        game_Over
        exit checkroute
end if

if route2 = 1 then
  if ((frogloc >= 17  and frogloc <=20) or (frogloc >= 1  and frogloc <=3)) then
        game_Over
        exit checkroute
  else 
         if frogloc = 21 and (step22_egg = 1 or step23_egg = 1) then
          game_Over
          exit checkroute
         end if

         if frogloc = 22 and step23_egg = 1 then
          game_Over
          exit checkroute
         end if

  end if
end if



if route3 = 1 then
  if (frogloc =17) and route1=1 then 
       game_Over
       exit checkroute
  end if
   if (frogloc =17) and route1=0 then 
      put 1 into clickclick
      click at btn %clickclick%
      exit checkroute
   end if
end if


if route1 = 1 then
  if (frogloc =1) and route3=1 then 
       game_Over
       exit checkroute
  end if
   if (frogloc =1) and route3=0 then 
      put 17 into clickclick
      click at btn %clickclick%
      exit checkroute
   end if
end if



-------------------------------------
if frogloc = 24 then
  put 11 into clickclick
  click at btn %clickclick%
  exit checkroute
end if

if frogloc = 19 then
  put 3 into clickclick
  click at btn %clickclick%
  exit checkroute
end if

if frogloc = 3 then
  put 20 into clickclick
  click at btn %clickclick%
  exit checkroute
end if


if frogloc = 15  then
   click at btn %frogloc%
 else


put frogloc +1 into clickclick
  click at btn %clickclick%
  exit checkroute
end if

End checkroute


On game_Over
put 2 into game_on
go cd 3
refreshcd3

play uhoohhh

lock screen
set loc of btn wichback to 309, 238
show btn wichback
play madwoman

set loc of btn ldragon1 to locH of btn wichback, locV of btn wichback
show btn ldragon1
unlock screen

ldragonanime


wait 10 ticks
play Beethovn
wait 6 seconds
exitkingdom
exit game_over


End game_Over

On game_Over2
put 2 into game_on
go cd 3
refreshcd3

play uhoohhh

lock screen
set loc of btn wichback to 309, 238
show btn wichback
play madwoman
set loc of btn ldragon1 to locH of btn wichback, locV of btn wichback
show btn ldragon1
unlock screen

ldragonanime


wait 10 ticks
play Beethovn
wait 6 seconds

exitkingdom
exit game_over2


End game_Over2



On game_Over3
put 2 into game_on
go cd 3
refreshcd3

play uhoohhh

lock screen
set loc of btn wichback to 309, 238
show btn wichback
play madwoman

set loc of btn ldragon1 to locH of btn wichback, locV of btn wichback
show btn ldragon1
unlock screen

ldragonanime


wait 10 ticks
play Beethovn
wait 6 seconds
exitkingdom
exit game_over3

End game_Over3





-------------- end card 3 -----------------

On Entranceback
play uhoohhh
wait 150 ticks
put 0 into gamestptemporary



if (thnderbridge21 = 3 or thnderbridge24 = 3) and time_resque = 999 then
      game_Over
      exit entranceback
end if 




put random(2) into rdmback
if rdmback = 1 then
  put 17  into frogloc
end if
if rdmback = 2 then
  put 1 into frogloc
end if
go cd 3
 refreshcd3

click at btn %frogloc%
exit entranceback
End Entranceback


On m_KingdomTours

if grade_level = 0 then
  put  9 into  top_pos_x
  getcdtogo
end if

if grade_level = 1 then
  put  11 into  top_pos_x
  getcdtogo
end if

if grade_level = 2 then
  put  11  into  top_pos_x
  getcdtogo
 end if

if selectedcardtogo = 1 then
--dblqandwait
 show btn t_writer
  message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
     go cd 48
q_clock48
   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback

   exit m_KingdomTours
   end if
end if

if selectedcardtogo = 2 then

--  dblqandwait
 show btn t_writer
  message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 46
  q_clock46
   if math_answer is not 1 then

          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback

     exit m_KingdomTours
   end if
end if















if selectedcardtogo = 3 then
  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 41

Game_BunboBunsi5_2

   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback

     exit m_KingdomTours
   end if

end if



if selectedcardtogo = 4 then
--dblqandwait
 show btn t_writer
  message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
     go cd 47
q_clock47
   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback

   exit m_KingdomTours
   end if
end if




if selectedcardtogo = 5 then
-- dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 102
     Gamestart
     if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback


     exit m_KingdomTours
     end if


end if



if selectedcardtogo = 6 then
--  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 103
     Gamestart
     if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback


     exit m_KingdomTours
     end if


end if


if selectedcardtogo = 7 then
--dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 104
     Gamestart
     if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary

          entranceback

     exit m_KingdomTours
     end if


end if

if selectedcardtogo = 8 then
--dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 105
     Gamestart
     if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback


     exit m_KingdomTours
     end if


end if







if selectedcardtogo = 9 then
  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 34
  gamestart2 
   if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback

     exit m_KingdomTours
   end if
 wait 30 ticks

end if




if selectedcardtogo = 10 then
  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer

  go cd 31
     Gamestart2
     if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
          entranceback

     exit m_KingdomTours
     end if


end if

if selectedcardtogo = 11 then
  dblqandwait
show btn t_writer
 message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you fail to solve the question, you will be returned to the entrance!"
hide btn t_writer
  go cd 35
     gamestart2
      if math_answer is not 1 then
          if math_answer = -1 then
            game_over2
            exit m_KingdomTours

           end if
put 0 into gamestptemporary
           entranceback

     exit m_KingdomTours
    end if
   wait 30 ticks

end if







if gamestptemporary is not 999 then
 go cd 3
 refreshcd3
checkroute

 exit m_KingdomTours
end if



End m_KingdomTours






On OK100
    set loc of btn t_writer to 368, 79
    show btn t_writer
  message2 289, 31, 9, "Congratulations!  Your answers are 100% correct!"
  hide btn t_writer
End OK100
On OK80
   set loc of btn t_writer to 368, 79
     show btn t_writer
  message2 289, 31, 9, "Congratulations!  Your answers are 80% correct!"
  hide btn t_writer
End OK80

On OK60
   set loc of btn t_writer to 368, 79
     show btn t_writer
  message2 289, 31, 9, "Congratulations!  Your answers are 60% correct!"
  hide btn t_writer
End OK60

On dblqandwait
play dblquiz
put 1 into ntx
naratoranimex
wait 120 ticks
End dblqandwait


On getcdtogo

put random( top_pos_x ) into ctj
repeat top_pos_x times
 if Item ctj of checkcardlist = minimum_level then
     put ctj into selectedcardtogo
     put Item ctj of checkcardlist + 1 into Item ctj of checkcardlist
    exit getcdtogo
 else
    put ctj + 1 into ctj
 end if
   if  ctj > top_pos_x then
       put 1 into  ctj
   end if
 end repeat
   put minimum_level + 1 into minimum_level
   put random( top_pos_x ) into ctj
   put ctj into selectedcardtogo
  put Item ctj of checkcardlist + 1 into Item ctj  of checkcardlist

End getcdtogo


On gocd3
go cd 3
End gocd3

On gocd4
go cd 4
End gocd4

On gocd6
go cd 6
End gocd6


On gocd32
go cd 32
End gocd32

On gocd39
go cd 39
End gocd39

On gocd36
go cd 36
End gocd36

On gocd42
go cd 42
End gocd42

On gocd41
go cd 41
End gocd41

On gocd40
go cd 40
End gocd40

On gocd33
go cd 33
End gocd33

On gocd35
go cd 35
End gocd35

On gocd37
go cd 37
End gocd37

On gocd30
go cd 30
End gocd30

On gocd31
go cd 31
End gocd31

On gocd10
go cd 10
End gocd10

On gocd11
go cd 11
End gocd11

On gocd13
go cd 13
End gocd13

On gocd17
go cd 17
End gocd17

On gocd44
go cd 44
End gocd44

On gocd45
go cd 45
End gocd45

On gocd34
go cd 34
End gocd34


On gocd46
go cd 46
End gocd46
On gocd47
go cd 47
End gocd47
On gocd48
go cd 48
End gocd48

On gocd100
go cd 100
End gocd100

On gocd99
go cd 99
End gocd99

On gocd101
go cd 101
End gocd101


On gocd102
go cd 102
End gocd102


On gocd103
go cd 103
End gocd103


On gocd104
go cd 104
End gocd104


On gocd105
go cd 105
End gocd105


On gocd106
go cd 106
End gocd106


On gocd107
go cd 107
End gocd107


On gocd108
go cd 108
End gocd108




On Sansu_owaru
 quit
End Sansu_owaru

On Erase_Sound
	SoundOnOff
End Erase_Sound

-------------------------- card 4 ---------------

On idle 4
put random(50) into rdm4
if rdm4 = 5  then
  idle_anime_baloon
end if

if rdm4 = 7  then
  idle_anime_bee
end if

if rdm4 = 9  then
  idle_anime_oct
end if

if rdm4 = 11  then
  idle_anime_frg
end if

if rdm4 = 13  then
  idle_anime_clock
end if

if rdm4 = 15 then
  Oltmove4
end if


if rdm4 = 18 then
  manmtmove4
end if

if rdm4 = 20 then
horseminmove
end if
if rdm4  = 25 then
oyosomove
end if

if rdm4  = 30 then
satelitelanding
end if

End idle



On idle_anime_baloon
set the loc of btn baloon  to 625, 105
show btn baloon
soundrandom
repeat with idle4x = 1 to 60
  put random(5) into idle4y
  if idle4x < 15 then
     put 105 - 2 * idle4x into nnnn
  else
     if idle4x = 15 then
          put nnnn into yyyy
     else
         if idle4x < 30  then
             put yyyy + 3 * idle4x   into nnnn
          else
              if idle4x = 30 then
                 put nnnn into yyyy
              else
                  put yyyy - 2 * (idle4x - 30 )  into nnnn
              end if
          end if

      end if
  end if

  set the loc of btn baloon to 625 - 10 * idle4x, nnnn - idle4y
  wait 5 ticks
  if mouseclick() then
    play click
    go cd 6
   exit idle_anime_baloon
  end if
  
end repeat
 hide btn baloon

End idle_anime_baloon


On idle_anime_bee
set the loc of btn bee_lfts  to 548, 229
show btn bee_lfts
play bee
repeat with idle4x = 1 to 57
  put random(10) into idle4y
  put random(10) into xx4
  set the loc of btn bee_lfts to 548 - 10 * idle4x + xx4, 229 - 5 * idle4x - idle4y
  wait 5 ticks
  if mouseclick() then
   exit repeat
  end if
  
end repeat

set the loc of btn bee_lfts  to 548, 229

End idle_anime_bee

On idle_anime_oct
play ocean
repeat with idle4x = 1 to 3
  set bitmap of btn oct0 to oct2
    wait 10 ticks
  set bitmap of btn oct0 to oct1
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn oct0 to oct0
 

End idle_anime_oct

On idle_anime_frg
play frog
repeat with idle4x = 1 to 3
  set bitmap of btn frg1 to frg2
    wait 10 ticks
  set bitmap of btn frg1 to frg1
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn frg1 to frg1
 

End idle_anime_frg

On idle_anime_clock
play clock2
repeat with idle4x = 1 to 2
  set bitmap of btn clock1 to clock2
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock3
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock2
    wait 10 ticks
  if mouseclick() then
   exit repeat
  end if
  set bitmap of btn clock1 to clock1
    wait 20 ticks
  if mouseclick() then
   exit repeat
  end if
end repeat
   set bitmap of btn clock1 to clock1
 

End idle_anime_clock
----------------------------- end card 4 ------------------



On Allcard_q5

put 0 into q5_score
if presentcard = 40 then
 
 repeat 5 times
    howmanycandy10
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
  end repeat

end if


if presentcard = 32 then
  repeat 5 times
    makeorder
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
   end repeat
end if


if presentcard = 33 then
  repeat 5 times
   q_clock33
     if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
 end repeat

end if

if presentcard = 41 then
 
  repeat 5 times
    howmanycandy100
     if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
 end repeat

end if

if presentcard = 37 then
      repeat 5 times
         howtomeasure123
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
   end repeat

end if

if presentcard = 42 then
     repeat 5 times
           random_selection_of_column
           q_multiplication
   if math_answer is not 1 then
      if math_answer = -1 then
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if

   end repeat

end if

if presentcard = 39 then
   repeat 5 times
   put random(4) into rdmlives
   if rdmlives = 1 then
        bird2_chosen
   end if
   if rdmlives = 2 then
       octpus_chosen
   end if
   if rdmlives = 3 then
       Zebra_chosen
   end if
   if rdmlives = 4 then
       Ladybugs_chosen
   end if

   if math_answer is not 1 then
      if math_answer = -1 then
          play uhoh2
          exit Allcard_q5
      end if
 
   else
    put q5_score +1 into q5_score
   end if
  end repeat
end if

if q5_score = 5 then
   play fanfar2
   wait 5 seconds
   ok100
end if
if q5_score = 4 then
   play fanfar2
   wait 5 seconds
  ok80
end if
if q5_score = 3 then
   play fanfar2
   wait 5 seconds
  ok60
end if
if q5_score = 2 or q5_score = 1 or q5_score = 0  then
   play Uhoohhh
   wait 2 seconds
end if
   

End Allcard_q5

--------------------------------------------
On Opencard 9
play ufo
set loc of btn satelite to 630, 71
set loc of btn satelite to 521, 95
set loc of btn satelite to 391, 121
set loc of btn satelite to 268, 146
set loc of btn satelite to 181, 155
set loc of btn satelite to 138, 174
set loc of btn satelite to 136, 191
set loc of btn satelite to 173, 204
set loc of btn satelite to 245, 213
set loc of btn satelite to 345, 209
set loc of btn satelite to 404, 190
set loc of btn satelite to 408, 174
set loc of btn satelite to 354, 158
set loc of btn satelite to 248, 149
set loc of btn satelite to 150, 160
set loc of btn satelite to 85, 182
set loc of btn satelite to 37, 220
set loc of btn satelite to 28, 254
set loc of btn satelite to 41, 297
set loc of btn satelite to 104, 339
set loc of btn satelite to 195, 377
set loc of btn satelite to 285, 391
set loc of btn satelite to 401, 396
set loc of btn satelite to 435, 377
set loc of btn satelite to 431, 365
set loc of btn satelite to 393, 360
set loc of btn satelite to 355, 356
set loc of btn satelite to 319, 366
set loc of btn satelite to 315, 383
set loc of btn satelite to 352, 408
set loc of btn satelite to 392, 418
set loc of btn satelite to 429, 424
go cd 6

End Opencard

On opencard 20
randomeyeanime
put random(2) into rdm
--show fld information
if rdm = 1 then
 play water
 movebtn1
else
if random(2) = 1 then
 play ocean
 sanyomove2
else
play smallwa
 Ommove
end if
end if
End opencard


On opencard 21
randomeyeanime
if random(2) = 1 then
  play squeakie
else
 play kitten
end if
 movebtn1
End opencard


On opencard 15
randomeyeanime
if random(2) = 1 then
play windx
else
play moooo
end if
set bitmap of btn balki1 to balki2
wait 2 seconds
End opencard




On opencard 22
randomeyeanime
lock screen
put random(2) into rdm
put random(2) into rdm2
if rdm = 2 then
play elephant
 show btn manmta
 show btn manmtb
end if

--show fld information
unlock screen

if rdm = 1 then
 play pyu_
 movebtn1
else
   play elephant

 if random(2) = 1 then
   set bitmap of btn  manmta to  manmtb
   wait 30 ticks
   set bitmap of btn  manmta to  manmta
   wait 30 ticks
   set bitmap of btn  manmta to  manmtb
   wait 30 ticks
   set bitmap of btn  manmta to  manmta
   wait 30 ticks

 else
   set bitmap of btn  manmtb to  manmta
   wait 30 ticks
   set bitmap of btn  manmtb to  manmtb
   wait 30 ticks
   set bitmap of btn  manmtb to  manmta
   wait 30 ticks
   set bitmap of btn  manmtb to  manmtb
   wait 30 ticks

 end if
end if



End opencard

On opencard 23
randomeyeanime
lock screen
put random(2) into rdm
show fld information
if rdm = 1 then
set loc of btn 1 to LocH of btn 1 - 150, LocV of btn 1
end if
unlock screen
if rdm = 1 then
movebtn1Back
else
movebtn1
end if
End opencard

On opencard 24
randomeyeanime
put random(2) into rdm
put random(2) into rdm2
--show fld information
if rdm = 1 then
 play water
 movebtn1
else
if rdm2 = 1 then
 play smallwa
 VolVoxmove
end if
if rdm2 = 2 then
play bombom
 Benmomove
end if





end if


End opencard

On opencard 25
randomeyeanime
lock screen
put random(2) into rdm
if rdm = 2 then
 show btn ictiost1
end if

--show fld information
unlock screen

if rdm = 1 then
  play pyu_
   movebtn1

else
   play roar
   repeat 3 times
   set bitmap of btn  ictiost1 to  ictiost2
   wait 1 ticks
   set bitmap of btn  ictiost1 to  ictiost3
   wait 1 ticks
   set bitmap of btn  ictiost1 to  ictiost2
   wait 1 ticks
   set bitmap of btn  ictiost1 to  ictiost1
   wait 1 ticks
   end repeat
end if




End opencard

On opencard 26
randomeyeanime
put random(2) into rdm
--show fld information

if rdm = 1 then
 play fliker
movebtn1
else
   play bee
   Tonbomove
end if


End opencard

On opencard 27
randomeyeanime
play growling
 movebtn1

End opencard






On opencard 30
randomeyeanime
put random(2) into rdm2
--show fld information
  if rdm2 = 1 then
   play growling
   repeat 3 times
   lock screen
   set bitmap of btn arosaul1 to arosaul2
   unlock screen
   lock screen
   set bitmap of btn arosaul1 to arosaul3
   unlock screen
   lock screen
   set bitmap of btn arosaul1 to arosaul2
   unlock screen
   lock screen
   set bitmap of btn arosaul1 to arosaul1
   unlock screen
   end repeat
--else
--  rafolnksmove2
end if
End opencard






On opencard 28
randomeyeanime

put random(2) into rdm
--show fld information
if rdm = 1 then
 if random(2) = 1 then
 play hawkcry
else
 play roar
end if
 movebtn1
else
play vulture
oltanime
end if
End opencard


On opencard 29
randomeyeanime
put random(2) into rdm
--show fld information

if rdm = 1 then
if random(2) = 1 then
 play thunder
else
 play stonfall
end if

 movebtn1
else
  if random(2) = 1 then
      vol50i
  else
     thndr50
  end if
end if
End opencard






On moveBtn1
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 28
set loc of btn 1 to btn1x - 10 * (i-1), btn1y
end repeat
End mOvebtn1

On moveBtn1Back
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 28
set loc of btn 1 to btn1x + 10 * (i-1), btn1y
end repeat
End mOvebtn1Back

On moveBtn1130
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x - 13 * (i-1), btn1y
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End movebtn1130



On moveBtn1Up100
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x, btn1y - (i-1) * 10
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End mOvebtn1Up100



On moveBtn1Up200
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x, btn1y - (i-1) * 20
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End mOvebtn1Up200

On moveBtn1Up300
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 15
set loc of btn 1 to btn1x, btn1y - (i-1) * 20
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End mOvebtn1Up300



On moveBtn1Up400
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 15
set loc of btn 1 to btn1x, btn1y - (i-1) * 26
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End mOvebtn1Up400



On moveBtn1Up500
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 15
set loc of btn 1 to btn1x, btn1y - (i-1) * 30
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End mOvebtn1Up500


On moveBtn1down150
All_Egg_REfresh
put LocH of btn 1 into btn1x
put LocV of btn 1 into btn1y
repeat with i = 1 to 10
set loc of btn 1 to btn1x, btn1y + (i-1) * 15
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End mOvebtn1down150

-----------------------------------Animation
On Rafolnksmove
play pyu_
set loc of btn rafolnks to 730, -86
show btn rafolnks
wait 1 ticks
set loc of btn rafolnks to 690, -66
wait 1 ticks
set loc of btn rafolnks to 650, -44
wait 1 ticks
set loc of btn rafolnks to 610, -22
wait 1 ticks
set loc of btn rafolnks to 573, -2 
wait 1 ticks
set loc of btn rafolnks to 537, 23 
wait 1 ticks
if mouseclick() then
  exit Rafolnksmove
end if
set loc of btn rafolnks to 497, 45 
wait 1 ticks
set loc of btn rafolnks to 436, 70 
wait 1 ticks
set loc of btn rafolnks to 392, 82 
wait 1 ticks
set loc of btn rafolnks to 363, 92 
wait 1 ticks
set loc of btn rafolnks to 320, 100
wait 1 ticks
set loc of btn rafolnks to 279, 107 
wait 1 ticks
set loc of btn rafolnks to 234, 117 
wait 1 ticks
set loc of btn rafolnks to 180, 131 
wait 1 ticks
if mouseclick() then
  exit Rafolnksmove
end if
set loc of btn rafolnks to 125, 135 
wait 1 ticks
set loc of btn rafolnks to 87, 136 
wait 1 ticks
set loc of btn rafolnks to 37, 132 
wait 1 ticks
set loc of btn rafolnks to 10, 114 
wait 1 ticks
set loc of btn rafolnks to -22, 105 
wait 1 ticks
set loc of btn rafolnks to -45, 101 
wait 1 ticks
set loc of btn rafolnks to -70, 90 
wait 1 ticks
set loc of btn rafolnks to -100, 80 
wait 1 ticks
set loc of btn rafolnks to -150, 80 
End Rafolnksmove


On SanyomOve
play smallwa
lock screen
set loc of btn sanyo to -61, 385
show btn sanyo
unlock screen
repeat with i = 1 to 80
set loc of btn sanyo to -61 + (i-1)*10, 385 - (385-182)/75*(i-1)
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End SanyomOve

On SanyomOve2
play smallwa
lock screen
set loc of btn sanyo to 99, 223
show btn sanyo
unlock screen
repeat with i = 1 to 22
set loc of btn sanyo to 99 + (i-1)*20, 223 - (100/22)*(i-1)
wait 1 ticks
if mouseclick() then
 exit repeat
end if
end repeat
End SanyomOve2


On OmmOVE
play smallwa
set loc of btn c38om1 to 490,410-150 
show btn c38om1
lock screen
set bitmap of btn c38om1 to c38om1
set loc of btn c38om1 to 490, 410-150 
unlock screen
set loc of btn c38om1 to 490, 410-150  
set loc of btn c38om1 to 490, 410-150  
lock screen
set bitmap of btn c38om1 to c38om2
set loc of btn c38om1 to 480, 400-150  
unlock screen
set loc of btn c38om1 to 470, 390-150  
set loc of btn c38om1 to 450, 380-150  
set loc of btn c38om1 to 430, 370-150  
set loc of btn c38om1 to 410, 360-150  
lock screen
set bitmap of btn c38om1 to c38om1
set loc of btn c38om1 to 390, 350-150  
unlock screen
set loc of btn c38om1 to 390, 350 -150 
set loc of btn c38om1 to 390, 350-150  
set loc of btn c38om1 to 390, 350-150  
lock screen
set bitmap of btn c38om1 to c38om2
set loc of btn c38om1 to 370, 340-150  
unlock screen
set loc of btn c38om1 to 350, 330-150  
set loc of btn c38om1 to 330, 320 -150 
set loc of btn c38om1 to 310, 310 -150 
set loc of btn c38om1 to 290, 300-150  
lock screen
set bitmap of btn c38om1 to c38om1
set loc of btn c38om1 to 270, 290-150  
unlock screen
set loc of btn c38om1 to 270, 290-150  
set loc of btn c38om1 to 270, 290-150  
set loc of btn c38om1 to 270, 290-150  
lock screen
set bitmap of btn c38om1 to c38om2
set loc of btn c38om1 to 250, 280-150  
unlock screen
set loc of btn c38om1 to 230, 270 -150 
set loc of btn c38om1 to 210, 260-150  
set loc of btn c38om1 to 190, 250 -150 
hide btn c38om1

end OmmOVE

On TaiyochumOve
play smallwa
lock screen
set loc of btn taiyochu to -51, 54
show btn taiyochu
unlock screen
repeat with i = 1 to 75
set loc of btn taiyochu to -51 + (i-1)*10, 54 + (376 - 54)/75*(i-1)
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat
End TaiyochumOve


on ty_an12move
play dinasaur
lock screen
set loc of btn ty_an1 to 680, 380
show btn ty_an1
unlock screen
repeat with i = 1 to 21
if i mod 2 = 0 then
set bitmap of btn ty_an1 to ty_an1
else
set bitmap of btn ty_an1 to ty_an2
end if
set loc of btn ty_an1 to 680 - (i-1)*50, 380
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat

End ty_an12move




on c64auafmove
play pyu_
lock screen
set loc of btn c64aua to 680, 365
show btn ty_an1
unlock screen
repeat with i = 1 to 28
if i mod 6 = 0 then
set bitmap of btn c64aua to c64aua
end if
if i mod 6 = 1 then
set bitmap of btn c64aua to c64aub
end if
if i mod 6 = 2 then
set bitmap of btn c64aua to c64auc
end if
if i mod 6 = 3 then
set bitmap of btn c64aua to c64aud
end if
if i mod 6 = 4 then
set bitmap of btn c64aua to c64aue
end if
if i mod 6 = 5 then
set bitmap of btn c64aua to c64auf
end if

set loc of btn c64aua to 680 - (i-1)*30, 365
wait 1 ticks
if mouseclick() then
  exit repeat
end if
end repeat

End c64auafmov
----------------------------------------------
On Opencard 6
Lock Screen

if grade_level = 2 then
   set bitmap of btn b_red1 to b_red2
end if
if grade_level = 0 then
   set bitmap of btn b_green1 to b_green2
end if
if grade_level = 1 then
   set bitmap of btn b_yell1 to b_yell2
end if

Unlock Screen

if firsttimehello is not 9999 then
   play hello
   put 1 into ntx
   naratoranimex 
 play muon
   put 9999 into firsttimehello


end if


put 0  into pbredl


put random(3) into xxx

if xxx = 1 then
Rafolnksmove
end if

if xxx = 2 then
taiyochumove
end if

if xxx = 3 then
sanyomove
end if


hide btn opeboard

wait 10 ticks
push_b_redl

exit opencard
end Opencard







On Push_B_Blue
play click_a3
set bitmap of btn b_blue1 to b_blue2

put 1 into whichgame
go cd 2
End Push_B_Blue


On push_b_redl

play knob
if pbredl is not 9999 then
lock screen
hide btn opeboard
set bitmap of btn b_redl1 to b_redl2
unlock screen
put 9999 into pbredl
else
lock screen
show btn opeboard
set bitmap of btn b_redl1 to b_redl1
unlock screen
put 0 into pbredl

end if
if thefirsttime = 0 then
put 1 into thefirsttime
put 11 into ntx
wait 100 ticks
put 4 into ntx

play begin1
naratoranimex
wait 20 ticks
put 6 into ntx
if mouseclick() then
  play muon
  exit push_b_redl
end if

play begin2
naratoranimex
wait 60 ticks
put 2 into ntx
if mouseclick() then
  play muon
  exit push_b_redl
end if

play begin3
naratoranimex
wait 30 ticks


wait 200 ticks
play muon

click at btn b_green1

 exit push_b_redl
end if


End push_b_redl



On push_hassin
--play knob
set bitmap of btn hassin1 to hassin2
wait 10 ticks
kingdom
End push_hassin


On push_b_green
--play click_a3
lock screen
set bitmap of btn b_green1 to b_green2
set bitmap of btn b_yell1 to b_yell1
set bitmap of btn b_red1 to b_red1
unlock screen
set_gradel
wait 60 ticks
push_hassin
exit push_b_green
End push_b_green


On push_b_yell
--play click_a3
lock screen
set bitmap of btn b_yell1 to b_yell2
set bitmap of btn b_green1 to b_green1
set bitmap of btn b_red1 to b_red1
unlock screen
set_gradem
End push_b_yell


On push_b_red
--play click_a3
lock screen
set bitmap of btn b_red1 to b_red2
set bitmap of btn b_yell1 to b_yell1
set bitmap of btn b_green1 to b_green1
unlock screen
set_gradeh
End push_b_red

On Oltanime
put LocH of btn Olt_an1 into xo
put LocV of btn Olt_an1 into yo
put LocH of btn Ty_an1 into xT
put LocV of btn Ty_an1 into yT
hide btn Olt_an1
hide btn Ty_an1
set loc of btn Olt_an1 to 680, yo
show btn Olt_an1
play Vulture
repeat with i = 1 to 10
lock screen
if i mod 2 = 0 then
set bitmap of btn Olt_an1 to Olt_an1
else
set bitmap of btn Olt_an1 to Olt_an2
end if
set loc of btn Olt_an1 to 680 - (i-1) * 30, yo
unlock screen
end repeat
play dinasaur
set loc of btn Ty_an1 to 680, yT
show btn Ty_an1

Repeat with i = 11 to 36
lock screen
if i mod 2 = 0 then
set bitmap of btn Olt_an1 to Olt_an1
set bitmap of btn Ty_an1 to Ty_an1
else
set bitmap of btn Olt_an1 to Olt_an2
set bitmap of btn Ty_an1 to Ty_an2
end if
set loc of btn Olt_an1 to 680 - (i-1) * 30, yo
set loc of btn Ty_an1 to 680 - (i-11) * 30, yT
unlock screen
end repeat


End OltAnime




On vol50i
show btn vol50i
play bombaway
 repeat with i = 1 to 3
 set bitmap of btn vol50i to vol50
 wait 7 ticks
 set bitmap of btn vol50i to vol50i
 wait 7 ticks
 end repeat
  set bitmap of btn vol50i to vol502
 wait 7 ticks
  set bitmap of btn vol50i to vol503
 wait 15 ticks
  set bitmap of btn vol50i to vol504
 wait 20 ticks
 set bitmap of btn vol50i to vol50



End vol50i




On thndr50
   put random(400) into x
   play thunder
   set loc of btn thndr50_ to LocH of btn thndr50_ - x, LocV of btn thndr50_
   repeat with i= 1 to 3
   show btn thndr50_
   hide btn thndr50_
   end repeat
End thndr50



On Tonbomove
lock screen
show btn tonbo
set loc of btn tonbo to 570,273-40 
set direction of btn tonbo to 4
unlock screen
set loc of btn tonbo to 555, 264-60 
set loc of btn tonbo to 545, 258 -60
set loc of btn tonbo to 530, 250 -60
set loc of btn tonbo to 515, 240 -60
set loc of btn tonbo to 510, 237 -60
set loc of btn tonbo to 495, 230 -60
set loc of btn tonbo to 480, 220 -60
set loc of btn tonbo to 460, 207 -60
set loc of btn tonbo to 440, 140
set loc of btn tonbo to 420, 140
set loc of btn tonbo to 400, 140
set loc of btn tonbo to 380, 140
set loc of btn tonbo to 363, 140
set loc of btn tonbo to 346, 140 
set loc of btn tonbo to 334, 140 
set loc of btn tonbo to 331, 140 
set loc of btn tonbo to 320, 140 
set loc of btn tonbo to 310, 140
set loc of btn tonbo to 290, 140
set loc of btn tonbo to 280, 140
set loc of btn tonbo to 270, 140
set loc of btn tonbo to 250, 140
set loc of btn tonbo to 239, 140
set loc of btn tonbo to 219, 140
set loc of btn tonbo to 199, 140
set loc of btn tonbo to 180,140
set loc of btn tonbo to 160, 140
set loc of btn tonbo to 140, 140 
set loc of btn tonbo to 130, 140 
set loc of btn tonbo to 140, 140 
set loc of btn tonbo to 110, 140 
set loc of btn tonbo to 100, 140 
set loc of btn tonbo to 90, 140 
set loc of btn tonbo to 80, 140 
set loc of btn tonbo to 70, 140 
set loc of btn tonbo to 60, 140 
set loc of btn tonbo to 50, 140 
set loc of btn tonbo to 40, 140 
set loc of btn tonbo to 30, 140 
set loc of btn tonbo to 20, 140 
set loc of btn tonbo to 10, 140 
set loc of btn tonbo to 0, 140 
set loc of btn tonbo to -10, 140 
set loc of btn tonbo to -20, 140 
set loc of btn tonbo to -30, 140 
End Tonbomove



On Benmomove
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  500, 185+100
show btn benmo1
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  490, 180+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  479, 179+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  470, 175+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  460, 172+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  450, 167+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  447, 164+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  440, 162+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  430, 158+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  420, 155+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  412, 152+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  405, 150+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  400, 148+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  390, 144+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  379, 140+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  370, 133+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  360, 132+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  355, 130+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  349, 128+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  340, 124+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  330, 120+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  320, 116+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  314, 111+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  310, 105+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  300, 100+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  290, 95+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  281, 93+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  270, 80+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  260, 70+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  250, 60+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  240, 55+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  235, 54+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  230, 53+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  220, 48+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  210, 40+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  200, 38+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  191, 34+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  180, 33+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  170, 29+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  160, 25+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  157, 22+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  150, 20+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  140, 18+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  133, 15+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  128, 11+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  120, 10+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  110, 7+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo2
 set loc of btn benmo1 to  107, 4+100
unlock screen
lock screen
set bitmap of btn benmo1 to benmo1
 set loc of btn benmo1 to  104, 0+100
unlock screen

End Benmomove





On VolVoxmove
set loc of btn volvox to 500, 250
show btn VolVox
set loc of btn volvox to 471, 243
set loc of btn volvox to 430, 235
set loc of btn volvox to 405, 220
set loc of btn volvox to 385, 215
set loc of btn volvox to 360, 208
set loc of btn volvox to 340, 200
set loc of btn volvox to 320, 194
set loc of btn volvox to 300, 180
set loc of btn volvox to 280, 169
set loc of btn volvox to 260, 160
set loc of btn volvox to 240, 150
set loc of btn volvox to 220, 140
set loc of btn volvox to 205, 137
set loc of btn volvox to 185, 130
set loc of btn volvox to 165, 118
set loc of btn volvox to 148, 110
set loc of btn volvox to 130, 100
set loc of btn volvox to 110, 100
set loc of btn volvox to 104, 100
set loc of btn volvox to 80, 100
set loc of btn volvox to 30, 100
End VolVoxmove


On Rafolnksmove2
play pyu_
set loc of btn rafolnks to 730, -86
show btn rafolnks
set loc of btn rafolnks to 690, -66
set loc of btn rafolnks to 650, -44
set loc of btn rafolnks to 610, -22
set loc of btn rafolnks to 573, -2 
set loc of btn rafolnks to 537, 23 
set loc of btn rafolnks to 497, 45 
set loc of btn rafolnks to 436, 70 
set loc of btn rafolnks to 392, 82 
set loc of btn rafolnks to 363, 92 
set loc of btn rafolnks to 320, 100
set loc of btn rafolnks to 279, 107 
set loc of btn rafolnks to 570, 117 
set loc of btn rafolnks to 530, 131 
set loc of btn rafolnks to 490, 135 
set loc of btn rafolnks to 450, 136 
set loc of btn rafolnks to 410, 132 
set loc of btn rafolnks to 370, 114 
set loc of btn rafolnks to 330, 114 
set loc of btn rafolnks to 290, 114 
set loc of btn rafolnks to 250, 114 
set loc of btn rafolnks to 210, 114 
set loc of btn rafolnks to 170, 114
set loc of btn rafolnks to 130, 114
set loc of btn rafolnks to 90, 114
set loc of btn rafolnks to 50, 114
set loc of btn rafolnks to 10, 114
End Rafolnksmove2

-----------------------

On Oltmove4
put LOcH of btn Olt_an1 into ox0
put LOcV of btn Olt_an1 into oy0
put LOcH of btn ty_an1 into tx0
put LOcV of btn ty_an1 into ty0

play vulture

set loc of btn Olt_an1 to 700, oy0
set loc of btn ty_an1 to 700, ty0
repeat with i = 1 to 28
lock screen
if i > 5 then
   if i mOD 2 = 0 then
  set bitmap of btn ty_an1 to ty_an2
   else
   set bitmap of btn ty_an1 to ty_an1
   end if
set loc of btn ty_an1 to 700- (i-6) * 40, ty0

end if
  
if i mOD 2 = 0 then
  set bitmap of btn Olt_an1 to Olt_an2
else
   set bitmap of btn Olt_an1 to Olt_an1
end if
set loc of btn olt_an1 to 700- (i-1) * 40, oy0
unlock screen
end repeat

set loc of btn Olt_an1 to ox0, oy0
set loc of btn ty_an1 to tx0, ty0

End Oltmove4



On manmtmove4
play elephant
repeat 2 times
set bitmap of btn manmta to manmtb
wait  30 ticks
set bitmap of btn manmta to manmta
wait 30 ticks
end repeat
End manmtmove4


On horseminmove
put LOcH of btn horse1s into h1x0
put LOcV of btn horse1s into h1y0
put LOcH of btn horse2s into h2x0
put LOcV of btn horse2s into h2y0
play horse
if random(2) = 1 then

repeat with i = 1 to 20
lock screen
   if i mod 8 = 0 then
      set bitmap of btn horse1s to horse2s
   end if
   if i mod 8 = 1 then
      set bitmap of btn horse1s to horse3s
   end if
   if i mod 8 = 2 then
      set bitmap of btn horse1s to horse4s
   end if
   if i mod 8 = 3 then
      set bitmap of btn horse1s to horse5s
   end if
   if i mod 8 = 4 then
      set bitmap of btn horse1s to horse6s
   end if
   if i mod 8 = 5 then
      set bitmap of btn horse1s to horse7s
   end if
   if i mod 8 = 6 then
      set bitmap of btn horse1s to horse8s
   end if
   if i mod 8 = 7 then
      set bitmap of btn horse1s to horse1s
   end if
 set loc of btn horse1s to h1x0 - (i-1) * 5, h1y0
unlock screen
 end repeat
 set loc of btn horse1s to h1x0 , h1y0
else
repeat  with i = 1 to 20
  lock screen
   if i mod 8 = 0 then
      set bitmap of btn horse2s to horse2s
   end if
   if i mod 8 = 1 then
      set bitmap of btn horse2s to horse3s
   end if
   if i mod 8 = 2 then
      set bitmap of btn horse2s to horse4s
   end if
   if i mod 8 = 3 then
      set bitmap of btn horse2s to horse5s
   end if
   if i mod 8 = 4 then
      set bitmap of btn horse2s to horse6s
   end if
   if i mod 8 = 5 then
      set bitmap of btn horse2s to horse7s
   end if
   if i mod 8 = 6 then
      set bitmap of btn horse2s to horse8s
   end if
   if i mod 8 = 7 then
      set bitmap of btn horse2s to horse1s
   end if
 set loc of btn horse2s to h2x0 - (i-1) * 5, h2y0
 unlock screen
 end repeat
lock screen
 set loc of btn horse2s to h2x0 , h2y0
       set bitmap of btn horse2s to horse2s
unlock screen

end if


End horseminmove

on oyosomove
repeat 2 times
set bitmap of btn oranflag to oyoso
wait 1 seconds
set bitmap of btn oranflag to oranflag
wait 1 seconds
end repeat

end oyosomove


On satelitelanding
put LOcH of btn satelite into ox
put LocV of btn satelite into oy
put 680 into i
play ufo
repeat while i - 10 > LOcH of btn kingdom2 + 84
put i - 10 into i
set loc of btn satelite to i, 73
end repeat
put 73 into j
repeat while j + 10 < LOcV of btn kingdom2 + 33
put j + 10 into j
set loc of btn satelite to i, j
end repeat
repeat while j  < LOcV of btn kingdom2 + 33
put j + 1 into j
set loc of btn satelite to i, j
end repeat

wait 30 ticks
if mouseclick() then
set loc of btn satelite to ox, oy

exit satelitelanding

end if
repeat while j - 10 >  73
put j - 10 into j
set loc of btn satelite to i, j
end repeat

repeat while i > -30
put i - 10 into i
set loc of btn satelite to i,j
end repeat

set loc of btn satelite to ox, oy

End satelitelanding


On satelitelanding2

put LOcH of btn satelite into ox
put LocV of btn satelite into oy
put 680 into i
play ufo
repeat while i - 10 > LOcH of btn kingdom2 + 84
put i - 10 into i
set loc of btn satelite to i, oy
end repeat
put oy into j
repeat while j + 10 < LOcV of btn kingdom2 + 33
put j + 10 into j
set loc of btn satelite to i, j
end repeat
repeat while j  < LOcV of btn kingdom2 + 33
put j + 1 into j
set loc of btn satelite to i, j
end repeat


End satelitelanding2


On opencard 7

satelitelanding2
go cd 19
exit opencard
End Opencard

On Opencard 19
show btn t_writer
message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "If you succeed in answering the last three questions, you will pass to the present world! If you fail, you will be returned to 4 billion years ago! Good Luck!"
put 999 into gamestptemporary
hide btn t_writer


if grade_level = 0 then
      quiz100
end if

if grade_level = 1 then
      quiz101
end if

if grade_level = 2 then
      quiz102
 end if

       if math_answer = 1 and  math_time < responselimit + 5 then
            play good
            show_frog_good
            wait 1 seconds
       else
           if  math_time > responselimit + 5 then
           show btn t_writer
            message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "Aha! It is too late for you to answer!"
            hide btn t_writer
             end if
          put 0 into gamestptemporary

put random(2) into rdmback
if rdmback = 1 then
  put 17  into frogloc
end if
if rdmback = 2 then
  put 1 into frogloc
end if
go cd 3
 refreshcd3
           click at btn %frogloc%
          exit opencard
       end if

      quiz100
       if math_answer = 1 and  math_time < responselimit + 5 then
            play good
            show_frog_good
            wait 1 seconds
       else
         if  math_time > responselimit + 5 then
     show btn t_writer
     message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "Aha! It is too late for you to answer!"
    hide btn t_writer
        end if
put 0 into gamestptemporary
put random(2) into rdmback
if rdmback = 1 then
  put 17  into frogloc
end if
if rdmback = 2 then
  put 1 into frogloc
end if
go cd 3
 refreshcd3

        
         click at btn %frogloc%

        exit opencard
       end if

      m_KingdomTours
put 0 into gamestptemporary
     go cd 10

        play hallel2
       repeat 5 times
       set direction of btn narator1 to 0
       wait 5 ticks
       set direction of btn narator1 to 1
       wait 5 ticks
       set direction of btn narator1 to 2
       wait 5 ticks
       set direction of btn narator1 to 3
       wait 5 ticks
       end repeat
       set direction of btn narator1 to 0
       wait 5 ticks

show btn thumV
        play alright
        wait 2 seconds
        play Beethovn
        wait 6 seconds
        exitkingdom
        exit opencard


End Opencard






on randomeyeanime
if random(2) =  1 then
  set loc of btn eyeanim1 to 327,112

put random(10) into eye
if eye = 1 then
   show btn eyeanim1
  repeat 2 times
  set bitmap of btn eyeanim1 to eyeanim2
--   wait 2 ticks
  set bitmap of btn eyeanim1 to eyeanim1
--   wait 2 ticks
   end repeat
   hide btn eyeanim1
end if

if eye = 2 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim4
unlock screen
  repeat 2 times
  set bitmap of btn eyeanim1 to eyeanim3
--   wait 2 ticks
  set bitmap of btn eyeanim1 to eyeanim4
--   wait 2 ticks
   end repeat
   hide btn eyeanim1
end if

if eye = 3 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim5
unlock screen
  repeat 2 times
  set bitmap of btn eyeanim1 to eyeanim6
--   wait 2 ticks
  set bitmap of btn eyeanim1 to eyeanim5
--   wait 2 ticks
   end repeat
   hide btn eyeanim1
end if

if eye = 4 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim1
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim4
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim5
  wait 2 ticks



   hide btn eyeanim1
end if

if eye = 5 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanim4
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim4
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanim1
--  wait 2 ticks



   hide btn eyeanim1
end if


if eye = 6 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanima
unlock screen
--  wait 2 ticks
repeat 2 times
   set bitmap of btn eyeanim1 to eyeanimf
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanima
--  wait 2 ticks
end repeat


   hide btn eyeanim1
end if

if eye = 7 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanimb
unlock screen
--  wait 2 ticks
repeat 2 times
   set bitmap of btn eyeanim1 to eyeanime
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimb
--  wait 2 ticks
end repeat


   hide btn eyeanim1
end if

if eye = 8 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanimc
unlock screen
--  wait 2 ticks
repeat 2 times
   set bitmap of btn eyeanim1 to eyeanimd
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimc
--  wait 2 ticks
end repeat


   hide btn eyeanim1
end if

if eye = 9 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanimc
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimb
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanima
--  wait 2 ticks



   hide btn eyeanim1
end if

if eye = 10 then
lock screen
   show btn eyeanim1
   set bitmap of btn eyeanim1 to eyeanima
unlock screen
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimb
--  wait 2 ticks
   set bitmap of btn eyeanim1 to eyeanimc
--  wait 2 ticks



   hide btn eyeanim1
end if



end if

end randomeyeanime





on opencard 17
--------------
              put 999 into gamestptemporary

             show btn t_writer
             message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "Bad News! The Time Bridge has just been destroyed by time thunder. If you fail to answer the next 3 questions, you will never be able to return to the present world !"
             hide btn t_writer
 
             repeat 3 times
               if grade_level = 0 then
                 quiz100
              end if
              if grade_level = 1 then
                   quiz101
               end if
              if grade_level = 2 then
                 quiz102
               end if

              if math_answer = 1 and  math_time <= responselimit then
                  randomok
-------------- xxxxxxx
              else
                 game_over
                  exit opencard
              end if
              end repeat
             put 999 into time_resque 
              lock screen
               show btn  stp21_3
               show btn t_writer
              unlock screen
              message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "Good News! The Time Bridge has just been repaired by an emergency operation! But if more time thunder comes, all will be lost! Good Luck!"
              hide btn t_writer
                put 2 into thnderbridge21
                put 0 into gamestptemporary
  go cd 3
refreshcd3
checkroute
exit opencard


------------
end opencard




on opencard 18
      put 999 into gamestptemporary

        show btn t_writer
        message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "Bad News! The Time Bridge has just been destroyed by time thunder. If you fail to answer the next 3 questions, you will never be able to return to the present world!"
       hide btn t_writer
       repeat 3 times
         if grade_level = 0 then
           quiz100
         end if
         if grade_level = 1 then
           quiz101
         end if
         if grade_level = 2 then
           quiz102
         end if




       if math_answer = 1 and  math_time <= responselimit then
       randomok
       else
         game_over
        exit opencard
       end if
      end repeat
lock screen

       show btn  stp24_3
       show btn t_writer
unlock screen
       message2 (LocH of btn t_writer - 78), (LocV of btn t_writer-46), 9, "Good News! The Time Bridge has just been repaired by an emergency operation! But if more time thunder comes, all will be lost! Good Luck!"
      hide btn t_writer
        put 2 into thnderbridge24
        put 0 into gamestptemporary

        put 999 into time_resque 
  go cd 3
refreshcd3
checkroute
 exit opencard



end opencard

on refreshcd3

lock screen

if thnderbridge24 = 1 then
  set bitmap of btn stp24 to stp24_2
end if
if thnderbridge24 = 2 then
  set bitmap of btn stp24 to stp24_3
end if
if thnderbridge24 = 3 then
  set bitmap of btn stp24 to stp24_4
end if

if thnderbridge21 = 1 then
  set bitmap of btn stp21 to stp21_2
end if
if thnderbridge21 = 2 then
  set bitmap of btn stp21 to stp21_3
end if
if thnderbridge21 = 3 then
  set bitmap of btn stp21 to stp21_4
end if



set the loc of btn satelite to locH of btn %frogloc%, locV of btn %frogloc%
show btn satelite



unlock screen





All_Egg_REfresh2


end refreshcd3





on polygon
Omath Menu Polygon
end polygon


on pie
Omath Menu Sector
end pie


on colorit
Omath Menu ColorIt
end colorit






on colorit
Omath Menu ColorIt
end color it

On Oprint
OMath Menu Print

end Oprint


on file_omath
Omath Menu File
end file_omath

on plot_a_point
OMath Menu Plotapoint
end plot_a_point

on draw_line_with_2dots
OMath Menu LineSegment
end draw_line_with_2dots
on draw_vline
OMath Menu VerticalLine
end draw_vline
on draw_parallel_line
OMath Menu ParallelLine
end draw_parallel_line
on draw_circle_given_rad
OMath Menu Circle_radius
end draw_circle_given_rad
on hide_dot_line
OMath Menu Show/Hide
end hide_dot_line
on undo_operation
OMath Menu Undo
end undo_operation
on label_attach
OMath Menu Label
end label_attach
on set_commenting
OMath Menu Commenting
end set_commenting
on email_omath
OMath Mail

end email_omath

On move_object
OMath Menu Move
end move_object

On find_length
OMath Menu Length
End find_length

On find_angle
OMath Menu AngleSize
End find_angle

On erasing
OMath Menu Erase
End erasing

On point_intersection
OMath Menu Pointofintersection
End point_intersection










---------------Registration
On showstamp
show_lock
End showstamp


On inputkey
set_key
End inputkey

On go_registration
go cd 110
End go_registration



