home *** CD-ROM | disk | FTP | other *** search
-
- rem A Director script
- rem example of preloading and chaining 2 DPaint III anims together
- rem in a continuous loop.
-
- setblack 1 :rem under cover of darkness
-
- REM load first frames of the anims into fast ram
- loadfast 10,"anim1" :rem load anim 1 first frame
- loadfast 11,"anim2" :rem load anim 2 first frame
-
- REM load the anims
- loadanim 21,"anim1"
- loadanim 22,"anim2"
-
- REM now initialize variables
- animbuf = 1 :rem next frame buffer
- animdone=0
- anima=1 :rem buffers used for double buffering
- animb=2
- speed 1
- rem position -1,-1 :rem use if anims are overscan
- fade 1,-1,0
-
- REM ok, now loop
- 100
- animdat=21 :rem use first anim data
- new animbuf,10 :rem make the second buffer
- copy 10,animbuf :rem copy first frame pic into buffer 2
- gosub 9102 :rem display the buffer
- new animbuf,-1 :rem build 2nd buffer
- copy -1,animbuf
-
- gosub 9101 :rem skip pause, to help compensate for time lost
- for i=3 to 32 :rem for a 32 frame anim
- gosub 9100
- next
-
- gosub 9200 :rem reset anim for next time
-
- animdat=22 :rem first anim data
- new animbuf,11 :rem make the second buffer
- copy 11,animbuf :rem copy first frame pic into buffer 2
- gosub 9102 :rem display it
- new animbuf,-1 :rem rebuild 2nd buffer
- copy -1,animbuf
-
- gosub 9101 :rem skip the pause, to help compensate for time lost
- for i=3 to 25 :rem for a 25 frame anim
- gosub 9100
- next
-
- gosub 9200
- goto 100
-
-
- rem do next frame in the anim:
- 9100 pause 0 :rem frame pause (if any)
- 9101 if animdone :rem skip if looping and at first frame
- skipanim animdat,animbuf,animg,animd,animdone
- endif
- anim animdat,animbuf,animg,animd,animdone
-
- 9102 :rem do the buffer swap
- display animbuf
- display animbuf :rem elimiate flickering on faster (68020) machines
- animbuf=(anima+animb)-animbuf
- return
-
- rem reset an anim so that next time it's played it starts from the beginning
- 9200
- if animdone:animdone = 0:return:endif :rem if at end, return
- skipanim animdat,animbuf,animg,animd,animdone
- goto 9200 :rem skip until end
-
-