--------------  card 48---------
On opencard 48
  put 48 into presentcard
  put 0 into init48
if game_on is not 1 then
 play yo_idon2
   put 3 into ntx
   naratoranimex
wait 20 ticks
 play bokuwo
   put 5 into ntx
   naratoranimex

end if




put LocH of btn chita1 into XoriginalP
put LocV of btn chita1 into YoriginalP
put 0 into QMODE
end opencard




On q_48
-- if game_on is  1 and init48 = 0 then
--play imananji
--   put 3 into ntx
--   naratoranimex
-- put 1 into init48
--  end if
put 10 into distancerun
put 0.0 into p_distance
PutFloat1 p_distance into fld present_distance
put 1 into QMODE
put 0 into quiz_quit
put random(80) into StopNum
hide btn "Make cheetah run"
ChitaRun


 if p_distance > 0.9 and  p_distance <= 9.9then
  put 1 into KURAI
 else
     if p_distance > 9.9 and  p_distance <= 99.9 then
       put 2 into KURAI
     else
         if p_distance > 99.9 then
              put 3 into kurai
         else
             if p_distance > 999.9 then
               put 4 into kurai
             else
              put 0 into kurai
             end if
         end if
      end if
 end if

if KURAI = 0 then
    if  p_distance >=0.5 then
      put 1 into ans
    else 
      put 0 into ans
     end if
  QuizDlg4  "Redondea hasta el prximo nmero entero el recorrido del guepardo!  ", ans
else

  put random(KURAI) into n
  if n = 1 then
    put p_distance Mod 10 into m
    if m >= 5 then
      put p_distance - m + 10 into ans
    else
      put p_distance - m  into ans
    end if
    QuizDlg4  "Redondea hasta la prxima dcima el recorrido del guepardo!  ", ans
  end if

  if n = 2 then
    put p_distance Mod 100 into m
    if m >= 50 then
      put p_distance - m + 100 into ans
    else
      put p_distance - m  into ans
    end if
    QuizDlg4  "Redondea hasta la prxima centcima  el recorrido del guepardo!  ", ans
  end if

  if n = 3 then
    put p_distance Mod 1000 into m
    if m >= 500 then
      put p_distance - m + 1000 into ans
    else
      put p_distance - m  into ans
    end if
    QuizDlg4  "Redondea hasta la prxima milsima el recorrido del guepardo! ", ans
  end if


  if n = 4 then
    put p_distance Mod 10000 into m
    if m >= 5000 then
      put p_distance - m + 10000 into ans
    else
      put p_distance - m  into ans
    end if
    QuizDlg4  "Redondea hasta la prxima diezmilsima  el recorrido del guepardo! ", ans
  end if
end if




      repeat while quiz_quit = 0
         wait 30 ticks
      end repeat






  if math_answer is not 1 then
         if math_answer is  -1 then
          play  uhoh2
          else
              play jawharp
              showwitch_surprised
          end if
       else
           play good
           show_frog_good
      end if
put 0 into QMODE
show btn "Make cheetah run"
End q_48
---------------------------



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


On  ChitaRun
set loc of btn Chita1 to XoriginalP, YoriginalP
put 450/(10 * 8) into unitdot
put 9624 into Cspeed

_Chitarun
End  ChitaRun


On ChitaStop
put 1 into StopFlag
End ChitaStop







On _Chitarun
put 0 into StopFlag
put 0 into unitcount
play catyowl




repeat with i = 1 to 10

put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita2
unlock screen
put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance
wait 1 ticks
 if StopFlag = 1  or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita3
unlock screen

put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance
wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if



put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita4
unlock screen


put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance
wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita5
unlock screen



put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if




put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita6
unlock screen
put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if

put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita7
unlock screen

put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance


wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita8
unlock screen

put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita1
unlock screen
put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if  (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if




end repeat


End _Chitarun











On  ChitaRun2
show fld clickstop
set loc of btn Chita1 to XoriginalP, YoriginalP
put 450/(10 * 8) into unitdot
put 9624 into Cspeed

_Chitarun2

hide fld clickstop


End  ChitaRun2





On _Chitarun2
put 0 into StopFlag
put 0 into unitcount
play catyowl




repeat with i = 1 to 10

put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita2
unlock screen
put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance
wait 1 ticks
 if mouseclick()  or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita3
unlock screen

put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance
wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if



put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita4
unlock screen


put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance
wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita5
unlock screen



put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if




put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita6
unlock screen
put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if

put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita7
unlock screen

put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance


wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita8
unlock screen

put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if


put unitcount + 1 into unitcount

lock screen
set loc of btn Chita1 to XoriginalP - unitcount * unitdot,YoriginalP
set bitmap of btn Chita1 to Chita1
unlock screen
put cspeed * unitcount/8 into p_distance
PutInt p_distance into fld present_distance

wait 1 ticks
 if mouseclick() or (QMOde=1 and unitcount = StopNum) then
   exit repeat
 end if




end repeat


End _Chitarun2





















-------------- end card 48 ---------
