home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Format 67
/
af067a.adf
/
SYSTEM.DMS
/
SYSTEM.adf
/
Examples
/
SnakeWave.AMOS
/
SnakeWave.amosSourceCode
Wrap
AMOS Source Code
|
1994-09-08
|
1KB
|
58 lines
Rem *** Sine 'Snake Wave' Demonstration
Rem *** Written by Jason Holborn
Rem *** Taken from the book 'ULTIMATE AMOS'
Rem *** Available from Future Publishing on 0225 442244
SPRX=0 : SPRY=0 : FRAME=8 : FRAMEDELAY=0
Screen Open 0,320,256,16,Lowres
Flash Off : Curs Off : Cls 0
Load "AMOSBOOK:AbkFiles/SpaceShip.abk"
Get Sprite Palette
Bob Update Off
Double Buffer : Autoback 0
HEIGHT=60
WIDTH=1
POSITION=128
SPEED=2
Degree
Do
For SPRX=319 To -200 Step -SPEED
Bob Clear
Rem *** Calculate new 'Y' co-ordinate
Rem *** for all objects
OBJNUMBER=0
For C=0 To 200 Step 20
Y=Sin((SPRX+C)*WIDTH)*HEIGHT+POSITION
Bob OBJNUMBER,SPRX+C,Y,FRAME
OBJNUMBER=OBJNUMBER+1
Next C
Bob Draw
Screen Swap 0
Wait Vbl
Rem *** Update animation
If FRAMEDELAY=5
FRAME=FRAME-1
If FRAME=0
FRAME=8
End If
FRAMEDELAY=0
End If
FRAMEDELAY=FRAMEDELAY+1
Next SPRX
WIDTH=WIDTH+1
If WIDTH=5
WIDTH=1
End If
Loop