home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
authors
/
tony_vecqueray
/
amal_joy.amos
/
amal_joy.amosSourceCode
next >
Wrap
AMOS Source Code
|
1993-03-07
|
3KB
|
68 lines
' AMAL_Joy
' --------
' Amal Joystick routine.With fire button detection.
' -------------------------------------------------
' The program AnimatedBob by Neil Kennedy on TA 10 works well, but uses
' five channels.I wrote this routine which uses just one channel,thus
' freeing four channels for other applications.
' The only problem i had was with Images 10 & 12 which would not reverse,
' I think this was due to the fact i was jumping from a loop with
' reversed Images to another loop of reversed Images.
' I cured the problem by flipping Images 10 & 12 in the Object Editor,
' and saved then as Images 13 & 14. (Hot spot not altered).
' I hope this routine will be of use to Neil and others.
' NOTE:- To jump up in Amal while moving up use J1&16 & J1&17
' To jump down in Amal while moving down use J1&16 & J1&18
' Tony Vecqueray.
Screen Open 0,320,256,16,Lowres
Curs Off : Flash Off : Hide
'Load Sprites Here
Double Buffer
' Changed from Get Bob Palette for other AMOS versions.
Get Sprite Palette
' Slow down Updating process. i.e Number of Vbl's between each screen update.
Update Every 6
Gosub JST : Hot Spot 13,20,0 : Hot Spot 14,20,0
Do
Rem Main Program Loop
Exit If Mouse Key
'Read Joystick Values,with and without Fire button depressed.
'J=Joy(1)
'Print Bin$(J,5),J
Loop
Cls : Amal Off : Default : Edit
JST:
A$="Begin:"
A$=A$+"If J1&4 then Jump L;" : Rem Left
A$=A$+"If J1&8 then Jump R;" : Rem Right
A$=A$+"If J1&2 then Jump D;" : Rem Down
A$=A$+"If J1&1 then Jump U;" : Rem Up
A$=A$+"Jump Begin;"
A$=A$+"L:Anim 2,($8004,5)($8005,5)($8006,5)($8007,5)($8008,5)($8009,5);"
A$=A$+"If X<50 then Jump Begin;" : Rem X Left Limit
' J1&16 Fire button depressed. J1&20 Joystick Left.
A$=A$+"If J1&16 & J1&20 then Jump W;"
A$=A$+"Move -10,0,30;Jump Begin;"
A$=A$+"R:Anim 2,(4,5)(5,5)(6,5)(7,5)(8,5)(9,5);"
A$=A$+"If X>270 then Jump Begin;" : Rem X Right Limit
' J1&16 Fire button depressed. J1&24 Joystick Right.
A$=A$+"If J1&16 & J1&24 then Jump E;"
A$=A$+"Move 10,0,30;Jump Begin;"
A$=A$+"D:Anim 2,(1,10)(2,10)(3,10);"
A$=A$+"If Y>190 then Jump Begin;" : Rem Y Lower Limit
A$=A$+"Move 5,16,16;Jump Begin;"
A$=A$+"U:Anim 2,(1,10)(2,10)(3,10);"
A$=A$+"If Y<14 then Jump Begin;" : Rem Y Upper Limit
A$=A$+"Move -5,-16,16;Jump Begin;"
A$=A$+"W:Anim 2,(13,5)(14,5);" : Rem Jump routine Left
' X Left Limit,Y Upper Limit. | is equal to Or in Basic.
A$=A$+"If X<50 | Y<14 then Jump Begin;"
A$=A$+"Move -12,-30,8;Move -4,0,2;Move -12,30,8;Jump Begin;"
A$=A$+"E:Anim 2,(10,5)(12,5);" : Rem Jump routine Right
' X Right Limit,Y Upper Limit. | is equal to Or in Basic.
A$=A$+"If X>270 | Y<14 then Jump Begin;"
A$=A$+"Move 12,-30,8;Move 4,0,2;Move 12,30,8;Jump Begin;"
Bob 1,120,108,1
Channel 0 To Bob 1
Amal 0,A$ : Amal On 0
Return