home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
334.lha
/
StripAnim_v1.1
/
brush.script
next >
Wrap
Text File
|
1990-01-10
|
2KB
|
56 lines
rem example of use of converted anim brush
load 1,"mach1" :rem load background pic
new 5,1 :rem create buffer for
copy 1,5 :rem second copy of it
load 10,"sb.anim" :rem load first frame of brush anim
loadanim 11,"sb.anim" :rem load anim data from brush anim
new 2,1 :rem second buffer to dbl buffer into
copy -1,2
buff=2 :rem next frame buffer
blitdest buff :rem blit output to next frame buffer
x=0 :rem starting x,y position
y=0
inc = 3
xinc=inc :rem starting x and y increments
yinc=inc
inc = inc+inc
resolution 10,width,height,depth
width=width+inc :rem fudge enough to cover 2 previous frames
height=height+inc
10
transparent 0
blit 5,x-inc,y-inc,x-inc,y-inc,width,height :rem erase old object
:rem could do this with a "copy 5,buff"
:rem except this is faster
transparent 1
blit 10,0,0,x,y,-1,-1 :rem blit new object into position
x=x+xinc :rem new x,y location
y=y+yinc
if x > 263 | x < -38 :rem check if we bounce off l/r walls
xinc = 0-xinc :rem yep, reverse direction
x=x+xinc+xinc
endif
if y > 158 | y < -26 :rem check top and bottom walls
yinc = 0-yinc :rem yep, reverse direction
y=y+yinc+yinc
endif
display buff :rem display new frame
buff=3-buff :rem update next frame buffer variable
blitdest buff :rem output to next frame buffer
anim 11,10,a,r,d :rem generate next frame of brush
:rem an anim brush is a single buffered
:rem anim, so only one buffer to anim into
:rem is required
goto 10 :rem loop forever (until left mouse abort)