Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / A 20-Line airbrush (DBP)

Author
Message
ESC
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 23rd Feb 2003 00:36
I barely was able to fit this into 20 lines

"That's not a bug, it's a feature!"
"When all else fails, read the instructions"
-ESC
ESC
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 23rd Feb 2003 00:42
That's odd, it didn't seem to work:


sync on:sync rate 0:dim screen(640,480):radius#=20
for y=1 to screen height():for x=1 to screen width()
screen(x,y)=0
next x:next y
do
if upkey()=1 then radius#=radius#+0.01
if downkey()=1 then radius#=radius#-0.01
if mouseclick()=1 then lock pixels:airbrush(radius#):unlock pixels
sync
loop
function airbrush(ra#)
x1=mousex()-(0.5*ra#):z1=mousey()-(0.5*ra#):zam=z1-ra#:xam=x1-ra#:zam2=z1+ra#
xam2=x1+ra#
for z=zam to zam2:for x=xam to xam2
y=ra#^2-((x1-x)^2+(z1-z)^2):y=y/60:y=screen(x,z)+y:if y<screen(x,z) then y=screen(x,z)
if y>255 then y=255
ink rgb(y,0,0),0:if y<>0 then dot x,z
screen(x,z)=y
next x:next z
endfunction

"That's not a bug, it's a feature!"
"When all else fails, read the instructions"
-ESC
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 24th Feb 2003 15:05
lol that's pretty cool!

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
ESC
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 24th Feb 2003 18:42
Thanks

Oh, and up down adjusts the brush size

"That's not a bug, it's a feature!"
"When all else fails, read the instructions"
-ESC
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 25th Feb 2003 00:00
oh... didn't know that lol

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors

Login to post a reply

Server time is: 2024-04-25 13:27:22
Your offset time is: 2024-04-25 13:27:22