Advertisement
lovejoy777

AGON UDC using VDU

Dec 23rd, 2023 (edited)
2,216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
FreeBasic 6.08 KB | Source Code | 0 0
  1.    10 REM ******************************
  2.    20 REM *       AGON LIGHT 2         *
  3.    30 REM *          DEMO 04           *
  4.    40 REM *      BBC BASIC MODE 0      *
  5.    50 REM *    User Defined Chars 3    *
  6.    60 REM *      BY STEVE LOVEJOY      *
  7.    70 REM ******************************
  8.    80 :
  9.    90 REM MAIN SETUP.
  10.   100 CLEAR
  11.   110 PROC_LOAD_VARS : REM CALL LOAD_VARS.
  12.   120 PROC_LOAD_CHARS : REM CALL LOAD_CHARS.
  13.   130 PROC_INIT : REM CALL INIT.
  14.   140 PROC_MAINLOOP : REM CALL MAIN LOOP.
  15.   150 VDU 30,17,15 : REM MOVES CURSOR HOME (TOP LEFT) <PIPE> 0,0) AND COLOUR WHITE.
  16.   160 END : REM END MAIN SETUP.
  17.   170 :
  18.  1000 DEF PROC_MAINLOOP : REM ****** MAIN LOOP ******
  19.  1010 CLS : REM CLEAR THE SCREEN.
  20.  1020 NX = 34 : REM SET X.
  21.  1030 NY = 27 : REM SET Y AT THE TOP OF THE SCREEN.
  22.  1040 :
  23.  1050 FOR J=1 TO 15 : REM LOOP FOR COLOUR CHANGE.
  24.  1060 REM CLS : REM CLEAR THE SCREEN BETWEEN EACH COLOUR CHANGE.
  25.  1070 COLOUR J : REM ASSIGN COLOUR OF J.
  26.  1080 PROC_DRAW_HUD : REM DRAW THE HUD (BORDER).
  27.  1110 PROC_DRAW_AGON(NX,NY) : REM THIS ALLOWS YOU TO MOVE THE AGON TEXT WITH CODE.
  28.  1120 PROC_DRAW_LIGHT(NX+2,NY+2) : REM THIS ALLOWS YOU TO MOVE THE LIGHT TEXT WITH CODE.
  29.  1130 ANYKEY%=INKEY(100) : REM DELAY
  30.  1140 NEXT J
  31.  1150 :
  32.  1200 ENDPROC : REM END MAIN_LOOP.
  33.  1210 :
  34.  2010 DEF PROC_INIT : REM ***** INIT ****
  35.  2020 MODE mode% : REM SETS SCREEN MODE FROM VARS.
  36.  2030 CLS : REM CLEAR TEXT SCREEN.
  37.  2040 CLG : REM CLEAR GRAPHICS SCREEN.
  38.  2050 PROC_HIDE_CURSOR : REM CALL HIDE_CURSOR.
  39.  2060 ENDPROC : REM END INIT
  40.  2070 :
  41.  5000 DEF PROC_HIDE_CURSOR : REM ******* HIDE_CURSOR *******
  42.  5010 VDU 23,1,0
  43.  5020 ENDPROC
  44.  5030 :
  45.  5040 DEF PROC_SHOW_CURSOR : REM ****** SHOW_CURSOR *******
  46.  5050 VDU 23,1,1
  47.  5050 ENDPROC
  48.  5070 :
  49.  7010 DEF PROC_LOAD_CHARS : REM ****** LOAD_CHARS TO MEMORY ******
  50.  7020 REM ASSIGN A to CHRS.
  51.  7030 VDU 23,201,0,0,0,0,1,1,7,7,23,202,30,30,126,126,254,254,254,254
  52.  7040 VDU 23,203,31,31,126,126,120,120,0,0,23,204,158,158,30,30,30,30,6,6
  53.  7070 REM ASSIGN G to CHARS.
  54.  7080 VDU 23,205,127,127,127,112,112,112,112,112,23,206,254,254,254,0,0,6,6,30
  55.  7090 VDU 23,207,112,112,112,127,127,127,0,0,23,208,30,30,30,254,254,254,24,24
  56.  7100 REM ASSIGN O to CHARS.
  57.  7110 VDU 23,209,127,127,127,112,112,112,112,112,23,210,254,254,254,14,14,14,14,14
  58.  7120 VDU 23,211,112,112,112,127,127,127,0,0,23,212,14,14,14,254,254,254,0,0
  59.  7130 REM ASSIGN N to CHARS.
  60.  7140 VDU 23,213,96,120,120,126,126,127,127,127,23,214,14,14,14,14,14,142,142,254
  61.  7150 VDU 23,215,127,113,113,112,112,112,0,0,23,216,254,254,254,126,126,30,30,6
  62.  7160 :
  63.  7170 REM ASSIGN L to CHRS.
  64.  7180 VDU 23,217,120,120,120,120,120,120,120,120,23,218,0,0,0,0,0,0,0,0
  65.  7190 VDU 23,219,120,120,120,127,127,127,0,0,23,220,0,0,0,254,254,254,0,0
  66.  7200 REM ASSIGN I to CHARS.
  67.  7210 VDU 23,221,127,127,127,3,3,3,3,3,23,222,254,254,254,192,192,192,192,192
  68.  7220 VDU 23,223,3,3,3,127,127,127,0,0,23,224,192,192,192,254,254,254,0,0
  69.  7230 REM ASSIGN H to CHARS.
  70.  7240 VDU 23,225,120,120,120,120,120,120,127,127,23,226,6,6,30,30,30,30,254,254
  71.  7250 VDU 23,227,127,127,120,120,120,120,96,96,23,228,254,254,30,30,30,30,0,0
  72.  7260 REM ASSIGN T to CHARS.
  73.  7270 VDU 23,229,127,127,127,3,3,3,3,3,23,230,254,254,254,192,192,192,192,192
  74.  7280 VDU 23,231,3,3,3,3,3,3,0,0,23,232,192,192,192,192,192,192,192,192
  75.  7290 :
  76.  7300 REM HUD CHARS.
  77.  7310 VDU 23,237,255,255,192,192,192,192,192,192 : REM TOP LEFT CORNER.
  78.  7320 VDU 23,238,255,255,3,3,3,3,3,3 : REM TOP RIGHT CORNER.
  79.  7330 VDU 23,239,192,192,192,192,192,192,255,255 : REM BOT LEFT CORNER.
  80.  7340 VDU 23,240,3,3,3,3,3,3,255,255 : REM BOT RIGHT CORNER.
  81.  7350 VDU 23,241,255,255,0,0,0,0,0,0 : REM TOP STRAIGHT.
  82.  7360 VDU 23,242,0,0,0,0,0,0,255,255 : REM BOT STRAIGHT.
  83.  7370 VDU 23,243,192,192,192,192,192,192,192,192 : REM LEFT STRAIGHT.
  84.  7380 VDU 23,244,3,3,3,3,3,3,3,3 : REM RIGHT STRAIGHT.
  85.  7390 :
  86.  7400 ENDPROC : REM END LOAD_CHARS.
  87.  7410 :
  88.  8000 DEF PROC_LOAD_VARS : REM **** LOAD_VARS *****
  89.  8010 REM GIVE COLOURS A NAME.
  90.  8020 COLBLACK% = 0
  91.  8030 COLRED% = 1
  92.  8040 COLGREEN% = 2
  93.  8050 COLYELLOW% = 3
  94.  8060 COLBLUE% = 4
  95.  8070 COLMAGENTA% = 5
  96.  8080 COLCYAN% = 6
  97.  8090 COLWHITE% = 7
  98.  8100 COLINTRED% = 9
  99.  8110 COLINTGREEN% = 10
  100.  8120 COLINTYELLOW% = 11
  101.  8130 COLINTBLUE% = 12
  102.  8140 COLINTMAGENTA% = 13
  103.  8150 COLINTCYAN% = 14
  104.  8160 COLINTWHITE% = 15
  105.  8170 mode% = 0 : REM SET MODE HERE.
  106.  8180 RT% = 31 : REM SET RIGHT TEXT.
  107.  8190 LT% = 2 : REM SET LEFT TEXT.
  108.  8200 T1X = 0 : REM TITLE TEXT AGON X.
  109.  8210 T1Y = 0 : REM TITLE TEXT AGON Y.
  110.  8220 T2X = 0 : REM TITLE TEXT LIGHT X.
  111.  8230 T2Y = 0 : REM TITLE TEXT LIGHT Y.
  112.  8240 :
  113.  8500 ENDPROC : REM END LOAD_VARS.
  114.  8510 :
  115.  9000 DEF PROC_DRAW_AGON(T1X,T1Y) : REM ****** DRAW_AGON ******
  116.  9010 REM FROM CUSTOM CHARS DEFINED PREVIOUSLY DISPLAYED AS (2x2) CHARS.
  117.  9020 REM AGON.
  118.  9030 VDU 31,T1X,T1Y,27,201,27,202,31,T1X,T1Y+1,27,203,27,204,31,T1X+2,T1Y,27,205,27,206,31,T1X+2,T1Y+1,27,207,27,208,31,T1X+4,T1Y,27,209,27,210
  119.  9040 VDU 31,T1X+4,T1Y+1,27,211,27,212,31,T1X+6,T1Y,27,213,27,214,31,T1X+6,T1Y+1,27,215,27,216
  120.  9050 ENDPROC : REM END DRAW_AGON.
  121.  9060 :
  122.  9070 DEF PROC_DRAW_LIGHT(T2X,T2Y) : REM ****** DRAW_LIGHT ******
  123.  9080 REM FROM CUSTOM CHARS DEFINED PREVIOUSLY DISPLAY L (2x2) CHARS.
  124.  9090 REM LIGHT.
  125.  9100 VDU 31,T2X,T2Y,27,217,27,218,31,T2X,T2Y+1,27,219,27,220,31,T2X+2,T2Y,27,221,27,222,31,T2X+2,T2Y+1,27,223,27,224,31,T2X+4,T2Y,27,205,27,206
  126.  9110 VDU 31,T2X+4,T2Y+1,27,207,27,208,31,T2X+6,T2Y,27,225,27,226,31,T2X+6,T2Y+1,27,227,27,228,31,T2X+8,T2Y,27,229,27,230,31,T2X+8,T2Y+1,27,231,27,232
  127.  9120 ENDPROC : REM END DRAW_LIGHT.
  128.  9130 :
  129.  9200 DEF PROC_DRAW_HUD : REM ***** DRAW_HUD *******
  130.  9210 VDU 31,0,0,27,237 : REM TL CORNER.
  131.  9220 FOR TB = 1 TO 78
  132.  9230  VDU 31,TB,0,27,241 : REM TOP BORDER.
  133.  9240 NEXT TB
  134.  9250 VDU 31,79,0,27,238 : REM TR CORNER.
  135.  9260 FOR LB = 1 TO 57
  136.  9270  VDU 31,0,LB,27,243 : REM LEFT BORDER.
  137.  9280 NEXT LB
  138.  9290 FOR RB = 1 TO 57
  139.  9300  VDU 31,79,RB,27,244 : REM RIGHT BORDER.
  140.  9310 NEXT RB
  141.  9320 VDU 31,0,57,27,239 : REM BL CORNER.
  142.  9330 FOR BB = 1 TO 78
  143.  9340  VDU 31,BB,57,27,242 : REM BOTTOM BORDER.
  144.  9350 NEXT BB
  145.  9360 VDU 31,79,57,27,240 : REM BR CORNER.
  146.  9400 ENDPROC : REM END DRAW_HUD.
Tags: agon light
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement