News:

Welcome to RetroCoders Community

Main Menu

freebasic Yin Yang

Started by stigma, Jan 14, 2023, 03:01 PM

Previous topic - Next topic

stigma

Screen 19
Color ,7
Cls

Sub Taijitu(x As Integer, y As Integer, r As Integer)
    Circle(x, y), 2 * r, 0,,,, F
    Line (x, y - 2 * r) - (x, y + 2 * r), 7, B
    Paint (x - r, y), 15, 7
    Circle(x, y - r), r - 1, 15,,,, F
    Circle(x, y + r), r - 1,  0,,,, F
    Circle(x, y - r), r / 3,  0,,,, F
    Circle(x, y + r), r / 3, 15,,,, F
End Sub

Taijitu(110, 110, 45)
Taijitu(500, 300, 138)
sleep

basic coder

Hi! thank for sharing it. I include a "move effect" without flickering screen using SCREENCOPY function.

the current issue is the paint fails when two objects are in same space.

happy coding

Screen 19, , 2
SCREENSET 1, 0 'to activate double-paging

Color ,7
Cls

Sub Taijitu(x As Integer, y As Integer, r As Integer)
    Circle(x, y), 2 * r, 0,,,, F
    Line (x, y - 2 * r) - (x, y + 2 * r), 7, B
    Paint (x - r, y), 15, 7
    Circle(x, y - r), r - 1, 15,,,, F
    Circle(x, y + r), r - 1,  0,,,, F
    Circle(x, y - r), r / 3,  0,,,, F
    Circle(x, y + r), r / 3, 15,,,, F
End Sub



dim x as integer

for x = 1 to 300 step 5
cls
Taijitu(x, 110, 45)
Taijitu(500, x ,138)
SCREENCOPY 
sleep 100

if inkey$<>"" then exit for


next

print "Press any key to close program"
sleep