home *** CD-ROM | disk | FTP | other *** search
/ ATComputers Catalog / AutoCont+ATcomp.bin / Data / GameLib.dcr / 00002_Idle-Handler.ls < prev    next >
Encoding:
Text File  |  2001-08-24  |  3.6 KB  |  134 lines

  1. on HdleIdleAktion
  2.   global _AktionName, _AktionSim, _AktionZeit, _AktionListe, _SpWeiter
  3.   if (the ticks - _AktionZeit) > _AktionListe[2] then
  4.     tell the stage
  5.       sprite(_AktionListe[1]).member = _AktionName & _AktionSim
  6.       _AktionSim = _AktionSim + _AktionListe[4]
  7.       _AktionZeit = the ticks
  8.       if _AktionListe[4] > 0 then
  9.         if _AktionSim > _AktionListe[3] then
  10.           if _AktionListe[5] then
  11.             _AktionSim = _AktionSim - 1
  12.             _AktionListe[3] = 1
  13.             _AktionListe[4] = -1
  14.             _AktionZeit = _AktionZeit + _AktionListe[6]
  15.           else
  16.             if _AktionListe[7] then
  17.               AktionZusatz(_AktionName)
  18.             end if
  19.             _AktionName = EMPTY
  20.             _AktionSim = 0
  21.             _SpWeiter = 1
  22.           end if
  23.         end if
  24.       else
  25.         if _AktionSim < _AktionListe[3] then
  26.           if _AktionListe[7] then
  27.             AktionZusatz(_AktionName)
  28.           end if
  29.           _AktionName = EMPTY
  30.           _AktionSim = 0
  31.           _SpWeiter = 1
  32.         end if
  33.       end if
  34.     end tell
  35.   end if
  36. end
  37.  
  38. on HdleIdleAnimation
  39.   global _AnimName, _AnimSim, _AnimZeit, _AnimListe, _SpWeiter
  40.   if (the ticks - _AnimZeit) > _AnimListe[2] then
  41.     tell the stage
  42.       sprite(_AnimListe[1]).member = _AnimName & _AnimSim
  43.       _AnimSim = _AnimSim + _AnimListe[3]
  44.       _AnimZeit = the ticks
  45.       if _AnimListe[3] > 0 then
  46.         if _AnimSim > _AnimListe[7] then
  47.           if _AnimListe[5] and not _AnimListe[4] then
  48.             _AnimSim = _AnimListe[6]
  49.             _AnimZeit = the ticks + _AnimListe[8]
  50.           else
  51.             if _AnimListe[4] then
  52.               _AnimSim = _AnimSim - 1
  53.               _AnimListe[6] = _AnimSim
  54.               _AnimListe[7] = 1
  55.               _AnimListe[3] = -1
  56.               _AnimZeit = the ticks + _AnimListe[8]
  57.             else
  58.               sprite(_AnimListe[1]).visible = _AnimListe[9]
  59.               if _AnimListe[10] then
  60.                 AnimZusatz(_AnimName)
  61.               end if
  62.               _AnimName = EMPTY
  63.               _AnimSim = 0
  64.               _SpWeiter = 1
  65.             end if
  66.           end if
  67.         end if
  68.       else
  69.         if _AnimSim < _AnimListe[7] then
  70.           if _AnimListe[5] then
  71.             if _AnimListe[4] then
  72.               _AnimListe[7] = _AnimListe[6]
  73.               _AnimListe[6] = 1
  74.               _AnimListe[3] = 1
  75.               _AnimSim = _AnimListe[6]
  76.               _AnimZeit = the ticks + _AnimListe[8]
  77.             else
  78.               _AnimSim = _AnimListe[6]
  79.               _AnimZeit = the ticks + _AnimListe[8]
  80.             end if
  81.           else
  82.             sprite(_AnimListe[1]).visible = _AnimListe[9]
  83.             if _AnimListe[10] then
  84.               AnimZusatz(_AnimName)
  85.             end if
  86.             _AnimName = EMPTY
  87.             _AnimSim = 0
  88.             _SpWeiter = 1
  89.           end if
  90.         end if
  91.       end if
  92.     end tell
  93.   end if
  94. end
  95.  
  96. on HdleIdleCursor
  97.   global _cursorname, _CursorKanal, _anhang
  98.   if not (_cursorname = EMPTY) then
  99.     tell the stage
  100.       mauspos = point(the mouseH, the mouseV)
  101.       sprite(_CursorKanal).loc = mauspos
  102.       if _anhang then
  103.         sprite(_anhang).loc = mauspos
  104.       end if
  105.     end tell
  106.   end if
  107. end
  108.  
  109. on HdleLeistenbewegung
  110.   global _LeistenPos
  111.   tell the stage
  112.     pos = sprite(4).locH
  113.   end tell
  114.   if pos < _LeistenPos then
  115.     dif = 13
  116.     if (pos + dif) >= _LeistenPos then
  117.       dif = pos - _LeistenPos
  118.       _LeistenPos = EMPTY
  119.     end if
  120.   else
  121.     dif = -13
  122.     if (pos + dif) <= _LeistenPos then
  123.       dif = _LeistenPos - pos
  124.       _LeistenPos = EMPTY
  125.     end if
  126.   end if
  127.   tell the stage
  128.     sprite(4).locH = pos + dif
  129.     repeat with i = 5 to 17
  130.       sprite(i).locH = sprite(i).locH + dif
  131.     end repeat
  132.   end tell
  133. end
  134.