I have a question with a QB game I am making. In the subroutine
Compass, I am passing a value in degrees which I have made sure is
between 0 and 359. The arrow keys cycle up and down through degree
values. In Compass, I want some sort of indicator to move around the
compass (drawn in the top right-hand corner) indicating degree
position. 0 degrees must be straight up. As you can see, I cannot find
a way to do this. I have tried using CIRCLE with arcs to no avail.
Thanks in advance for any help.
----- Program Start -----
' ?
' o Laser Battle II 1.0 o
' o Build 0001 o
' ???????????????????????
' o By Chase Covello o
' o Copyright (C) 1997 o
' o by CHASOFt Software o
' ?
DECLARE SUB DrawCpit ()
DECLARE SUB Compass (degrees%)
DEFINT A-Z
CONST version = "1.0", build = "0001"
CONST PI# = 3.141592653589793#
SCREEN 13
CLS
DrawCpit
DO
WAIT &H3DA, 8, 8
WAIT &H3DA, 8
a$ = INKEY$
IF a$ = CHR$(0) + CHR$(77) THEN x = x + 1
IF a$ = CHR$(0) + CHR$(80) THEN y = y + 1
IF a$ = CHR$(0) + CHR$(75) THEN x = x - 1
IF a$ = CHR$(0) + CHR$(72) THEN y = y - 1
IF x > 359 THEN x = 0
IF x < 0 THEN x = 359
Compass (x)
LOOP WHILE a$ <> CHR$(27)
COLOR 12
LOCATE 12, 15
PRINT "GAME OVER"
SUB Compass (degrees)
CIRCLE (285, 25), 15, 12, (degrees - 90) / 57.29578, (degrees - 90) /
57.29578
LOCATE 1, 1
IF degrees < 10 THEN
PRINT " ";
ELSEIF 10 < degrees < 100 THEN
PRINT " ";
END IF
PRINT degrees
END SUB
DEFSNG A-Z
SUB DrawCpit
FOR c = 31 TO 20 STEP -1
i = c - 31
COLOR c
LINE (0, i + 60)-(40, i + 60)
LINE (40, i + 60)-(84, i + 16)
LINE (84, i + 16)-(216, i + 16)
LINE (216, i + 16)-(260, i + 60)
LINE (260, i + 60)-(319, i + 60)
PAINT (0, 0), c, c
NEXT c
c = 19
FOR i = 0 TO -11 STEP -1
c = c + 1
COLOR c
LINE (0, i + 140)-(40, i + 140)
LINE (40, i + 140)-(84, i + 184)
LINE (84, i + 184)-(216, i + 184)
LINE (216, i + 184)-(260, i + 140)
LINE (260, i + 140)-(319, i + 140)
NEXT i
PAINT (0, 199), 19, 20
CIRCLE (285, 25), 25, 18, PI * 1.25, PI / 3
CIRCLE (285, 25), 24, 18, PI * 1.25, PI / 3
CIRCLE (285, 25), 25, 24, PI / 3, PI * 1.25
CIRCLE (285, 25), 24, 24, PI / 3, PI * 1.25
CIRCLE (285, 25), 20, 0
PAINT (285, 25), 0, 0
CIRCLE (285, 25), 21, 24, PI * 1.25, PI / 3
CIRCLE (285, 25), 21, 18, PI / 3, PI * 1.25
END SUB
----- Program End -----
--
REALITY.SYS corrupted. Reboot Universe? [Y/N/C]
Chase Covello
http://www.*-*-*.com/