home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 4: Demo 1
/
almathera_demo1.bin
/
amos
/
xevious2.amos
/
xevious2.amosSourceCode
Wrap
AMOS Source Code
|
1995-03-16
|
3KB
|
115 lines
Erase 1
Erase 2
Erase 15
Reserve As Data 15,2000
Screen Open 0,320,400,32,Lowres
Screen Display 0,140,40,320,200
Curs Off : Flash Off
Cls 0
Load "Df0:test.abk"
Get Icon Palette
Ink 0
For I=1 To Length(2)
Paste Icon 100,100,I
Get Icon I,100,100 To 116,120
Bar 100,100 To 116,120
Next I
Load "Df0:spaceship.abk"
STARDMAP=Start(15)
Get Sprite Palette %11111111111100000000000000000000
Hide On
Screen Open 1,320,40,32,Lowres
Screen Hide 1
Cls 0
Get Icon Palette
Screen Open 2,640,50,16,Hires
Screen Display 2,140,240,640,49
Get Icon Palette
Cls 5
For I=0 To 9
Paste Bob 30+I*20+200,20,I+10
Next I
Screen 0
Flash Off
Double Buffer
Screen Swap
Autoback 0
Bob Update Off
Rem **********************************************************************
Rem Hardware-scrolling
Channel 1 To Screen Offset 0
A$="Loop: Let Y=RS; Jump Loop"
Amal 1,A$
Rem **********************************************************************
XSHIP=X Hard(0,160) : YSHIP=Y Hard(0,150)
Rem **********************************************************************
Sprite 8,XSHIP,YSHIP,1
Channel 8 To Sprite 8
A$="AUtotest(Let RZ=0; Let R5=J1; If R5<>0 then Direct uPdate else Direct Ifire)"
A$=A$+"uPdate: If R5&1 Jump Up else If R5&2 Jump Down; Jump Jleftright;"
A$=A$+"Up: If Y<R2 Jump K; Let Y=Y-1; K: Jump Jleftright;"
A$=A$+"Down: If Y>R4 Jump O; Let Y=Y+1; O: Jump Jleftright;"
A$=A$+"Jleftright: If R5&4 Jump Left else If R5&8 Jump Right; Jump Ifire;"
A$=A$+"Left: If X<R1 Jump M; Let X=X-1; M: Jump Ifire;"
A$=A$+"Right:If X>R3 Jump N; Let X=X+1; N: Jump Ifire;"
A$=A$+"Ifire: Let RY=Y; Let RX=X; If R5&16 Jump Fire; Wait;"
A$=A$+"Fire: Let RZ=-1; Wait;"
Amal 8,A$
Amreg(8,1)=X Hard(0,20)
Amreg(8,2)=Y Hard(0,80)
Amreg(8,3)=X Hard(0,290)
Amreg(8,4)=Y Hard(0,150)
Rem **********************************************************************
Sprite 9,XSHIP,YSHIP+26,4
Channel 9 To Sprite 9
A$="AUtotest(Let X=RX; Let Y=RY+26; eXit)"
A$=A$+"A 0,(4,8)(5,8)(6,8); Wait;"
Amal 9,A$
Rem **********************************************************************
Sprite 10,XSHIP,YSHIP-76,3
Channel 10 To Sprite 10
A$="AUtotest(Let X=RX; Let Y=RY-76; eXit) Wait;"
Amal 10,A$
Rem **********************************************************************
Make Mask
Rem **********************************************************************
Screen 1
MAPPTR=0
For I=0 To 19
ICNR=Peek(STARDMAP+MAPPTR)
If ICNR<>0 Then Paste Icon I*16,0,ICNR
Inc MAPPTR
Next I
Screen 0
YPTR=1
Rem **********************************************************************
Amal On
S=Asc("S")-65
Do
Amreg(S)=200
For I=1 To 10
XPTR=0
If YPTR=1 Then YPTR=0 Else YPTR=1
For J=19 To 0 Step -1
YPOS=YPTR*20+J
Screen Copy 1,0,YPOS,320,YPOS+1 To Logic,0,Amreg(S)-1
Bob Clear
Amreg(S)=Amreg(S)-1
Bob Draw
Screen Swap : Wait Vbl
Screen Copy 1,0,YPOS,320,YPOS+1 To Logic,0,Amreg(S)
Screen Copy 1,0,YPOS,320,YPOS+1 To Logic,0,Amreg(S)+200
Screen Copy 1,0,YPOS,320,YPOS+1 To Physic,0,Amreg(S)+200
Bob Clear
Bob Draw
Screen Swap : Wait Vbl
Screen 1
ICNR=Peek(STARDMAP+MAPPTR)
If ICNR<>0 Then Paste Icon XPTR*16,20-(YPTR*20),ICNR
Inc MAPPTR
Screen 0
Inc XPTR
If Mouse Click=1 Then Exit 3
Next J
Next I
Loop