home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Zodiac Super OZ
/
MEDIADEPOT.ISO
/
FILES
/
13
/
N_B_V203.ZIP
/
DARTBORD.DMO
< prev
next >
Wrap
Text File
|
1996-07-04
|
5KB
|
89 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME DARTBORD.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
Winmau isn't going to start using this type dartboard soon but it shows
how the polygon routines can be used for other things than drawing
polygons. They can compute points on any circle but how you use that
data is totally up to you! Clocks and their hands can be done also.
$endif
'.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°.°
' ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° ° °
'┌────────────────────────────
$INCLUDE "DAS-NB03.INC" '│ math lib
$INCLUDE "DAS-NBV1.INC" '│ graphics lib
$INCLUDE "PUBLICS .INC" '│ public variables pPi#
'│
SCREEN 12 '│
GraphicSETUP '│
CLS '│
'│
DIM tIn AS PolygonTYPE, Ipts%(1,20) '│ inner circle wire points
DIM tOut AS PolygonTYPE, Opts%(1,20) '│ outter circel wire points
DIM tDbl AS PolygonTYPE, Dpts%(1,20) '│ double ring paint positions
DIM tTpl AS PolyGonTYPE, Tpts%(1,20) '│ triple ring paint positions
DIM tS1 AS PolyGonTYPE, S1%(1,20) '│ inside single ring
DIM tS2 AS PolyGonTYPE, S2%(1,20) '│ outside single ring
'│
tIn.X = 320 '│ double bull
tIn.Y = 240 '│
tIn.Radius = 15 '│
tIn.Aspect = 1 '│
tIn.StartDeg = 9 '│
tIn.Points = 20 '│
tIn.Pmode = 3 '│
tIn.Colour = 10 '│
'│
LSET tOut = tIn : tOut.Radius = 175 '│ outside wire
LSET tDbl = tIn : tDbl.Radius = 100 '│ double beds
tDbl.StartDeg = 0 '│ rotate to 0 degrees
LSET tTpl = tDbl : tTpl.Radius = 165 '│ triple beds
LSET tS1 = tTpl : tS1.Radius = 25 '│ single beds (inside)
LSET tS2 = tTpl : tS2.Radius = 110 '│ single beds (outside)
'│
PolygonPoints tIn , Ipts%() '│ compute everything
PolygonPoints tOut, Opts%() '│ the arrays hold the X,Y
PolygonPoints tDbl, Dpts%() '│ positions of the points
PolygonPoints tTpl, Tpts%() '│ on the circles where the
PolygonPoints tS1 , S1%() '│ wires are drawn or where
PolygonPoints tS2 , S2%() '│ to start painting
'│
FOR X% = 1 TO 7 '│ draw circle wires
READ Radius? '│
CIRCLE ( 320, 240 ), Radius?, 7 '│
NEXT '│
DATA 205, 170, 160, 105, 95, 15, 7 '│
PAINT (0,0), 1, 7 '│ paint the chalk-board
'│
FOR X% = 1 TO 20 '│ draw bed wires
GLineDRAW Ipts%(0,X%), Ipts%(1,X%), _ '│
Opts%(0,X%), Opts%(1,X%), 0, 3, 7 '│
NEXT '│
'│
R? = 4 : G? = 2 '│ paint beds
FOR X% = 1 TO 20 '│
PAINT ( Tpts%(0,X%), Tpts%(1,X%) ), R?, 7 '│ triples
PAINT ( Dpts%(0,X%), Dpts%(1,X%) ), R?, 7 '│ doubles
IF ( X% MOD 2 ) = 0 THEN '│ single beds
PAINT ( S1%(0,X%), S1%(1,X%) ), 7, 7 '│
PAINT ( S2%(0,X%), S2%(1,X%) ), 7, 7 '│
END IF '│
SWAP R?, G? '│ switch red/green
NEXT '│
PAINT ( 320, 240 ), R?, 7 '│ double bull
PAINT ( 320, 250 ), G?, 7 '│ single bull
'└───────────────────────────