@Cobaltthats why I was using such a small ALPHA value so the outer rings have less effect than the inner ones(eventually it would be solid black, Black is what I am expecting by the time the ellipse get close to the center due to the overlap effect). But why is everything turning grey?
Try stepping through the "radius" faster. If you step 320 times 2 you are so far past alpha 255 you are opaque 2X's over! Good ole circle doesn't overlap itself over and over and aspect is calculated different than for ellipse.
thats why I was using such a small ALPHA value so the outer rings have less effect than the inner ones(eventually it would be solid black, Black is what I am expecting by the time the ellipse get close to the center due to the overlap effect). But why is everything turning grey?
it is still destroying the colors, turning everything grey.
Unless there is something I am missing?
'3D'esk dungeon crawl screen setup test 8/3/2020
'inspired by games like: "Stonekeep", "Phantasy Star", "Eye of the Beholder", and
' "Dungeon Master II:Legend of SkullKeep"
'Attempting to use MAPTRIANGLE to apply textures to dungeon walls, as done in QB45 via DirectQB's
'maptriangle function
SCREEN _NEWIMAGE(640, 480, 32)
'texture& = _LOADIMAGE("CaveWallTexture.jpg", 32)
'Temporary development texture set
Wall& = _LOADIMAGE("CaveWallx256.bmp", 32)
Floor& = _LOADIMAGE("CaveFloorx256.bmp", 32)
Ceiling& = _LOADIMAGE("CaveCeilingx256.bmp", 32)
'_MAPTRIANGLE (0, 0)-(320, 0)-(320, 240), texture& TO(0, 0)-(320, 100)-(320, 380), _DISPLAY
'_MAPTRIANGLE (0, 0)-(0, 480)-(320, 240), texture& TO(0, 0)-(0, 480)-(320, 380), _DISPLAY
'Left 0-10'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Wall& TO(0, 0)-(100, 60)-(100, 420), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Wall& TO(0, 0)-(0, 480)-(100, 420), _DISPLAY
'left 10-20'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Wall& TO(100, 60)-(200, 120)-(200, 360), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Wall& TO(100, 60)-(100, 420)-(200, 360), _DISPLAY
'left 20-30'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Wall& TO(200, 120)-(300, 180)-(300, 300), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Wall& TO(200, 120)-(200, 360)-(300, 300), _DISPLAY
'right 0-10'
_MAPTRIANGLE (255, 0)-(0, 0)-(255, 255), Wall& TO(640, 0)-(540, 60)-(540, 420), _DISPLAY
_MAPTRIANGLE (0, 255)-(0, 0)-(255, 255), Wall& TO(640, 0)-(640, 480)-(540, 420), _DISPLAY
'right 10-20'
_MAPTRIANGLE (255, 0)-(0, 0)-(255, 255), Wall& TO(540, 60)-(440, 120)-(440, 360), _DISPLAY
_MAPTRIANGLE (0, 255)-(0, 0)-(255, 255), Wall& TO(540, 60)-(540, 420)-(440, 360), _DISPLAY
'Right 20-30'
_MAPTRIANGLE (255, 0)-(0, 0)-(255, 255), Wall& TO(440, 120)-(340, 180)-(340, 300), _DISPLAY
_MAPTRIANGLE (0, 255)-(0, 0)-(255, 255), Wall& TO(440, 120)-(440, 360)-(340, 300), _DISPLAY
'floor 0-10'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Floor& TO(0, 480)-(100, 420)-(540, 420), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Floor& TO(0, 480)-(640, 480)-(540, 420), _DISPLAY
'floor 10-20'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Floor& TO(100, 420)-(200, 360)-(440, 360), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Floor& TO(100, 420)-(540, 420)-(440, 360), _DISPLAY
'floor 20-30'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Floor& TO(200, 360)-(300, 300)-(340, 300), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Floor& TO(200, 360)-(440, 360)-(340, 300), _DISPLAY
'Ceiling 0-10'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Ceiling& TO(0, 0)-(100, 60)-(540, 60), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Ceiling& TO(0, 0)-(640, 0)-(540, 60), _DISPLAY
'Ceiling 10-20'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Ceiling& TO(100, 60)-(200, 120)-(440, 120), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Ceiling& TO(100, 60)-(540, 60)-(440, 120), _DISPLAY
'Ceiling 20'-30'
_MAPTRIANGLE (0, 0)-(255, 0)-(255, 255), Ceiling& TO(200, 120)-(300, 180)-(340, 180), _DISPLAY
_MAPTRIANGLE (0, 0)-(0, 255)-(255, 255), Ceiling& TO(200, 120)-(440, 120)-(340, 180), _DISPLAY
'darken corners(some artifacting remains in very corner with lighter textures)
'bottom left
FOR i%% = 0 TO 20
LINE (0 + i%%, 480)-(300 + i%%, 300), _RGBA32(0, 0, 0, 120 - i%% * 6)
LINE (0, 480 - i%%)-(300, 300 - i%%), _RGBA32(0, 0, 0, 120 - i%% * 6)
NEXT i%%
'bottom right
FOR i%% = 0 TO 20
LINE (640 - i%%, 480)-(340 - i%%, 300), _RGBA32(0, 0, 0, 120 - i%% * 6)
LINE (640, 480 - i%%)-(340, 300 - i%%), _RGBA32(0, 0, 0, 120 - i%% * 6)
NEXT i%%
'Top Left
FOR i%% = 0 TO 24
LINE (0 + i%%, 0)-(300 + i%%, 180), _RGBA32(0, 0, 0, 160 - i%% * 6)
LINE (0, 0 + i%%)-(300, 180 + i%%), _RGBA32(0, 0, 0, 160 - i%% * 6)
NEXT i%%
'top right
FOR i%% = 0 TO 24
LINE (640 - i%%, 0)-(340 - i%%, 180), _RGBA32(0, 0, 0, 160 - i%% * 6)
LINE (640, 0 + i%%)-(340, 180 + i%%), _RGBA32(0, 0, 0, 160 - i%% * 6)
NEXT i%%
'end of hall
FOR i%% = 0 TO 12
LINE (300 - i%%, 180 - i%%)-(340 + i%%, 300 + i%%), _RGBA32(0, 0, 0, 160 - i%% * 8), B
NEXT i%%
'reverse vignette (darkens toward center of screen to simulate depth and light loss)
FOR i% = 0 TO 320 STEP 5
EllipseFill 320, 240, 320 - i%, 240 - i% * .75, _RGBA32(0, 0, 0, 10)
NEXT i%
PCOPY 0, 1
x = 200: y = 200
DO
PCOPY 1, 0
k = _KEYHIT
SELECT CASE k
CASE ASC("A"), ASC("a"): x = x - 3
CASE ASC("S"), ASC("s"): y = y + 3
CASE ASC("D"), ASC("d"): x = x + 3
CASE ASC("W"), ASC("w"): y = y - 3
END SELECT
IF x < 0 THEN x = 0
IF y > _HEIGHT THEN y = _HEIGHT
IF y < 0 THEN y = 0
IF x > _WIDTH THEN x = _WIDTH
FOR i% = 0 TO 100 STEP 5 'moveable flashlight
EllipseFill x, y, 100 - i%, 100 - i%, _RGBA32(105, 105, 0, 10)
NEXT i%
_DISPLAY
LOOP UNTIL k = 27
SLEEP
SUB EllipseFill (CX AS INTEGER, CY AS INTEGER, a AS INTEGER, b AS INTEGER, C AS _UNSIGNED LONG)
' CX = center x coordinate
' CY = center y coordinate
' a = semimajor axis
' b = semiminor axis
' C = fill color
IF a = 0 OR b = 0 THEN EXIT SUB
DIM h2 AS _INTEGER64
DIM w2 AS _INTEGER64
DIM h2w2 AS _INTEGER64
DIM x AS INTEGER
DIM y AS INTEGER
w2 = a * a
h2 = b * b
h2w2 = h2 * w2
LINE (CX - a, CY)-(CX + a, CY), C, BF
DO WHILE y < b
y = y + 1
x = SQR((h2w2 - y * y * w2) \ h2)
LINE (CX - x, CY + y)-(CX + x, CY + y), C, BF
LINE (CX - x, CY - y)-(CX + x, CY - y), C, BF
LOOP
END SUB
What the flashlight found:
Thats really cool Bplus! I might use that somewhere as a secret or something! :D