Author Topic: Banana man brot  (Read 1628 times)

B+

  • Guest
Banana man brot
« on: January 24, 2016, 10:19:48 AM »
Time for a banana man!
Code: [Select]
'banana man brot.sdlbas 2016-01-24 [B+=MGA]
xmax=1177:ymax=647
option qbasic
setdisplay(xmax,ymax,32,1)
autoback(-2)
dim mandot[100,70]
ba = loadImage("banana_large.png",1)  '1177x647
text(0,0,16,"one moment please...")
screenSwap
wait(10)
loadman()
direct=1:fade=5
while 1
ink(rgb(255,255,255))
bar(0,0,xmax,ymax)
blt(1,0,0,xmax,ymax,0,0)
if direct<0 then
ts="Inverse Rotation..."
else
ts= "Rotation..."
end if
showman(xmax/2-235,.8*ymax-15)
showmanback(xmax/2+135,.8*ymax-15)
showmandown(-10,0)
text(xmax/2-145,.8*ymax-15,64,time$)
text(445,220,12,ts)
showmanup(450+300*cos(fade),150+150*sin(fade))
fade=fade+.5*direct
if fade>95 then: fade=95:direct=-direct:end if
if fade<5 then: fade=5:direct=-direct:end if
screenswap
wait(120)
wend

sub loadman()
for y=-35 TO 35
for x=-10 TO 89
m=0:r=0
for k=0 TO 111
j=r^2-m^2-2+x/25
m=2*r*m+y/25
r=j
l=andBit(k,15)
if j^2+m^2>11 then: exit for:end if
next
mandot[x+10,y+35]=l
next
next
end sub
sub showman(x,y)
ink(0)
for yy=0 to 70
for xx=0 to 100
if mandot[xx,yy]=15 then
dot(x+xx,y+yy)
end if
next
next
end sub
sub showmanback(x,y)
ink(0)
for yy=0 to 70
for xx=0 to 100
if mandot[xx,yy]=15 then
dot(x+100-xx,y+70-yy)
end if
next
next
end sub
sub showmandown(x,y)
ink(0)
for yy=0 to 70
for xx=0 to 100
if mandot[xx,yy]=15 then
dot(y+70-yy,x+100-xx)
end if
next
next
end sub
sub showmanup(x,y)
ink(0)
for yy=0 to 70
for xx=0 to 100
if mandot[xx,yy]=15 then
dot(x+yy,y+xx)
end if
next
next
end sub