07-19-2023, 11:53 AM
Silly Tiles...by "roquedrivel"
Code: (Select All)
'by "roquedrivel" 19-July-2023
'silly tiles
var i, p, f, ybot, lchoic
str choic
var sx[80], sy[80], si[80], ss[80]
'initialize
choic = "111111222223334"
lchoic = len(choic) - 1
ybot = 560
'set black window background color
wcolor 0, 0, 0
'initialize tiles
i = 1
label lb01
sx[i] = (i - 1) * 10
sy[i] = ybot
si[i] = 0
ss[i] = 0
i = i + 1
if i < 80 : goto lb01 : endif
'main loop
label mloop
fcolor 142, 180, 230
i = 1
label lb02
'this is in case the programmer wants to change to a diamond or something else
drawfigure()
i = i + 1
if i < 80 : goto lb02 : endif
swap
fcolor 0, 0, 0
i = 1
label lb03
drawfigure()
i = i + 1
if i < 80 : goto lb03 : endif
'choose a tile and how to move it
p = Rand(lchoic) + 1
f = val(mstr(choic, p, 1))
p = Rand(78) + 1
if ss[p] = 0
si[p] = (f * 64 * (Rand(39) + 1)) / 10
ss[p] = 1
endif
'check all tiles to see if they need to be moved
i = 1
label lb04
if ss[i] > 0
sy[i] = sy[i] - si[i]
si[i] = si[i] - 0.1
if si[i] > 0 : si[i] = si[i] - 0.1 : endif
if si[i] > 2 : si[i] = 2 : endif
if sy[i] > ybot
sy[i] = ybot
ss[i] = 0
si[i] = 0
endif
endif
i = i + 1
if i < 80 : goto lb04 : endif
goto mloop
func drawfigure()
line sx[i], sy[i], sx[i] + 9, sy[i]
line sx[i], sy[i] + 1, sx[i] + 9, sy[i] + 1
line sx[i], sy[i] + 2, sx[i] + 9, sy[i] + 2
endfn
micro(A)developer
http://basic4us.epizy.com/forum/index.php
http://basic4us.epizy.com/forum/index.php