Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Summer LASER Challenge
#42
(07-30-2023, 01:02 PM)OldMoses Wrote: I tried a variation on my recent blur on this. Not a laser, but more of a "blaster" bolt thing. I imagine that the addition of Rotozoom and vector tracks would make it possible to orient the shot.

Code: (Select All)
SCREEN _NEWIMAGE(1024, 512, 32)

DIM a%(-8 TO 8)
a%(-8) = 0: a%(-7) = 1: a%(-6) = 2: a%(-5) = 3: a%(-4) = 4: a%(-3) = 5: a%(-2) = 6: a%(-1) = 7
a%(0) = 8
a%(1) = 7: a%(2) = 6: a%(3) = 5: a%(4) = 4: a%(5) = 3: a%(6) = 2: a%(7) = 1: a%(8) = 0

DIM kern%(LBOUND(a%) TO UBOUND(a%), LBOUND(a%) TO UBOUND(a%))
FOR x% = LBOUND(kern%, 1) TO UBOUND(kern%, 1) '                 iterate kernel matrix columns
    FOR y% = LBOUND(kern%, 2) TO UBOUND(kern%, 2) '             iterate kernel matrix rows
        kern%(x%, y%) = a%(x%) * a%(y%) '                       seed the gaussian kernel position
NEXT y%, x%
mult! = 255 / kern%(0, 0) '                                     set a multiplier to prevent alpha bleed through



blasterbolt& = _NEWIMAGE(200, 40, 32)
bloom& = _COPYIMAGE(blasterbolt&)
_DEST blasterbolt&
CLS , &H00000000
c~& = _RGBA32(211, 255, 172, 255)
FOR x% = 20 TO 160
    r = x% / 20
    FCirc x%, 20, r, c~&
NEXT x%
_DEST bloom&

FOR ox% = 0 TO _WIDTH(blasterbolt&) - 1 '
    FOR oy% = 0 TO _HEIGHT(blasterbolt&) - 1 '
        _SOURCE blasterbolt& '                                  source: clear image
        c~& = POINT(ox%, oy%) '                                 get source pixel color at (ox%, oy%)
        _DEST bloom& '                                          destination: blurred receiving image
        FOR x% = LBOUND(kern%, 1) TO UBOUND(kern%, 1) '         apply the alpha matrix around original point
            FOR y% = LBOUND(kern%, 2) TO UBOUND(kern%, 2)
                PSET (ox% + x%, oy% + y%), _RGBA32(_RED32(c~&), _GREEN32(c~&), _BLUE32(c~&), mult! * kern%(x%, y%))
        NEXT y%, x%
NEXT oy%, ox%
_DEST 0 '

hbb& = _COPYIMAGE(bloom&, 33)

DO
    x% = 0
    DO
        CLS
        _PUTIMAGE (x%, 256), hbb&
        x% = x% + 1
        _LIMIT 2000
        _DISPLAY
    LOOP UNTIL x% > 1024
LOOP UNTIL _KEYDOWN(27)

END

SUB FCirc (CX AS LONG, CY AS LONG, RR AS LONG, C AS _UNSIGNED LONG) 'Steve's circle fill
    DIM AS LONG R, RError, X, Y
    R = ABS(RR) '                                               radius value along positive x
    RError = -R '                                               opposite side of circle? negative x
    X = R '                                                     point along positive x position
    Y = 0 '                                                     starting at the equator
    IF R = 0 THEN PSET (CX, CY), C: EXIT SUB '                  zero radius is point, not circle
    LINE (CX - X, CY)-(CX + X, CY), C, BF '                     draw equatorial line
    WHILE X > Y
        RError = RError + Y * 2 + 1
        IF RError >= 0 THEN
            IF X <> Y + 1 THEN
                LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF ' draw line above equator
                LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF ' draw line below equator
            END IF
            X = X - 1
            RError = RError - X * 2
        END IF
        Y = Y + 1
        LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF '         draw line north latitudes
        LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF '         draw line south latitudes
    WEND
END SUB 'FCirc

Yeah if you are redrawing an image over and over no change in size from back to front, just make a sprite to rotozoom for tilt and size. You could make the image by drawing filled circles down a line getting bigger and brighter as you go on transparent background and skip pset stuff. In fact I could have done that with Cloud version, way easier to track, way less junk in the Type.
b = b + ...
Reply


Messages In This Thread
Summer LASER Challenge - by TerryRitchie - 07-15-2023, 07:32 PM
RE: Summer LASER Challenge - by bplus - 07-15-2023, 08:10 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-15-2023, 09:48 PM
RE: Summer LASER Challenge - by justsomeguy - 07-15-2023, 09:27 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-15-2023, 09:49 PM
RE: Summer LASER Challenge - by Dav - 07-15-2023, 11:44 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-16-2023, 01:34 AM
RE: Summer LASER Challenge - by GareBear - 07-15-2023, 11:54 PM
RE: Summer LASER Challenge - by Dav - 07-16-2023, 01:42 AM
RE: Summer LASER Challenge - by TerryRitchie - 07-16-2023, 01:58 AM
RE: Summer LASER Challenge - by bplus - 07-16-2023, 02:34 AM
RE: Summer LASER Challenge - by mnrvovrfc - 07-16-2023, 03:35 AM
RE: Summer LASER Challenge - by bplus - 07-16-2023, 02:21 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-17-2023, 02:12 AM
RE: Summer LASER Challenge - by bplus - 07-17-2023, 02:47 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-17-2023, 02:58 PM
RE: Summer LASER Challenge - by SpriggsySpriggs - 07-17-2023, 03:29 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-17-2023, 04:51 PM
RE: Summer LASER Challenge - by bplus - 07-17-2023, 04:22 PM
RE: Summer LASER Challenge - by TerryRitchie - 07-17-2023, 04:34 PM
RE: Summer LASER Challenge - by bplus - 07-17-2023, 05:00 PM
RE: Summer LASER Challenge - by bplus - 07-17-2023, 06:38 PM
RE: Summer LASER Challenge - by bplus - 07-17-2023, 06:43 PM
RE: Summer LASER Challenge - by bplus - 07-18-2023, 02:58 PM
RE: Summer LASER Challenge - by bplus - 07-19-2023, 01:14 AM
RE: Summer LASER Challenge - by James D Jarvis - 07-20-2023, 02:28 AM
RE: Summer LASER Challenge - by bplus - 07-20-2023, 12:44 PM
RE: Summer LASER Challenge - by Dav - 07-21-2023, 03:00 AM
RE: Summer LASER Challenge - by bplus - 07-21-2023, 03:56 PM
RE: Summer LASER Challenge - by grymmjack - 07-21-2023, 04:46 PM
RE: Summer LASER Challenge - by bplus - 07-21-2023, 04:59 PM
RE: Summer LASER Challenge - by SierraKen - 07-27-2023, 02:38 AM
RE: Summer LASER Challenge - by bplus - 07-27-2023, 01:49 PM
RE: Summer LASER Challenge - by SierraKen - 07-27-2023, 02:41 AM
RE: Summer LASER Challenge - by TerryRitchie - 07-27-2023, 11:56 PM
RE: Summer LASER Challenge - by Dav - 07-28-2023, 12:48 AM
RE: Summer LASER Challenge - by bplus - 07-28-2023, 01:20 PM
RE: Summer LASER Challenge - by dbox - 07-28-2023, 06:56 PM
RE: Summer LASER Challenge - by bplus - 07-28-2023, 09:23 PM
RE: Summer LASER Challenge - by SierraKen - 07-29-2023, 10:13 PM
RE: Summer LASER Challenge - by OldMoses - 07-30-2023, 01:02 PM
RE: Summer LASER Challenge - by bplus - 07-30-2023, 02:28 PM
RE: Summer LASER Challenge - by bplus - 07-30-2023, 06:57 PM



Users browsing this thread: 31 Guest(s)