Development goes on. ⚡️👟QB64 v2.0.2 released! 🤩🤩🤩🤩Get it now!
0 Members and 1 Guest are viewing this topic.
Bplus, can you repost the tapeworm example? I think I saw it on [banned user]'s forum or maybe it was on the justbasic forum.
How about a Glowing Tapeworm?Code: QB64: [Select]_TITLE "Glowing Tapeworm" ' 2019-04-05 B_ modified Guts' 2019-04-05 B+ translation to QB64 from: Guts.bas SmallBASIC 0.12.0 2015-11-17 MGA/B+'modified > GUTS Original ARM BBC BASIC version by Jan Vibe, 800x600 ? RANDOMIZE TIMERCONST xmax = 800CONST ymax = 600SCREEN _NEWIMAGE(xmax, ymax, 32)_SCREENMOVE _MIDDLE DIM bX(63), bY(63), bZ(63), COLR(63) AS _UNSIGNED LONGbX(1) = -100: A = 0 ' gut paletteFOR N = 1 TO 63 COLR(64 - N) = _RGB32(1.5 * N + 150, 3 * N + 45, 3 * N + 45)NEXT X1 = RND * xmax: Y1 = RND * ymax: DX1 = (RND * 16 + 1) * (RND - .5): DY1 = (RND * 16 + 1) * (RND - .5)X2 = RND * xmax: Y2 = RND * ymax: DX2 = (RND * 16 + 1) * (RND - .5): DY2 = (RND * 16 + 1) * (RND - .5)WHILE 1 LINE (0, 0)-(xmax, ymax), _RGBA32(0, 0, 0, 15), BF H = X1 + DX1: IF H < 0 OR H > xmax THEN DX1 = (RND * 16 + 1) * -SGN(DX1) H = Y1 + DY1: IF H < 0 OR H > ymax THEN DY1 = (RND * 16 + 1) * -SGN(DY1) X1 = X1 + DX1: Y1 = Y1 + DY1 IF X2 < X1 AND DX2 < 24 THEN DX2 = DX2 + 1 IF X2 > X1 AND DX2 > -24 THEN DX2 = DX2 - 1 IF Y2 < Y1 AND DY2 < 24 THEN DY2 = DY2 + 1 IF Y2 > Y1 AND DY2 > -24 THEN DY2 = DY2 - 1 X2 = X2 + DX2: Y2 = Y2 + DY2: A = (A + 10) MOD 360: Z = (SIN(_D2R(A) + 1)) + 2 FOR N = 1 TO 63 bX(N - 1) = bX(N): bY(N - 1) = bY(N): bZ(N - 1) = bZ(N) NEXT bX(63) = X2: bY(63) = Y2: bZ(63) = Z FOR N = 1 TO 63: fcirc bX(N), bY(N), .6 * N * bZ(N), COLR(N): NEXT _DISPLAY _LIMIT 60WEND 'from Steve Gold standardSUB fcirc (CX AS INTEGER, CY AS INTEGER, R AS INTEGER, C AS _UNSIGNED LONG) DIM Radius AS INTEGER, RadiusError AS INTEGER DIM X AS INTEGER, Y AS INTEGER Radius = ABS(R) RadiusError = -Radius X = Radius Y = 0 IF Radius = 0 THEN PSET (CX, CY), C: EXIT SUB ' Draw the middle span here so we don't draw it twice in the main loop, ' which would be a problem with blending turned on. LINE (CX - X, CY)-(CX + X, CY), C, BF WHILE X > Y RadiusError = RadiusError + Y * 2 + 1 IF RadiusError >= 0 THEN IF X <> Y + 1 THEN LINE (CX - Y, CY - X)-(CX + Y, CY - X), C, BF LINE (CX - Y, CY + X)-(CX + Y, CY + X), C, BF END IF X = X - 1 RadiusError = RadiusError - X * 2 END IF Y = Y + 1 LINE (CX - X, CY - Y)-(CX + X, CY - Y), C, BF LINE (CX - X, CY + Y)-(CX + X, CY + Y), C, BF WENDEND SUB