_Title "Marvin has a ball" ' b+ trans from SdlBasic 2021-09-29 ' needs: Marvin32x48.png y=0 back, y=1 right, y=2 front, y=3 left
x = 0: y = 0: imx = 0: imy = 1: marvinX = 425: marvinY = 352
blt m&
, (marvinX
Mod 4) * 32, imy
* 48, 32, 48, marvinX
, marvinY
drawBall marvinX + 35, 400 - 12, 12, &HFFFF0000
marvinX = marvinX + 1
imy = 3: l = 5
blt m&
, (marvinX
Mod 4) * 32, imy
* 48, 32, 48, marvinX
, marvinY
drawBall marvinX + 130, 275, 125, &HFFFF0000
marvinX = marvinX - 21
l = l + .5
imy
= 2: marvinX
= _Width / 2 - 16: marvinY
= 400: ballY
= marvinY
+ 173 drawBall marvinX + 16, ballY, 125, &HFFFF0000
blt m&
, (marvinY
Mod 4) * 32, imy
* 48, 32, 48, marvinX
, marvinY
marvinY = marvinY - 1
marvinY = -49
ballY = 280: imy = 0
ballY = marvinY + 173
Sub blt
(imageHandle&
, sx
, sy
, sw
, sh
, dx
, dy
) ' for johnno to trans SdlBasic to QB64
f = 1 - rr / r
fcirc x
, y
, rr
, _RGB32(rred
* f
, grn
* f
, blu
* f
)
Radius
= Abs(R
): RadiusError
= -Radius: X
= Radius: Y
= 0 Line (CX
- X
, CY
)-(CX
+ X
, CY
), C
, BF
RadiusError = RadiusError + Y * 2 + 1
Line (CX
- Y
, CY
- X
)-(CX
+ Y
, CY
- X
), C
, BF
Line (CX
- Y
, CY
+ X
)-(CX
+ Y
, CY
+ X
), C
, BF
X = X - 1
RadiusError = RadiusError - X * 2
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