-
Notifications
You must be signed in to change notification settings - Fork 0
/
FOOT.EL
1756 lines (1451 loc) · 40.5 KB
/
FOOT.EL
1
' ×AY OF THE ÉMPLODING ÆOOT' -------------------------' Á COLLABORATIVE TEAM-EFFORT GAME MADE BY THE ÍÅÇÁ65 COMMUNITY'' ÇURCE:' -----' - ÉNITIAL BACKGROUND ART' - ÅLEVEN CODE INFRASTRUCTURE' - ÉNITIAL ÇAME MECHANICS' ÄEFT:' ----' - ÁRTISTIC PLAYER HEAD PERMUTATIONS#OUTPUT "FOOT"' ÂÁÎË4 ÍEMORY USAGE' ------------------' 4.0000 ÄÍÁ-ÌÉÓÔ' 4.0100 ÓÕÎÓÅÔ ÐÁÌÅÔÔÅÓ (EACH PALETTE IS 16*3 IN SIZE, HAVE 12 PALETTES)' 4.0800 ÓÃÒÅÅÎ ÍÅÍÏÒÙ' 4.2000 ÐÅÔÓÃÉÉ ÇÒÁÐÈÉÃÓ' ÂÁÎË5 ÍEMORY USAGE' ------------------' 5.0000 SCREEN BUFFER' 5.1000 COLOR RAM BUFFER' 5.2000 DOUBLED-UP LAYER BUFFER' UNCOMMENT THIS LINE TO ADD DEBUG OUTPUT#DECLARE ÄÅÂÕÇ = 0.PETSCII VARS'------------#DEFINE ÆÏÒͯÌÁÙÅÒ = 0#DEFINE ÆÏÒͯÈÕÍÁÎ = 1#DEFINE ÆÏÒͯÄÕÃË = 2#DEFINE ÆÏÒͯÍÁØ = 3#DEFINE ÄÁÔ¯ÌÁÙÅÒ = 0#DEFINE ÄÁÔ¯ÐÌÁÙÅÒ1 = 1#DEFINE ÄÁÔ¯ÐÌÁÙÅÒ2 = 2#DEFINE ÄÁÔ¯ÐÌÁÙÅÒ3 = 3#DEFINE ÄÁÔ¯ÐÌÁÙÅÒ4 = 4#DEFINE ÄÁÔ¯ÄÕÃË = 5#DEFINE ÄÁÔ¯ÍÁØ = 6#DECLARE DATA¯ADDR = $42000#DECLARE MAX¯FRAMES(ÆÏÒͯÍÁØ)#DECLARE FRAME¯ADDR(ÄÁÔ¯ÍÁØ, 25)#DECLARE FRAME¯DBLUP¯ADDR(64)#DECLARE JDIR¯RAW, JFIRE, JDIR#DECLARE FRM¯IDX = 0#DECLARE FRMW, FRMH,FRMX,FRMY,FRMX1,FRMY1,FRAMEIDX,CDATA¯ADDR#DECLARE YY, SCRADDR,CLRADDR#DECLARE A$, LIDX, K, X, Y#DECLARE SRC¯ADDR, DEST¯ADDR, LENGTH, TRANSP#DECLARE DEST¯MB¯SEL, DEST¯BANK#DECLARE FORM, SZ#DEFINE ÐÌÁÙÅÒ = 0#DEFINE ÂÁÄÄÉÅ = 1#DECLARE CHARACTER#DECLARE OPPONENT¯DATA¯ADDR#DECLARE DBLUP¯ADDR = $52000#DECLARE KNEEL¯FLAG#DECLARE BADDIE¯KNEEL¯FLAG#DECLARE MIRROR, PLAYER¯MIRROR, BADDIE¯MIRROR, OPPONENT¯MIRROR, TMP¯MIRROR#DECLARE PX, PY ' PLAYER X,Y#DECLARE BX, BY ' BADDIE X,Y#DECLARE PLAYER¯ENERGY = 18#DECLARE LAG¯PENERGY = 0#DECLARE BADDIE¯ENERGY = 18#DECLARE LAG¯BENERGY = 0#DECLARE X1,Y1,X2,Y2, DRAW¯COLOR, IDX, TMPX1#DECLARE P¯X1, P¯Y1, P¯X2, P¯Y2#DECLARE O¯X1, O¯Y1, O¯X2, O¯Y2#DECLARE RET%#DECLARE DAT¯IDX, PLAYER¯DAT¯IDX, BADDIE¯DAT¯IDX#DECLARE PLAYER¯DAT¯FIXED, BADDIE¯DAT¯FIXED#DECLARE TMP#DEFINE ÃÈÁÒ¯ÂÏدÔÌ = 112#DEFINE ÃÈÁÒ¯ÂÏدÔÒ = 110#DEFINE ÃÈÁÒ¯ÂÏدÂÌ = 109#DEFINE ÃÈÁÒ¯ÂÏدÂÒ = 125#DEFINE ÃÈÁÒ¯ÈÏÒÚ = 64#DEFINE ÃÈÁÒ¯ÖÅÒÔ = 93#DEFINE ÃÈÁÒ¯ÓÐÁÃÅ = 32.JOYSTICK¯DEFS'-------------#DEFINE ʯÕÐ = 1#DEFINE ʯÕЯÒÉÇÈÔ = 2#DEFINE ʯÒÉÇÈÔ = 3#DEFINE ʯÄÏ×ίÒÉÇÈÔ = 4#DEFINE ʯÄÏ×Î = 5#DEFINE ʯÄÏ×ίÌÅÆÔ = 6#DEFINE ʯÌÅÆÔ = 7#DEFINE ʯÕЯÌÅÆÔ = 8#DEFINE ʯÆÉÒÅ = 128#DEFINE ÊįÕÐ = 1#DEFINE ÊįÕЯÆÏÒ×ÁÒÄ = 2#DEFINE ÊįÆÏÒ×ÁÒÄ = 3#DEFINE ÊįÄÏ×ίÆÏÒ×ÁÒÄ = 4#DEFINE ÊįÄÏ×Î = 5#DEFINE ÊįÄÏ×ίÂÁÃË×ÁÒÄ = 6#DEFINE ÊįÂÁÃË×ÁÒÄ = 7#DEFINE ÊįÕЯÂÁÃË×ÁÒÄ = 8#DECLARE JD(1,8) ' DIRECTIONAL JOYSTICK (PLAYER DIRECTION NEUTRAL)JD(0, ʯÕÐ) = ÊįÕÐJD(0, ʯÕЯÒÉÇÈÔ) = ÊįÕЯÆÏÒ×ÁÒÄJD(0, ʯÒÉÇÈÔ) = ÊįÆÏÒ×ÁÒÄJD(0, ʯÄÏ×ίÒÉÇÈÔ) = ÊįÄÏ×ίÆÏÒ×ÁÒÄJD(0, ʯÄÏ×Î) = ÊįÄÏ×ÎJD(0, ʯÄÏ×ίÌÅÆÔ) = ÊįÄÏ×ίÂÁÃË×ÁÒÄJD(0, ʯÌÅÆÔ) = ÊįÂÁÃË×ÁÒÄJD(0, ʯÕЯÌÅÆÔ) = ÊįÕЯÂÁÃË×ÁÒÄJD(1, ʯÕÐ) = ÊįÕÐJD(1, ʯÕЯÒÉÇÈÔ) = ÊįÕЯÂÁÃË×ÁÒÄJD(1, ʯÒÉÇÈÔ) = ÊįÆÏÒ×ÁÒÄJD(1, ʯÄÏ×ίÒÉÇÈÔ) = ÊįÄÏ×ίÂÁÃË×ÁÒÄJD(1, ʯÄÏ×Î) = ÊįÄÏ×ÎJD(1, ʯÄÏ×ίÌÅÆÔ) = ÊįÄÏ×ίÆÏÒ×ÁÒÄJD(1, ʯÌÅÆÔ) = ÊįÆÏÒ×ÁÒÄJD(1, ʯÕЯÌÅÆÔ) = ÊįÕЯÆÏÒ×ÁÒÄ.IMGS'----#DEFINE ÉÍǯÃÌÏÕÄÓ = 0#DEFINE ÉÍǯÓËÙ = 1#DEFINE ÉÍǯÌÔ¯ÍÏÕÎÔ = 2#DEFINE ÉÍǯÄ˯ÍÏÕÎÔ = 3#DEFINE ÉÍǯ×ÁÔÅÒ = 4#DEFINE ÉÍǯÈɯÇÒÏÕÎÄ = 5#DEFINE ÉÍǯÌϯÇÒÏÕÎÄ = 6#DEFINE ÉÍǯÓÕÎ = 7#DEFINE ÉÍǯÐ×ÁÌË1 = 0#DEFINE ÉÍǯÐ×ÁÌË2 = 1#DEFINE ÉÍǯÐ×ÁÌË3 = 2#DEFINE ÉÍǯÐÐÕÎÃÈ1 = 3#DEFINE ÉÍǯÐÐÕÎÃÈ2 = 4#DEFINE ÉÍǯÐÐÕÎÃÈ3 = 5#DEFINE ÉÍǯÐËÉÃË1 = 6#DEFINE ÉÍǯÐËÉÃË2 = 7#DEFINE ÉÍǯÐËÉÃË3 = 8#DEFINE ÉÍǯÐËÎÅÅÌ1 = 9#DEFINE ÉÍǯÐËÎÅÅÌ2 = 10#DEFINE ÉÍǯÐËÎÅÅÌ3 = 11#DEFINE ÉÍǯÐËÐÕÎÃÈ1 = 12#DEFINE ÉÍǯÐËÐÕÎÃÈ2 = 13#DEFINE ÉÍǯÐËÐÕÎÃÈ3 = 14#DEFINE ÉÍǯÐËËÉÃË1 = 15#DEFINE ÉÍǯÐËËÉÃË2 = 16#DEFINE ÉÍǯÐËËÉÃË3 = 17#DEFINE ÉÍǯÐÄÉÅ1 = 18#DEFINE ÉÍǯÐÄÉÅ2 = 19#DEFINE ÉÍǯÐÄÉÅ3 = 20#DEFINE ÉÍǯÐÄÉÅ4 = 21#DEFINE ÉÍǯÐÄÉÅ5 = 22#DEFINE ÉÍǯÄ×ÁÌË1 = 0#DEFINE ÉÍǯÄ×ÁÌË2 = 1#DEFINE ÉÍǯÄ×ÁÌË3 = 2#DEFINE ÉÍǯÄÑÕÁÃË1 = 3#DEFINE ÉÍǯÄÑÕÁÃË2 = 4#DEFINE ÉÍǯÄÑÕÁÃË3 = 5#DEFINE ÉÍǯÄÄÉÅ1 = 6#DEFINE ÉÍǯÄÄÉÅ2 = 7#DEFINE ÉÍǯÄÄÉÅ3 = 8#DEFINE ÉÍǯÄÄÉÅ4 = 9#DEFINE ÉÍǯÄÄÉÅ5 = 10#DEFINE ÈÉÇÈÅÓÔ¯ÌÁÙÅÒ = 7#DECLARE FX, FY#DECLARE XOFFS(ÈÉÇÈÅÓÔ¯ÌÁÙÅÒ) ' OFFSET INTO CYCLING OF GRAPHIC#DECLARE DRAW¯ORDER(ÈÉÇÈÅÓÔ¯ÌÁÙÅÒ)DRAW¯ORDER(0) = ÉÍǯÓËÙDRAW¯ORDER(1) = ÉÍǯÓÕÎDRAW¯ORDER(2) = ÉÍǯÃÌÏÕÄÓDRAW¯ORDER(3) = ÉÍǯÌÔ¯ÍÏÕÎÔDRAW¯ORDER(4) = ÉÍǯÄ˯ÍÏÕÎÔDRAW¯ORDER(5) = ÉÍǯ×ÁÔÅÒDRAW¯ORDER(6) = ÉÍǯÈɯÇÒÏÕÎÄDRAW¯ORDER(7) = ÉÍǯÌϯÇÒÏÕÎÄ#DECLARE OFFS¯AMOUNT(ÈÉÇÈÅÓÔ¯ÌÁÙÅÒ)OFFS¯AMOUNT(0) = .7OFFS¯AMOUNT(1) = 0OFFS¯AMOUNT(2) = .1OFFS¯AMOUNT(3) = .5OFFS¯AMOUNT(4) = 1OFFS¯AMOUNT(5) = 1.5OFFS¯AMOUNT(6) = 2#DECLARE PALIDX, PTR.ANIMS'-----#DEFINE ÁÎÉͯÐ×ÁÌË = 0#DEFINE ÁÎÉͯÐÐÕÎÃÈ = 1#DEFINE ÁÎÉͯÐËÉÃË = 2#DEFINE ÁÎÉͯÐËÎÅÅ̯ÄÎ = 3#DEFINE ÁÎÉͯÐËÎÅÅ̯ÕÐ = 4#DEFINE ÁÎÉͯÐËÐÕÎÃÈ = 5#DEFINE ÁÎÉͯÐËËÉÃË = 6#DEFINE ÁÎÉͯÐÄÉÅ = 7#DEFINE ÁÎÉͯÐÊÕÍÐ = 8#DEFINE ÁÎÉͯÄ×ÁÌË = 0#DEFINE ÁÎÉͯÄÑÕÁÃË = 1#DEFINE ÁÎÉͯÄÄÉÅ = 2#DEFINE ÁÎÉͯÍÁØ = 10#DECLARE ANIM¯ORDER(ÆÏÒͯÍÁØ, ÁÎÉͯÍÁØ, 10)ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐ×ÁÌË, 0) = ÉÍǯÐ×ÁÌË1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐ×ÁÌË, 1) = ÉÍǯÐ×ÁÌË2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐ×ÁÌË, 2) = ÉÍǯÐ×ÁÌË3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐ×ÁÌË, 3) = ÉÍǯÐ×ÁÌË2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÐÕÎÃÈ, 0) = ÉÍǯÐÐÕÎÃÈ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÐÕÎÃÈ, 1) = ÉÍǯÐÐÕÎÃÈ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÐÕÎÃÈ, 2) = ÉÍǯÐÐÕÎÃÈ3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÐÕÎÃÈ, 3) = ÉÍǯÐÐÕÎÃÈ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÐÕÎÃÈ, 4) = ÉÍǯÐÐÕÎÃÈ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÉÃË, 0) = ÉÍǯÐËÉÃË1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÉÃË, 1) = ÉÍǯÐËÉÃË2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÉÃË, 2) = ÉÍǯÐËÉÃË3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÉÃË, 3) = ÉÍǯÐËÉÃË2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÉÃË, 4) = ÉÍǯÐËÉÃË1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ, 0) = ÉÍǯÐËÎÅÅÌ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ, 1) = ÉÍǯÐËÎÅÅÌ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ, 2) = ÉÍǯÐËÎÅÅÌ3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÕÐ, 0) = ÉÍǯÐËÎÅÅÌ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÕÐ, 1) = ÉÍǯÐËÎÅÅÌ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÐÕÎÃÈ, 0) = ÉÍǯÐËÐÕÎÃÈ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÐÕÎÃÈ, 1) = ÉÍǯÐËÐÕÎÃÈ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÐÕÎÃÈ, 2) = ÉÍǯÐËÐÕÎÃÈ3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÐÕÎÃÈ, 3) = ÉÍǯÐËÐÕÎÃÈ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÐÕÎÃÈ, 4) = ÉÍǯÐËÐÕÎÃÈ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËËÉÃË, 0) = ÉÍǯÐËËÉÃË1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËËÉÃË, 1) = ÉÍǯÐËËÉÃË2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËËÉÃË, 2) = ÉÍǯÐËËÉÃË3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËËÉÃË, 3) = ÉÍǯÐËËÉÃË2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËËÉÃË, 4) = ÉÍǯÐËËÉÃË1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 0) = ÉÍǯÐÄÉÅ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 1) = ÉÍǯÐÄÉÅ2ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 2) = ÉÍǯÐÄÉÅ3ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 3) = ÉÍǯÐÄÉÅ4ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 4) = ÉÍǯÐÄÉÅ5ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 5) = ÉÍǯÐÄÉÅ5ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 6) = ÉÍǯÐÄÉÅ5ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 7) = ÉÍǯÐÄÉÅ5ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ, 8) = ÉÍǯÐÄÉÅ5ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÊÕÍÐ, 0) = ÉÍǯÐËÎÅÅÌ1ANIM¯ORDER(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÊÕÍÐ, 1) = ÉÍǯÐËÎÅÅÌ2ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄ×ÁÌË, 0) = ÉÍǯÄ×ÁÌË1ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄ×ÁÌË, 1) = ÉÍǯÄ×ÁÌË2ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄ×ÁÌË, 2) = ÉÍǯÄ×ÁÌË3ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄ×ÁÌË, 3) = ÉÍǯÄ×ÁÌË2ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÑÕÁÃË, 0) = ÉÍǯÄÑÕÁÃË1ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÑÕÁÃË, 1) = ÉÍǯÄÑÕÁÃË2ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÑÕÁÃË, 2) = ÉÍǯÄÑÕÁÃË3ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÑÕÁÃË, 3) = ÉÍǯÄÑÕÁÃË2ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÑÕÁÃË, 4) = ÉÍǯÄÑÕÁÃË1ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 0) = ÉÍǯÄÄÉÅ1ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 1) = ÉÍǯÄÄÉÅ2ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 2) = ÉÍǯÄÄÉÅ3ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 3) = ÉÍǯÄÄÉÅ4ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 4) = ÉÍǯÄÄÉÅ5ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 5) = ÉÍǯÄÄÉÅ5ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 6) = ÉÍǯÄÄÉÅ5ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 7) = ÉÍǯÄÄÉÅ5ANIM¯ORDER(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ, 8) = ÉÍǯÄÄÉÅ5#DECLARE MAX¯FRAME(ÆÏÒͯÍÁØ, ÁÎÉͯÍÁØ)MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐ×ÁÌË) = 4MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÐÕÎÃÈ) = 5MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÉÃË) = 5MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ) = 3MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÕÐ) = 2MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÐÕÎÃÈ) = 5MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËËÉÃË) = 5MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÄÉÅ) = 9MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐÊÕÍÐ) = 2MAX¯FRAME(ÆÏÒͯÄÕÃË, ÁÎÉͯÄ×ÁÌË) = 4MAX¯FRAME(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÑÕÁÃË) = 5MAX¯FRAME(ÆÏÒͯÄÕÃË, ÁÎÉͯÄÄÉÅ) = 9.FANIM#DECLARE PLAYER¯FORM = 1 ' ÈÕÍÁÎ#DECLARE BADDIE¯FORM = 1#DEFINE ÆÁÎÉͯ×ÁÌË = 0#DEFINE ÆÁÎÉͯÐÕÎÃÈ = 1#DEFINE ÆÁÎÉͯËÉÃË = 2#DEFINE ÆÁÎÉͯËÎÅÅ̯ÄÎ = 3#DEFINE ÆÁÎÉͯËÎÅÅ̯ÕÐ = 4#DEFINE ÆÁÎÉͯËÐÕÎÃÈ = 5#DEFINE ÆÁÎÉͯËËÉÃË = 6#DEFINE ÆÁÎÉͯÄÉÅ = 7#DEFINE ÆÁÎÉͯÊÕÍÐ = 8#DEFINE ÆÁÎÉͯÍÁØ = 9#DECLARE FORM¯ANIM(ÆÏÒͯÍÁØ, ÆÁÎÉͯÍÁØ)FORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯ×ÁÌË) = ÁÎÉͯÐ×ÁÌËFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯÐÕÎÃÈ) = ÁÎÉͯÐÐÕÎÃÈFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËÉÃË) = ÁÎÉͯÐËÉÃËFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËÎÅÅ̯ÄÎ) = ÁÎÉͯÐËÎÅÅ̯ÄÎFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËÎÅÅ̯ÕÐ) = ÁÎÉͯÐËÎÅÅ̯ÕÐFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËÐÕÎÃÈ) = ÁÎÉͯÐËÐÕÎÃÈFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËËÉÃË) = ÁÎÉͯÐËËÉÃËFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯÄÉÅ) = ÁÎÉͯÐÄÉÅFORM¯ANIM(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯÊÕÍÐ) = ÁÎÉͯÐÊÕÍÐFORM¯ANIM(ÆÏÒͯÄÕÃË, ÆÁÎÉͯ×ÁÌË) = ÁÎÉͯÄ×ÁÌËFORM¯ANIM(ÆÏÒͯÄÕÃË, ÆÁÎÉͯÐÕÎÃÈ) = ÁÎÉͯÄÑÕÁÃËFORM¯ANIM(ÆÏÒͯÄÕÃË, ÆÁÎÉͯËÉÃË) = ÁÎÉͯÄÑÕÁÃËFORM¯ANIM(ÆÏÒͯÄÕÃË, ÆÁÎÉͯÄÉÅ) = ÁÎÉͯÄÄÉÅ#DECLARE PLAYER¯FRAME = 0#DECLARE PLAYER¯ANIM = 0 ' ÁÎÉͯÐ×ÁÌË#DECLARE BADDIE¯FRAME = 0#DECLARE BADDIE¯ANIM = 0 ' ÁÎÉͯÐ×ÁÌË.OFFSETS#DEFINE ÏÆÆÓÅÔ¯ÄÁÔÁ¯ÓÉÚÅ = 0#DEFINE ÏÆÆÓÅÔ¯ÎÕͯÆÒÁÍÅÓ = 2#DEFINE ÏÆÆÓÅÔ¯ÆÒÁÍÅ0 = 3#DEFINE ÆÒͯÏÆÆÓÅÔ¯Ø = 0#DEFINE ÆÒͯÏÆÆÓÅÔ¯Ù = 1#DEFINE ÆÒͯÏÆÆÓÅÔ¯× = 2#DEFINE ÆÒͯÏÆÆÓÅÔ¯È = 3#DEFINE ÆÒͯÏÆÆÓÅÔ¯ÈÉÔÂÏØÅÓ = 4#DEFINE ÆÒͯÏÆÆÓÅԯȯÈÅÁÄ = 4#DEFINE ÆÒͯÏÆÆÓÅԯȯÔÏÒÓÏ = 8#DEFINE ÆÒͯÏÆÆÓÅԯȯÆÅÅÔ = 12#DEFINE ÆÒͯÏÆÆÓÅԯȯÁÔÔÁÃË = 16#DEFINE ÆÒͯÏÆÆÓÅÔ¯ÄÁÔÁ = 20#DECLARE BX¯OFFS(3)BX¯OFFS(0) = ÆÒͯÏÆÆÓÅԯȯÈÅÁÄBX¯OFFS(1) = ÆÒͯÏÆÆÓÅԯȯÔÏÒÓÏBX¯OFFS(2) = ÆÒͯÏÆÆÓÅԯȯÆÅÅÔBX¯OFFS(3) = ÆÒͯÏÆÆÓÅԯȯÁÔÔÁÃË.MUSIC¯VARS'----------#DEFINE CHUNK¯MAX = 50#DECLARE CHUNK¯CNT, CHUNK¯IDX, VIDX, TMPO%, ROW#DECLARE ECHO¯M, ECHO¯B, ECHO¯SZ = .05, CHUNK¯RPT, ECHO¯DELAY#DECLARE V$(5,CHUNK¯MAX), V#DECLARE SONG$#DECLARE V1$, V2$, V3$, V4$, V5$, V6$#DECLARE CURR¯FREQ, CURR¯DIR#STRUCT ÅÎÖÔÙÐÅ NAME$, ATTACK, DECAY, SUSTAIN, RELEASE, WAVEFORM, PWÅÎÖÔÙÐÅ ENVS(9) = [ _ [ "ÐIANO", 0, 9, 0, 0, 2, 1536 ], _ [ "ÁCCORDION", 12, 0, 12, 0, 1, 0 ], _ [ "ÃALLIOPE", 0, 0, 15, 0, 0, 0 ], _ [ "ÄRUM", 0, 5, 5, 0, 3, 0 ], _ [ "ÆLUTE", 9, 4, 4, 0, 0, 0 ], _ [ "ÇUITAR", 0, 9, 2, 1, 1, 0 ], _ [ "ÈARPSICRD", 0, 9, 0, 0, 2, 512 ], _ [ "ÏRGAN", 0, 9, 9, 0, 2, 2048 ], _ [ "ÔRUMPET", 8, 9, 4, 1, 2, 512 ], _ [ "ØYLOPHONE", 0, 9, 0, 0, 0, 0 ] _]#DEFINE ÄÉÒ¯ÎÏÎÅ = 0#DEFINE ÄÉÒ¯ÕÐ = 1#DEFINE ÄÉÒ¯ÄÏ×Î = 2#DEFINE ÄÉÒ¯ÏÓà = 3#DEFINE ƯÏÆÆ = 0#DEFINE ƯÏÎ = 1#DECLARE FSROW = 0, FSEL = -1#STRUCT ÆÉÌÔÔÙÐÅ NAME$, FREQ, LP, BP, HP, RES, DIR, MIN, SWEEPÆÉÌÔÔÙÐÅ FILT(10) = [ _ [ "LOWP¯UP", 1000, ƯÏÎ, ƯÏÆÆ, ƯÏÆÆ, 15, ÄÉÒ¯ÕÐ, 100, 10 ], _ [ "LOWP¯DOWN", 1000, ƯÏÎ, ƯÏÆÆ, ƯÏÆÆ, 15, ÄÉÒ¯ÄÏ×Î, 100, 10 ], _ [ "LOWP¯OSC", 1000, ƯÏÎ, ƯÏÆÆ, ƯÏÆÆ, 15, ÄÉÒ¯ÏÓÃ, 100, 10 ], __ [ "BANDP¯UP", 1000, ƯÏÆÆ, ƯÏÎ, ƯÏÆÆ, 15, ÄÉÒ¯ÕÐ, 100, 10 ], _ [ "BANDP¯DOWN", 1000, ƯÏÆÆ, ƯÏÎ, ƯÏÆÆ, 15, ÄÉÒ¯ÄÏ×Î, 100, 10 ], _ [ "BANDP¯OSC", 1000, ƯÏÆÆ, ƯÏÎ, ƯÏÆÆ, 15, ÄÉÒ¯ÏÓÃ, 100, 10 ], __ [ "HIGHP¯UP", 1000, ƯÏÆÆ, ƯÏÆÆ, ƯÏÎ, 15, ÄÉÒ¯ÕÐ, 100, 10 ], _ [ "HIGHP¯DOWN", 1000, ƯÏÆÆ, ƯÏÆÆ, ƯÏÎ, 15, ÄÉÒ¯ÄÏ×Î, 100, 10 ], _ [ "HIGHP¯OSC", 1000, ƯÏÆÆ, ƯÏÆÆ, ƯÏÎ, 15, ÄÉÒ¯ÏÓÃ, 100, 10 ], __ [ "SPARE¯1", 0, ƯÏÆÆ, ƯÏÆÆ, ƯÏÆÆ, 0, ÄÉÒ¯ÎÏÎÅ, 0, 0 ], _ [ "SPARE¯2", 0, ƯÏÆÆ, ƯÏÆÆ, ƯÏÆÆ, 0, ÄÉÒ¯ÎÏÎÅ, 0, 0 ], __]#DECLARE SEQCNT#DECLARE SEQ¯CHUNK(200), SEQ¯EXTRA(200)#DECLARE PLYPTR, PLYFLAG#DEFINE ÃÍįÔÅÍÐÏ = -1#DEFINE ÃÍįÆÉÌÔÅÒ = -2#DEFINE ÃÍįÌÏÏÐ = -3#DEFINE ÃÍįÅÃÈϯÍ1 = -4 ' ECHO MELODY: VOICE 1 ON VOICE 4#DEFINE ÃÍįÅÃÈϯÍ2 = -5 ' ECHO MELODY: VOICE 1 ON VOICE 2 + 4 + 5#DEFINE ÃÍįÅÃÈϯ = -6 ' ECHO BASS: VOICE 3 ON VOICE 6#DEFINE ÃÍįÅÃÈϯÏÆÆ = -7#DEFINE ÃÍįÅÃÈϯÓÚ = -8#DEFINE ÃÍįÖÏÌ = -9#DEFINE ÃÍįÄÅÌÁÙ = -10#DEFINE ÃÍįÍÁØ = 11#DECLARE PJUMP, PJDIR, BJUMP, BJDIR#DEFINE ÂÓ¯ÏÆÆ = 0#DEFINE ÂÓ¯ÓÐÁ×Î = 1#DEFINE ÂÓ¯ÁÌÉÖÅ = 2#DEFINE ÂÓ¯ÄÅÁÄ = 3#DECLARE NEXT¯BADDIE¯TIME = 50, BADDIE¯DEAD¯TIME = 50, BADDIE¯STATE#DECLARE BADDIE¯VISIBLE'----.MAIN'----PRINT CHR$(27)+"5"PRINT CHR$(147);BORDER 0BACKGROUND 0GOSUB LOAD¯DATAPALIDX = 0GOSUB SET¯PALETTESONG$ = "CHABI.P"GOSUB LOAD¯SONG.LOOP0 GOSUB INIT¯VARS GOSUB SHOW¯TITLE GOSUB GAMEPLAY ' GOSUB GAMEOVER GOTO LOOP0'---------------.TRANSPARENT¯DMA'--------------- WPOKE $40009, SRC¯ADDR WPOKE $4000C, DEST¯ADDR WPOKE $40007, LENGTH POKE $40004, TRANSP POKE $D702, 4 ' DMA LIST IN BANK 4 POKE $D701, $00 ' DMA LIST MSB POKE $D705, $00 ' DMA LIST LSB RETURN'----------.SHOW¯TITLE'---------- PRINT CHR$(147); PRINT CHR$(14); ' LOWER-CASE PRINT "×AY OF THE ÉMPLODING ÆOOT" PRINT "=========================" PRINT "Á GAME MADE BY THE ÍÅÇÁ65 COMMUNITY!" GET KEY A$ A$="" ' ALL REVERSE-CHAR SPACES FOR MOST OF SCREEN EDMA 3, $F00, 160, $40800 PRINT CHR$(142); ' UPPERCASE RETURN'---------.LOAD¯DATA'--------- PTR = $42000 FORM = ÆÏÒͯÌÁÙÅÒ DAT¯IDX = ÄÁÔ¯ÌÁÙÅÒ BLOAD "LEVEL1-BG.DAT",P(PTR) GOSUB INIT¯PETSCII¯FRAMES GOSUB PREPARE¯DOUBLE¯COPY¯LAYER GOSUB ¯INCREMENT¯PTR¯TO¯NEXT¯FREE FORM = ÆÏÒͯÈÕÍÁÎ DAT¯IDX = ÄÁÔ¯ÐÌÁÙÅÒ1 BLOAD "PLAYER.DAT",P(PTR) GOSUB INIT¯PETSCII¯FRAMES GOSUB ¯INCREMENT¯PTR¯TO¯NEXT¯FREE FORM = ÆÏÒͯÈÕÍÁÎ DAT¯IDX = ÄÁÔ¯ÐÌÁÙÅÒ2 BLOAD "PLAYER2.DAT",P(PTR) GOSUB INIT¯PETSCII¯FRAMES GOSUB ¯INCREMENT¯PTR¯TO¯NEXT¯FREE FORM = ÆÏÒͯÈÕÍÁÎ DAT¯IDX = ÄÁÔ¯ÐÌÁÙÅÒ3 BLOAD "PLAYER3.DAT",P(PTR) GOSUB INIT¯PETSCII¯FRAMES GOSUB ¯INCREMENT¯PTR¯TO¯NEXT¯FREE FORM = ÆÏÒͯÈÕÍÁÎ DAT¯IDX = ÄÁÔ¯ÐÌÁÙÅÒ4 BLOAD "PLAYER4.DAT",P(PTR) GOSUB INIT¯PETSCII¯FRAMES GOSUB ¯INCREMENT¯PTR¯TO¯NEXT¯FREE FORM = ÆÏÒͯÄÕÃË DAT¯IDX = ÄÁÔ¯ÄÕÃË BLOAD "DUCK.DAT",P(PTR) GOSUB INIT¯PETSCII¯FRAMES GOSUB ¯INCREMENT¯PTR¯TO¯NEXT¯FREE BLOAD "PAL.BIN",P($40100),R RETURN'---------------------------.¯INCREMENT¯PTR¯TO¯NEXT¯FREE'--------------------------- PTR = TMP SZ = WPEEK(PTR + ÏÆÆÓÅÔ¯ÄÁÔÁ¯ÓÉÚÅ) 'PRINT 'PRINT "INC SZ = ";SZ 'PRINT "PTR = ";HEX$(PTR + ÏÆÆÓÅÔ¯ÄÁÔÁ¯ÓÉÚÅ) PTR = PTR + SZ 'GET KEY A$ RETURN'-----------.SET¯PALETTE'----------- (PALIDX) PTR = $40100 + PALIDX * 16 * 3 FOR K = 0 TO 15 ' RED POKE $D100 + K + 16, PEEK(PTR) PTR = PTR + 1 ' GREEN POKE $D200 + K + 16, PEEK(PTR) PTR = PTR + 1 ' BLUE POKE $D300 + K + 16, PEEK(PTR) PTR = PTR + 1 NEXT K RETURN'---------.INIT¯VARS'--------- ' CLEAR DMA LIST AREA FOR K = 0 TO 20 POKE $40000+K, 0 NEXT K POKE $40000, $81 ' OPT = DEST ADDR Í SELECTOR POKE $40001, $00 ' DEFAULT TO 1ST MEGABYTE POKE $40002, $07 ' OPT = ENABLE TRANSPARENCY POKE $40003, $86 ' OPT = SET TRANSPARENCY POKE $40004, $20 ' TRANSPARENCY VALUE POKE $40005, $00 ' END OF OPTIONS POKE $40006, $00 ' ÃÍÄ LSB = ÃÏÐÙ WPOKE $40007, $0000 ' LENGTH WPOKE $40009, $1000 ' SOURCE ADDR POKE $4000B, $05 ' SOURCE BANK WPOKE $4000C, $1000 ' DEST ADDR POKE $4000E, $05 ' DEST BANK POKE $4000F, $00 ' ÃÍÄ MSB (IGNORE) WPOKE $40010, $0000 ' MODULO (IGNORE) ' CLEAR THE OFFSCREEN BUFFER EDMA 3, $F00, 160, $50000 EDMA 3, $A0, $20, $50F00 EDMA 3, $FA0, $4F, $51000 KNEEL¯FLAG = 0 PLAYER¯FORM = ÆÏÒͯÈÕÍÁÎ PLAYER¯DAT¯FIXED = ÄÁÔ¯ÐÌÁÙÅÒ4 PLAYER¯DAT¯IDX = PLAYER¯DAT¯FIXED BADDIE¯KNEEL¯FLAG = 0 BADDIE¯FORM = ÆÏÒͯÈÕÍÁÎ BADDIE¯DAT¯FIXED = ÄÁÔ¯ÐÌÁÙÅÒ2 BADDIE¯DAT¯IDX = BADDIE¯DAT¯FIXED PLAYER¯FRAME = 0 PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) PX = 0 : PY = 23 BX = 60 : BY = 23 PLAYER¯ENERGY = 18 LAG¯PENERGY = 0 BADDIE¯ENERGY = 0 LAG¯BENERGY = 0 PJUMP = 0 PJDIR = 0 BJDIR = 0 PLAYER¯MIRROR = 0 BADDIE¯MIRROR = 1 BJUMP = 0 NEXT¯BADDIE¯TIME = 50 BADDIE¯DEAD¯TIME = 50 BADDIE¯STATE = ÂÓ¯ÏÆÆ RETURN'-------------------.INIT¯PETSCII¯FRAMES'------------------- TMP = PTR MAX¯FRAMES(FORM) = PEEK(PTR + ÏÆÆÓÅÔ¯ÎÕͯÆÒÁÍÅÓ) 'PRINT 'PRINT "PTR=";HEX$(PTR + ÏÆÆÓÅÔ¯ÎÕͯÆÒÁÍÅÓ) PTR = PTR + ÏÆÆÓÅÔ¯ÆÒÁÍÅ0 'PRINT 'PRINT "FORM=";FORM;" - MX¯FRM=";MAX¯FRAMES(FORM);": "; FRM¯IDX = 0 DO WHILE FRM¯IDX < MAX¯FRAMES(FORM) 'PRINT FRM¯IDX; FRAME¯ADDR(DAT¯IDX, FRM¯IDX) = PTR FRMW = PEEK(PTR + ÆÒͯÏÆÆÓÅÔ¯×) FRMH = PEEK(PTR + ÆÒͯÏÆÆÓÅÔ¯È) 'PRINT "PTR=";HEX$(PTR);", IDX=";FRM¯IDX;", W=";FRMW;", H=";FRMH PTR = PTR + ÆÒͯÏÆÆÓÅÔ¯ÄÁÔÁ + FRMW * FRMH ':PRINT CHR$(147);"FRM¯IDX=";FRM¯IDX FRM¯IDX = FRM¯IDX + 1 LOOP PTR = TMP RETURN'-------------------------.PREPARE¯DOUBLE¯COPY¯LAYER'------------------------- DBLUP¯ADDR = $52000 FOR FRAMEIDX = 0 TO MAX¯FRAMES(ÆÏÒͯÌÁÙÅÒ)-1 PTR = FRAME¯ADDR(ÄÁÔ¯ÌÁÙÅÒ, FRAMEIDX) FRMX = PEEK(PTR + ÆÒͯÏÆÆÓÅÔ¯Ø) FRMY = PEEK(PTR + ÆÒͯÏÆÆÓÅÔ¯Ù) FRMW = PEEK(PTR + ÆÒͯÏÆÆÓÅÔ¯×) FRMH = PEEK(PTR + ÆÒͯÏÆÆÓÅÔ¯È) FRMX1=FRMX+FRMW-1 FRMY1=FRMY+FRMH-1 FRAME¯DBLUP¯ADDR(FRAMEIDX) = DBLUP¯ADDR ' ÃÏÐÙ ÃÏÌÏÒ FOR EACH ROW TWICE INTO SOME LOCATION IN DBLUP¯ADDR FOR Y = FRMY TO FRMY1 FOR K = 0 TO 1 ' COPY IT TO SOME PLACE IN $5.2000 EDMA 0, FRMW, (PTR + ÆÒͯÏÆÆÓÅÔ¯ÄÁÔÁ), DBLUP¯ADDR DBLUP¯ADDR = DBLUP¯ADDR + FRMW NEXT K PTR = PTR + FRMW NEXT Y NEXT FRAMEIDX RETURN'---------------.DRAW¯BACKGROUND'--------------- ' FRAMEIDX = ÉÍǯÓÕÎ ' GOSUB DRAW¯PETSCII¯LAYER ' RETURN POKE $4000B, $05 ' ASSURE SOURCE BANK 5 (FOR DOUBLED-UP LAYERS) FOR LIDX = 0 TO MAX¯FRAMES(ÆÏÒͯÌÁÙÅÒ)-1 ' IF LAYER¯VISIBLE[LIDX] = 1 THEN BEGIN FRAMEIDX = DRAW¯ORDER(LIDX) GOSUB DRAW¯PETSCII¯LAYER 'BEND NEXT LIDX RETURN'----------.MOVE¯RIGHT'---------- BADDIE¯VISIBLE = BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ OR BADDIE¯STATE = ÂÓ¯ÄÅÁÄ IF PX < 25 OR (BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ AND PX < 59) THEN BEGIN PX = PX + 1 BEND:ELSE BEGIN IF BX > 0 AND BADDIE¯VISIBLE THEN BEGIN GOSUB INCR¯OFFS BX = BX - 1 BEND IF BADDIE¯STATE = ÂÓ¯ÏÆÆ THEN BEGIN GOSUB INCR¯OFFS BEND BEND IF BADDIE¯STATE <> ÂÓ¯ÁÌÉÖÅ AND PX > 26 THEN BEGIN IF MOD(PLAYER¯FRAME,2) = 0 THEN PX = PX - 1 BEND KNEEL¯FLAG = 0 RETURN'---------.MOVE¯LEFT'--------- IF PX > 0 THEN BEGIN PX = PX - 1 BEND:ELSE BEGIN IF BX < 60 THEN BEGIN GOSUB DECR¯OFFS BX = BX + 1 BEND BEND KNEEL¯FLAG = 0 RETURN'--------------.GET¯USER¯INPUT'-------------- GOSUB KEYBOARD¯INPUT GOSUB JOYSTICK¯INPUT IF A$="X" THEN BEGIN KNEEL¯FLAG = 0 PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯÄÉÅ) PLAYER¯FRAME = 0 BEND RETURN'--------------.KEYBOARD¯INPUT'-------------- GET A$ IF A$="," AND PALIDX>0 THEN PALIDX=PALIDX-1:GOSUB SET¯PALETTE IF A$="." AND PALIDX<11 THEN PALIDX=PALIDX+1:GOSUB SET¯PALETTE IF A$="1" THEN BEGIN ÄÅÂÕÇ=MOD(ÄÅÂÕÇ+1,2) EDMA 3, $F00, 160, $50000 EDMA 3, $F00, 160, $40800 BEND ' D = TOGGLE BETWEEN HUMAN AND DUCK IF A$="D" THEN BEGIN IF PLAYER¯FORM = ÆÏÒͯÈÕÍÁÎ THEN BEGIN PLAYER¯FORM = ÆÏÒͯÄÕÃË PLAYER¯DAT¯IDX = ÄÁÔ¯ÄÕÃË BEND:ELSE BEGIN PLAYER¯FORM = ÆÏÒͯÈÕÍÁÎ PLAYER¯DAT¯IDX = PLAYER¯DAT¯FIXED BEND PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) PLAYER¯FRAME = 0 KNEEL¯FLAG = 0 BEND IF A$="<" AND PLAYER¯DAT¯FIXED > ÄÁÔ¯ÐÌÁÙÅÒ1 THEN BEGIN PLAYER¯DAT¯FIXED = PLAYER¯DAT¯FIXED - 1 PLAYER¯DAT¯IDX = PLAYER¯DAT¯FIXED BEND IF A$=">" AND PLAYER¯DAT¯FIXED < ÄÁÔ¯ÐÌÁÙÅÒ4 THEN BEGIN PLAYER¯DAT¯FIXED = PLAYER¯DAT¯FIXED + 1 PLAYER¯DAT¯IDX = PLAYER¯DAT¯FIXED BEND RETURN'--------------.JOYSTICK¯INPUT'-------------- JDIR¯RAW = JOY(2) JFIRE = JDIR¯RAW AND 128 JDIR = JDIR¯RAW AND $7F IF JDIR > 8 THEN JDIR = 0 ' HIDE ANY NONSENSICALS ' HANDLE NO JOYSTICK INPUT CASES ' ------------------------------ IF JDIR¯RAW=0 AND PLAYER¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÄÎ THEN BEGIN IF PLAYER¯FRAME >= MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ)-1 THEN BEGIN KNEEL¯FLAG = 0 PLAYER¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÕÐ PLAYER¯FRAME = 0 BEND BEND IF JDIR¯RAW = 0 THEN RETURN ' HANDLE CASES WITH SOME JOYSTICK INPUT ' ------------------------------------- ' NO FIRE BUTTON MOVES ' -------------------- IF JFIRE=0 THEN BEGIN IF JDIR=ʯÒÉÇÈÔ AND PJUMP=0 THEN GOSUB MOVE¯RIGHT IF JDIR=ʯÌÅÆÔ AND PJUMP=0 THEN GOSUB MOVE¯LEFT IF JDIR=ʯÄÏ×Î AND PLAYER¯ANIM = ÁÎÉͯÐ×ÁÌË THEN BEGIN PLAYER¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÄÎ PLAYER¯FRAME = 0 BEND IF (JDIR=ʯÕÐ OR JDIR=ʯÕЯÌÅÆÔ OR JDIR=ʯÕЯÒÉÇÈÔ) AND PJUMP=0 THEN BEGIN PLAYER¯ANIM = ÁÎÉͯÐÊÕÍÐ PJUMP = 1 IF JDIR=ʯÕÐ THEN PJDIR = 0 IF JDIR=ʯÕЯÌÅÆÔ THEN PJDIR = -1 IF JDIR=ʯÕЯÒÉÇÈÔ THEN PJDIR = 1 PLAYER¯FRAME = 0 BEND BEND ' FIRE BUTTON MOVES ' ----------------- IF JFIRE = 128 AND PJUMP=0 THEN BEGIN IF JD(PLAYER¯MIRROR, JDIR)=ÊįÕЯÆÏÒ×ÁÒÄ AND PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) THEN BEGIN PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯÐÕÎÃÈ) SOUND 1 + PLAYER¯MIRROR * 3, 4000, 5, 1, 100, 1000, 3 IF KNEEL¯FLAG = 1 THEN PLAYER¯ANIM = ÁÎÉͯÐËÐÕÎÃÈ PLAYER¯FRAME = 0 BEND IF JD(PLAYER¯MIRROR, JDIR)=ÊįÄÏ×ίÆÏÒ×ÁÒÄ AND PLAYER¯ANIM = ÁÎÉͯÐ×ÁÌË THEN BEGIN PLAYER¯ANIM = ÁÎÉͯÐËÉÃË SOUND 1 + PLAYER¯MIRROR * 3, 2000, 5, 1, 100, 1000, 3 IF KNEEL¯FLAG = 1 THEN PLAYER¯ANIM = ÁÎÉͯÐËËÉÃË PLAYER¯FRAME = 0 BEND BEND RETURN'-----------.DRAW¯PLAYER'----------- CHARACTER = ÐÌÁÙÅÒ FRAMEIDX = ANIM¯ORDER(PLAYER¯FORM, PLAYER¯ANIM, PLAYER¯FRAME) FX=PX : FY=PY MIRROR = PLAYER¯MIRROR FORM = PLAYER¯FORM DAT¯IDX = PLAYER¯DAT¯IDX GOSUB DRAW¯PETSCII¯FRAME RETURN'-----------.DRAW¯BADDIE'----------- CHARACTER = ÂÁÄÄÉÅ FRAMEIDX = ANIM¯ORDER(BADDIE¯FORM, BADDIE¯ANIM, BADDIE¯FRAME) FX=BX : FY=BY MIRROR = BADDIE¯MIRROR FORM = BADDIE¯FORM DAT¯IDX = BADDIE¯DAT¯IDX GOSUB DRAW¯PETSCII¯FRAME RETURN'--------------------------.CONSIDER¯NEXT¯PLAYER¯FRAME'-------------------------- IF PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) AND (JDIR=ʯÌÅÆÔ OR JDIR=ʯÒÉÇÈÔ) THEN BEGIN PLAYER¯FRAME = PLAYER¯FRAME + 1 BEND IF PLAYER¯ANIM <> FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) THEN BEGIN PLAYER¯FRAME = PLAYER¯FRAME + 1 BEND IF PLAYER¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÄÎ AND JDIR=ʯÄÏ×Î THEN BEGIN IF PLAYER¯FRAME >= MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËÎÅÅ̯ÄÎ) THEN BEGIN PLAYER¯FRAME = MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯËÎÅÅ̯ÄÎ) - 1 KNEEL¯FLAG = 1 BEND RETURN BEND IF PLAYER¯ANIM = ÁÎÉͯÐÊÕÍÐ THEN BEGIN IF PLAYER¯FRAME >= MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯÊÕÍÐ) THEN BEGIN PLAYER¯FRAME = MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÆÁÎÉͯÊÕÍÐ) - 1 BEND BEND IF PJUMP > 0 THEN BEGIN IF PJDIR>0 THEN GOSUB MOVE¯RIGHT:GOSUB MOVE¯RIGHT IF PJDIR<0 THEN GOSUB MOVE¯LEFT:GOSUB MOVE¯LEFT IF PJUMP = 1 THEN BEGIN PY = PY - 2 IF PY <= 0 THEN PJUMP = 2 BEND IF PJUMP = 2 THEN BEGIN PY = PY + 2 IF PY >= 23 THEN BEGIN PY = 23 PJUMP = 0 PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) PLAYER¯FRAME = 0 BEND BEND BEND IF PLAYER¯FRAME >= MAX¯FRAME(PLAYER¯FORM, PLAYER¯ANIM) THEN BEGIN IF PLAYER¯ANIM = ÁÎÉͯÐÄÉÅ THEN BEGIN IF PLAYER¯ENERGY > 0 THEN BEGIN PLAYER¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÕÐ PLAYER¯FRAME = 0 BEND:ELSE BEGIN PLAYER¯FRAME = MAX¯FRAME(PLAYER¯FORM, PLAYER¯ANIM) - 1 BEND RETURN BEND IF KNEEL¯FLAG = 1 AND PLAYER¯ANIM <> ÁÎÉͯÐËÎÅÅ̯ÄÎ THEN BEGIN PLAYER¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÄÎ PLAYER¯FRAME = MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ) - 1 BEND:ELSE BEGIN PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯ×ÁÌË) PLAYER¯FRAME = 0 BEND BEND IF BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ OR BADDIE¯STATE = ÂÓ¯ÄÅÁÄ THEN BEGIN IF PX > (BX + 5) THEN PLAYER¯MIRROR = 1 IF BX > (PX + 5) THEN PLAYER¯MIRROR = 0 BEND:ELSE BEGIN PLAYER¯MIRROR = 0 BEND RETURN'--------------------------.CONSIDER¯NEXT¯BADDIE¯FRAME'-------------------------- IF BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ THEN BEGIN IF BX > (PX + 5) THEN BADDIE¯MIRROR = 1 IF PX > (BX + 5) THEN BADDIE¯MIRROR = 0 BEND IF BADDIE¯ANIM <> ÁÎÉͯÐ×ÁÌË THEN BEGIN BADDIE¯FRAME = BADDIE¯FRAME + 1 BEND IF BADDIE¯FRAME >= MAX¯FRAME(BADDIE¯FORM, BADDIE¯ANIM) THEN BEGIN IF BADDIE¯ANIM = ÁÎÉͯÐÄÉÅ THEN BEGIN IF BADDIE¯ENERGY > 0 THEN BEGIN BADDIE¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÕÐ BADDIE¯FRAME = 0 BEND:ELSE BEGIN BADDIE¯FRAME = MAX¯FRAME(BADDIE¯FORM, BADDIE¯ANIM) - 1 BEND RETURN BEND IF BADDIE¯KNEEL¯FLAG = 1 AND BADDIE¯ANIM <> ÁÎÉͯÐËÎÅÅ̯ÄÎ THEN BEGIN BADDIE¯ANIM = ÁÎÉͯÐËÎÅÅ̯ÄÎ BADDIE¯FRAME = MAX¯FRAME(ÆÏÒͯÈÕÍÁÎ, ÁÎÉͯÐËÎÅÅ̯ÄÎ) - 1 BEND:ELSE BEGIN BADDIE¯ANIM = FORM¯ANIM(BADDIE¯FORM, ÆÁÎÉͯ×ÁÌË) BADDIE¯FRAME = 0 BEND RETURN BEND IF BADDIE¯STATE <> ÂÓ¯ÁÌÉÖÅ THEN RETURN IF BADDIE¯ANIM = ÁÎÉͯÐÄÉÅ THEN RETURN GOSUB IF¯PLAYER¯FAR¯WALK¯CLOSER IF RET% = 1 THEN RETURN GOSUB IF¯PLAYER¯NEARER¯WALK¯CAUTIOUS IF RET% = 1 THEN RETURN GOSUB IF¯PLAYER¯HITTABLE¯TRY¯HITTING IF RET% = 1 THEN RETURN ' IF PLAYER IS TRYING TO HIT ME, CONSIDER FLEEING RETURN'------------------------------.IF¯PLAYER¯HITTABLE¯TRY¯HITTING'------------------------------ RET% = 0 ' IF PLAYER IS WITHIN HITTING DISTANCE, CONSIDER HITTING IF ABS(PX-BX) >= 8 AND BADDIE¯ANIM = ÁÎÉͯÐ×ÁÌË THEN BEGIN RET% = 1 K = INT(RND(1)*8) IF K = 1 THEN BEGIN BADDIE¯ANIM = ÁÎÉͯÐÐÕÎÃÈ BADDIE¯FRAME=0 SOUND 1 + BADDIE¯MIRROR * 3, 4000, 5, 1, 100, 1000, 3 BEND IF K = 2 THEN BEGIN BADDIE¯ANIM = ÁÎÉͯÐËÉÃË BADDIE¯FRAME=0 SOUND 1 + BADDIE¯MIRROR * 3, 2000, 5, 1, 100, 1000, 3 BEND BEND RETURN'------------------------------.IF¯PLAYER¯NEARER¯WALK¯CAUTIOUS'------------------------------ RET% = 0 ' IF PLAYER IS NEARER, WALK AHEAD MORE CAUTIOUSLY IF ABS(PX-BX) > 8 THEN BEGIN IF INT(RND(1)*4) >= 3 THEN GOSUB MOVE¯BADDIE¯CLOSER RET% = 1 BEND RETURN'-------------------------.IF¯PLAYER¯FAR¯WALK¯CLOSER'------------------------- RET% = 0 ' IF PLAYER IS A LONG DISTANCE AWAY, COMMIT TO WALKING CLOSER IF ABS(PX-BX) > 20 THEN BEGIN GOSUB MOVE¯BADDIE¯CLOSER RET% = 1 BEND RETURN'------------------.MOVE¯BADDIE¯CLOSER'------------------ BADDIE¯ANIM = ÁÎÉͯÐ×ÁÌË BADDIE¯FRAME = BADDIE¯FRAME + 1 IF BADDIE¯FRAME >= MAX¯FRAME(BADDIE¯FORM, BADDIE¯ANIM) THEN BADDIE¯FRAME = 0 IF BX > PX THEN BEGIN BX = BX - 1 BEND:ELSE BEGIN BX = BX + 1 BEND RETURN'------------------.DRAW¯PETSCII¯FRAME'------------------ POKE $4000B, $04 ' ASSURE SOURCE BANK 4 (FOR ORIGINAL FRAME DATA) IF MIRROR = 1 THEN SETBIT $40006, 5:ELSE CLRBIT $40006, 5 DATA¯ADDR = FRAME¯ADDR(DAT¯IDX, FRAMEIDX) FRMX = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯Ø) FRMY = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯Ù) FRMW = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯×) FRMH = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯È) FRMX = FX ' OVERRIDE POSITION FRMY = FY FRMX1=FRMX+FRMW-1 FRMY1=FRMY+FRMH-1 CLRADDR = $51000 + FRMX + FRMY * 80 IF MIRROR = 1 THEN CLRADDR = CLRADDR + FRMW - 1 CDATA¯ADDR = DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯ÄÁÔÁ FOR YY=FRMY TO FRMY1 ' DRAW CHARS ' ---------- SRC¯ADDR = CDATA¯ADDR DEST¯ADDR = CLRADDR LENGTH = FRMW TRANSP = $FF GOSUB TRANSPARENT¯DMA CDATA¯ADDR = CDATA¯ADDR + FRMW CLRADDR = CLRADDR + 80 NEXT YY IF ÄÅÂÕÇ THEN GOSUB DRAW¯BOXES GOSUB CHECK¯IF¯HIT¯OPPONENT RETURN'------------------.DRAW¯PETSCII¯LAYER'------------------ CLRBIT $40006, 5 DATA¯ADDR = FRAME¯ADDR(ÄÁÔ¯ÌÁÙÅÒ, FRAMEIDX) FRMX = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯Ø) FRMY = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯Ù) FRMW = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯×) FRMH = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯È) FRMX1=FRMX+FRMW-1 FRMY1=FRMY+FRMH-1 CLRADDR = $51000 + FRMX + FRMY * 80 CDATA¯ADDR = DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯ÄÁÔÁ + FRMW * FRMH XOFFS(FRAMEIDX) = MOD(XOFFS(FRAMEIDX) + 80, 80) XOFFS = INT(XOFFS(FRAMEIDX)) CDATA¯ADDR = FRAME¯DBLUP¯ADDR(FRAMEIDX) FOR YY=FRMY TO FRMY1 ' DRAW CHARS FROM OFFSET TO END ' ----------------------------- SRC¯ADDR = CDATA¯ADDR + XOFFS DEST¯ADDR = CLRADDR LENGTH = FRMW TRANSP = $FF GOSUB TRANSPARENT¯DMA CDATA¯ADDR = CDATA¯ADDR + FRMW * 2 CLRADDR = CLRADDR + 80 NEXT YY RETURN'--------.GAMEPLAY'-------- GOSUB GET¯USER¯INPUT GOSUB DRAW¯BACKGROUND GOSUB DRAW¯SPRITES GOSUB PAGE¯FLIP GOSUB GAME¯LOGIC GOSUB DRAW¯ENERGY¯BARS RET% = 0 DO WHILE RET% = 0 GOSUB PARSE¯CURRENT¯SEQPTR LOOP GOTO GAMEPLAY RETURN'----------------.DRAW¯ENERGY¯BARS'---------------- IF PLAYER¯ENERGY <> LAG¯PENERGY THEN BEGIN IF LAG¯PENERGY < PLAYER¯ENERGY THEN BEGIN LAG¯PENERGY = LAG¯PENERGY + 1 K = LAG¯PENERGY GOSUB DRAW¯BLUE¯TRIANGLE RETURN BEND IF LAG¯PENERGY > PLAYER¯ENERGY THEN BEGIN K = LAG¯PENERGY GOSUB CLEAR¯BLUE¯TRIANGLE LAG¯PENERGY = LAG¯PENERGY - 1 RETURN BEND BEND IF BADDIE¯ENERGY <> LAG¯BENERGY THEN BEGIN IF LAG¯BENERGY < BADDIE¯ENERGY THEN BEGIN LAG¯BENERGY = LAG¯BENERGY + 1 K = LAG¯BENERGY GOSUB DRAW¯RED¯TRIANGLE RETURN BEND IF LAG¯BENERGY > BADDIE¯ENERGY THEN BEGIN K = LAG¯BENERGY GOSUB CLEAR¯RED¯TRIANGLE LAG¯BENERGY = LAG¯BENERGY - 1 RETURN BEND BEND RETURN'------------------.DRAW¯BLUE¯TRIANGLE'------------------ CURSOR 1 + K * 2, 48:PRINT "ß"; CURSOR 1 + K * 2, 49:PRINT "©"; RETURN'-------------------.CLEAR¯BLUE¯TRIANGLE'------------------- CURSOR 1 + K * 2, 48:PRINT " "; CURSOR 1 + K * 2, 49:PRINT " "; RETURN'-----------------.DRAW¯RED¯TRIANGLE'----------------- CURSOR 78 - K * 2, 48:PRINT "©"; CURSOR 78 - K * 2, 49:PRINT "ß"; RETURN'------------------.CLEAR¯RED¯TRIANGLE'------------------ CURSOR 78 - K * 2, 48:PRINT " "; CURSOR 78 - K * 2, 49:PRINT " "; RETURN'------------.DRAW¯SPRITES'------------ IF BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ OR BADDIE¯STATE = ÂÓ¯ÄÅÁÄ THEN BEGIN GOSUB DRAW¯BADDIE BEND GOSUB DRAW¯PLAYER RETURN'----------.GAME¯LOGIC'---------- GOSUB CONSIDER¯NEXT¯PLAYER¯FRAME GOSUB ASSESS¯BADDIE¯STATE RETURN'-------------------.ASSESS¯BADDIE¯STATE'------------------- IF BADDIE¯STATE = ÂÓ¯ÏÆÆ THEN BEGIN ' CONSIDER WHEN TO SPAWN NEXT BADDIE NEXT¯BADDIE¯TIME = NEXT¯BADDIE¯TIME - 1 IF NEXT¯BADDIE¯TIME = 0 THEN BADDIE¯STATE = ÂÓ¯ÓÐÁ×Î RETURN BEND IF BADDIE¯STATE = ÂÓ¯ÓÐÁ×Î THEN BEGIN BADDIE¯FORM = ÆÏÒͯÈÕÍÁÎ IF BADDIE¯DAT¯FIXED = ÄÁÔ¯ÐÌÁÙÅÒ2 THEN BEGIN BADDIE¯DAT¯FIXED = ÄÁÔ¯ÐÌÁÙÅÒ3 BEND: ELSE BEGIN BADDIE¯DAT¯FIXED = ÄÁÔ¯ÐÌÁÙÅÒ2 BEND BADDIE¯DAT¯IDX = BADDIE¯DAT¯FIXED BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ BX = 60 : BY = 23 BADDIE¯ANIM = FORM¯ANIM(BADDIE¯FORM, ÆÁÎÉͯ×ÁÌË) BADDIE¯FRAME = 0 BADDIE¯ENERGY = 18 LAG¯BENERGY = 0 BADDIE¯MIRROR = 1 BJUMP = 0 RETURN BEND IF BADDIE¯STATE = ÂÓ¯ÁÌÉÖÅ THEN BEGIN GOSUB CONSIDER¯NEXT¯BADDIE¯FRAME IF BADDIE¯ENERGY = 0 THEN BADDIE¯STATE = ÂÓ¯ÄÅÁÄ: BADDIE¯DEAD¯TIME=50 RETURN BEND IF BADDIE¯STATE = ÂÓ¯ÄÅÁÄ THEN BEGIN GOSUB CONSIDER¯NEXT¯BADDIE¯FRAME PLAYER¯MIRROR = 0 BADDIE¯DEAD¯TIME = BADDIE¯DEAD¯TIME - 1 IF BADDIE¯DEAD¯TIME = 0 THEN BADDIE¯STATE = ÂÓ¯ÏÆÆ:NEXT¯BADDIE¯TIME=50 RETURN BEND RETURN'---------.PAGE¯FLIP'--------- IF ÄÅÂÕÇ THEN BEGIN EDMA 0, $F00, $50000, $40800 EDMA 3, $F00, 160, $50000 BEND EDMA 0, $F00, $51000, $FF80000 ' FILL THE TOP PART EDMA 3, $F00, $4F, $51000 RETURN'---------.INCR¯OFFS'--------- FOR K = 0 TO ÈÉÇÈÅÓÔ¯ÌÁÙÅÒ XOFFS(K) = XOFFS(K) + OFFS¯AMOUNT(K) NEXT K RETURN'---------.DECR¯OFFS'--------- FOR K = 0 TO ÈÉÇÈÅÓÔ¯ÌÁÙÅÒ XOFFS(K) = XOFFS(K) - OFFS¯AMOUNT(K) NEXT K RETURN'----------.DRAW¯BOXES'---------- PTR = DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯ÈÉÔÂÏØÅÓ FOR IDX = 0 TO 3 X1 = PEEK(PTR + 0) Y1 = PEEK(PTR + 1) X2 = PEEK(PTR + 2) Y2 = PEEK(PTR + 3) IF NOT (X1=0 AND Y1=0 AND X2=0 AND Y2=0) THEN BEGIN GOSUB ADJUST¯COORDS DRAW¯COLOR = 7 IF IDX = 3 THEN BEGIN DRAW¯COLOR = 2 GOSUB DRAW¯BOX ' GOSUB CHECK¯IF¯HIT¯OPPONENT BEND:ELSE BEGIN GOSUB DRAW¯BOX BEND BEND PTR = PTR + 4 NEXT IDX RETURN'--------.DRAW¯BOX'-------- ' DRAW CORNERS ' ------------ X = X1 : Y = Y1 : K = ÃÈÁÒ¯ÂÏدÔÌ : GOSUB DRAW¯CHAR X = X2 : Y = Y1 : K = ÃÈÁÒ¯ÂÏدÔÒ : GOSUB DRAW¯CHAR X = X1 : Y = Y2 : K = ÃÈÁÒ¯ÂÏدÂÌ : GOSUB DRAW¯CHAR X = X2 : Y = Y2 : K = ÃÈÁÒ¯ÂÏدÂÒ : GOSUB DRAW¯CHAR ' DRAW HORIZONTALS ' ---------------- FOR X = X1+1 TO X2-1 Y = Y1 : K = ÃÈÁÒ¯ÈÏÒÚ : GOSUB DRAW¯CHAR Y = Y2 : K = ÃÈÁÒ¯ÈÏÒÚ : GOSUB DRAW¯CHAR NEXT X ' DRAW VERTICALS ' -------------- FOR Y = Y1+1 TO Y2-1 X = X1 : K = ÃÈÁÒ¯ÖÅÒÔ : GOSUB DRAW¯CHAR X = X2 : K = ÃÈÁÒ¯ÖÅÒÔ : GOSUB DRAW¯CHAR NEXT Y RETURN'---------.DRAW¯CHAR'--------- IF PEEK($50000 + X + Y * 80) <> ÃÈÁÒ¯ÓÐÁÃÅ THEN BEGIN K = K + 128 BEND:ELSE BEGIN POKE $51000 + X + Y * 80, 1 BEND IF DRAW¯COLOR = 2 THEN POKE $51000 + X + Y * 80, DRAW¯COLOR POKE $50000 + X + Y * 80, K RETURN'---------------------.CHECK¯IF¯HIT¯OPPONENT'--------------------- DATA¯ADDR = FRAME¯ADDR(DAT¯IDX, FRAMEIDX) TMP¯MIRROR = MIRROR IF CHARACTER = ÐÌÁÙÅÒ THEN BEGIN FRAMEIDX = ANIM¯ORDER(BADDIE¯FORM, BADDIE¯ANIM, BADDIE¯FRAME) OPPONENT¯DATA¯ADDR = FRAME¯ADDR(BADDIE¯DAT¯IDX, FRAMEIDX) OPPONENT¯MIRROR = BADDIE¯MIRROR FX=BX : FY=BY BEND IF CHARACTER = ÂÁÄÄÉÅ THEN BEGIN FRAMEIDX = ANIM¯ORDER(PLAYER¯FORM, PLAYER¯ANIM, PLAYER¯FRAME) OPPONENT¯DATA¯ADDR = FRAME¯ADDR(PLAYER¯DAT¯IDX, FRAMEIDX) OPPONENT¯MIRROR = PLAYER¯MIRROR FX=PX : FY=PY BEND X1 = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅԯȯÁÔÔÁÃË + 0) Y1 = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅԯȯÁÔÔÁÃË + 1) X2 = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅԯȯÁÔÔÁÃË + 2) Y2 = PEEK(DATA¯ADDR + ÆÒͯÏÆÆÓÅԯȯÁÔÔÁÃË + 3) IF X1=0 AND Y1=0 AND X2=0 AND Y2=0 THEN RETURN GOSUB ADJUST¯COORDS P¯X1 = X1 P¯Y1 = Y1 P¯X2 = X2 P¯Y2 = Y2 FRMX = PEEK(OPPONENT¯DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯Ø) FRMY = PEEK(OPPONENT¯DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯Ù) FRMX = FRMX + FX FRMY = FRMY + FY FRMW = PEEK(OPPONENT¯DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯×) FRMH = PEEK(OPPONENT¯DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯È) ' ITERATE THROUGH HEAD/TORSO/FEET HITBOXES OF OPPONENT PTR = OPPONENT¯DATA¯ADDR + ÆÒͯÏÆÆÓÅÔ¯ÈÉÔÂÏØÅÓ FOR IDX = 0 TO 2 X1 = PEEK(PTR + 0) Y1 = PEEK(PTR + 1) X2 = PEEK(PTR + 2) Y2 = PEEK(PTR + 3) GOSUB ADJUST¯COORDS O¯X1 = X1 O¯Y1 = Y1 O¯X2 = X2 O¯Y2 = Y2 GOSUB CHECK¯BOX¯COLLISION IF RET% = 1 THEN BEGIN IF CHARACTER = ÂÁÄÄÉÅ THEN BEGIN PLAYER¯ANIM = FORM¯ANIM(PLAYER¯FORM, ÆÁÎÉͯÄÉÅ) PLAYER¯FRAME = 0 IF PLAYER¯ENERGY > 0 THEN PLAYER¯ENERGY = PLAYER¯ENERGY - 1 IF PLAYER¯ENERGY = 0 THEN BEGIN SOUND 1 + PLAYER¯MIRROR * 3, 8000, 50, 1, 435, 100, 0, 4000 BEND:ELSE BEGIN SOUND 1 + PLAYER¯MIRROR * 3, 8000, 10, 1, 435, 200, 0, 4000 BEND BEND IF CHARACTER = ÐÌÁÙÅÒ THEN BEGIN BADDIE¯ANIM = FORM¯ANIM(BADDIE¯FORM, ÆÁÎÉͯÄÉÅ) BADDIE¯FRAME = 0 IF BADDIE¯ENERGY > 0 THEN BADDIE¯ENERGY = BADDIE¯ENERGY - 1 IF BADDIE¯ENERGY = 0 THEN BEGIN SOUND 1 + BADDIE¯MIRROR * 3, 8000, 50, 1, 435, 100, 0, 4000 BEND:ELSE BEGIN SOUND 1 + BADDIE¯MIRROR * 3, 8000, 10, 1, 435, 200, 0, 4000 BEND BEND IDX = 2 ' FORCE BAIL OUT OF FOR-LOOP UPON ANY HIT BEND PTR = PTR + 4 NEXT IDX MIRROR = TMP¯MIRROR PTR = FRAME¯ADDR(DAT¯IDX, FRAMEIDX) RETURN'-------------.ADJUST¯COORDS'------------- IF MIRROR = 0 THEN BEGIN X1 = FRMX + X1 Y1 = FRMY + Y1 X2 = FRMX + X2 Y2 = FRMY + Y2 BEND:ELSE BEGIN TMPX1 = X1 X1 = FRMX + FRMW - X2 - 1 Y1 = FRMY + Y1 X2 = FRMX + FRMW - TMPX1 - 1 Y2 = FRMY + Y2 BEND RETURN'-------------------.CHECK¯BOX¯COLLISION'------------------- 'PRINT "";CHR$(27);"Q";P¯X1;P¯Y1;P¯X2;P¯Y2 'PRINT CHR$(27);"Q";O¯X1;O¯Y1;O¯X2;O¯Y2; 'GET KEY A$ IF NOT ((O¯X1 > P¯X2) OR _ (O¯X2 < P¯X1) OR _ (O¯Y1 > P¯Y2) OR _ (O¯Y2 < P¯Y1)) THEN _ BEGIN RET% = 1 BEND:ELSE BEGIN RET% = 0 BEND RETURN'---------.LOAD¯SONG'--------- DOPEN #2,(SONG$),R,U8 ' LOAD MELODY CHUNKS ' ------------------ INPUT #2, CHUNK¯CNT FOR CHUNK¯IDX = 0 TO CHUNK¯CNT - 1 FOR VIDX=0 TO 5 INPUT #2,V$(VIDX, CHUNK¯IDX) NEXT VIDX NEXT CHUNK¯IDX INPUT #2,TMPO% ' LOAD ENVELOPES ' -------------- FOR ROW = 0 TO 9 INPUT #2, ENVS¯NAME$(ROW) INPUT #2, ENVS¯ATTACK(ROW) INPUT #2, ENVS¯DECAY(ROW) INPUT #2, ENVS¯SUSTAIN(ROW) INPUT #2, ENVS¯RELEASE(ROW) INPUT #2, ENVS¯WAVEFORM(ROW) INPUT #2, ENVS¯PW(ROW) GOSUB SET¯ENV NEXT ROW PRINT ' LOAD FILTER PRESETS ' ------------------- FOR ROW = 0 TO 10 INPUT #2, FILT¯NAME$(ROW) INPUT #2, FILT¯FREQ(ROW) INPUT #2, FILT¯LP(ROW) INPUT #2, FILT¯BP(ROW) INPUT #2, FILT¯HP(ROW) INPUT #2, FILT¯RES(ROW) INPUT #2, FILT¯DIR(ROW) INPUT #2, FILT¯MIN(ROW) INPUT #2, FILT¯SWEEP(ROW) NEXT ROW ' LOAD SEQUENCE ' ------------- SEQCNT = 0 INPUT #2, SEQCNT ROW = 0 DO WHILE ROW < SEQCNT INPUT #2, SEQ¯CHUNK(ROW) INPUT #2, SEQ¯EXTRA(ROW) ROW = ROW + 1 LOOP DCLOSE #2 CHUNK¯IDX = 0 RETURN'-------.SET¯ENV'------- ENVELOPE ROW, ENVS¯ATTACK(ROW), ENVS¯DECAY(ROW), ENVS¯SUSTAIN(ROW), ENVS¯RELEASE(ROW), ENVS¯WAVEFORM(ROW), ENVS¯PW(ROW) RETURN'--------------------.PARSE¯CURRENT¯SEQPTR'-------------------- RET% = 0 IF RPLAY(1)<>0 THEN RET%=1:RETURN K = SEQ¯CHUNK(PLYPTR) IF K >= 0 THEN BEGIN CHUNK¯IDX = K IF CHUNK¯RPT <= 0 THEN CHUNK¯RPT = SEQ¯EXTRA(PLYPTR) GOSUB PLAY¯CHUNK¯IDX 'SLEEP .1 RET% = 1 BEND IF K = ÃÍįÔÅÍÐÏ THEN BEGIN K = SEQ¯EXTRA(PLYPTR) TEMPO (K) TMPO% = K BEND IF K = ÃÍįÆÉÌÔÅÒ THEN BEGIN K = SEQ¯EXTRA(PLYPTR) FSROW = K FSEL = K GOSUB APPLY¯SELECTED¯FILTER BEND IF K = ÃÍįÅÃÈϯÍ1 THEN ECHO¯M = 1 : ECHO¯DELAY = 0 IF K = ÃÍįÅÃÈϯÍ2 THEN ECHO¯M = 2 : ECHO¯DELAY = 0 IF K = ÃÍįÅÃÈϯ THEN ECHO¯B = 1 : ECHO¯DELAY = 0 IF K = ÃÍįÅÃÈϯÏÆÆ THEN ECHO¯M = 0 : ECHO¯B = 0 IF K = ÃÍįÅÃÈϯÓÚ THEN ECHO¯SZ = SEQ¯EXTRA(PLYPTR) IF K = ÃÍįÄÅÌÁÙ THEN ECHO¯DELAY = 1 : ECHO¯M = 0 : ECHO¯B = 0 IF K = ÃÍįÖÏÌ THEN V = SEQ¯EXTRA(PLYPTR) : VOL V, V IF CHUNK¯RPT > 0 THEN CHUNK¯RPT = CHUNK¯RPT - 1 IF CHUNK¯RPT <= 0 THEN PLYPTR = PLYPTR + 1 IF K = ÃÍįÌÏÏÐ THEN PLYPTR = 0 IF PLYPTR >= SEQCNT THEN PLYFLAG = 0 : PLYPTR = -1 RETURN'--------------.PLAY¯CHUNK¯IDX'-------------- V1$ = V$(0,CHUNK¯IDX) V2$ = V$(1,CHUNK¯IDX) V3$ = V$(2,CHUNK¯IDX) V4$ = V$(3,CHUNK¯IDX) V5$ = V$(4,CHUNK¯IDX) V6$ = V$(5,CHUNK¯IDX) IF ECHO¯DELAY = 1 THEN BEGIN PLAY V1$ SLEEP (ECHO¯SZ) PLAY ,V2$ SLEEP (ECHO¯SZ) PLAY ,,V3$ SLEEP (ECHO¯SZ) PLAY ,,,V4$ SLEEP (ECHO¯SZ) PLAY ,,,,V5$ SLEEP (ECHO¯SZ) PLAY ,,,,,V6$ SLEEP (ECHO¯SZ) RETURN BEND IF ECHO¯M = 0 AND ECHO¯B = 0 THEN BEGIN PLAY V1$, V2$, V3$, V4$, V5$, V6$ RETURN BEND IF ECHO¯M = 1 AND ECHO¯B = 0 THEN BEGIN PLAY V1$, V2$, V3$, , V5$, V6$ SLEEP (ECHO¯SZ) PLAY , , , V1$ BEND IF ECHO¯M = 1 AND ECHO¯B = 1 THEN BEGIN PLAY V1$, V2$, V3$, , V5$ SLEEP (ECHO¯SZ) PLAY , , , V1$, , V3$ BEND IF ECHO¯M = 2 AND ECHO¯B = 0 THEN BEGIN PLAY V1$, , V3$, , , V6$ SLEEP (ECHO¯SZ) PLAY , , , V1$ SLEEP (ECHO¯SZ) PLAY , V1$ SLEEP (ECHO¯SZ) PLAY , , , , V1$ BEND IF ECHO¯M = 2 AND ECHO¯B = 1 THEN BEGIN PLAY V1$, , V3$ SLEEP (ECHO¯SZ) PLAY , , , V1$ SLEEP (ECHO¯SZ) PLAY , V1$, , , , V3$ SLEEP (ECHO¯SZ) PLAY , , , , V1$ BEND RETURN'---------------------.APPLY¯SELECTED¯FILTER'--------------------- IF FSEL = -1 THEN RETURN CURR¯FREQ = FILT¯FREQ(FSEL) CURR¯DIR = ÄÉÒ¯ÎÏÎÅ IF FILT¯DIR(FSEL) = ÄÉÒ¯ÕÐ _ OR FILT¯DIR(FSEL) = ÄÉÒ¯ÏÓà THEN BEGIN CURR¯FREQ = FILT¯MIN(FSEL) CURR¯DIR = ÄÉÒ¯ÕÐ BEND IF FILT¯DIR(FSEL) = ÄÉÒ¯ÄÏ×Î THEN BEGIN CURR¯DIR = ÄÉÒ¯ÄÏ×Î BEND FILTER 1, FILT¯FREQ(FSEL), FILT¯LP(FSEL), _ FILT¯BP(FSEL), FILT¯HP(FSEL), FILT¯RES(FSEL) FILTER 2, FILT¯FREQ(FSEL), FILT¯LP(FSEL), _ FILT¯BP(FSEL), FILT¯HP(FSEL), FILT¯RES(FSEL) RETURN