Hello, folks!
I know I'm not known for my programming skills, but I LOVE DarkBASIC Professional and what it allows me to do.
As you know, Procedural Content Generation is the future of game programming, because it allows a huge amount of content to be created without human interference, what saves a lot of programming time and lets the programmer free to spend that time in game design itself.
One of the hardest things - in my humble opinion - is to generate graphic elements that are interesting enough to resemble hand-made ones.
This is another approach to procedural texturing for retrogame - those with strong pixel-art involved, that doesn't need to be realistic but need to be colorful and varied enough to be useful.
This is a small texture catalogue (with 9 quintillion procedural textures prepared to show you the potential of DBPro in generating stuff by itself with almost no coding and nothing too complicated, accessible to noobs and veterans).
sync on
sync rate 60
seed as double integer
set text size 100
maximize window
set window layout 0,0,0
set display mode 1366,768,32
do
randomize seed
n = 1
if image exist(n) = 1 then delete image n
w = 2 ^ (rnd(4) + 4)
h = 2 ^ (rnd(4) + 4)
create bitmap n,w+1,h+1
cls rgb(rnd(254)+1,rnd(254)+1,rnd(254)+1)
lock pixels
x = floor(w/2)
y = floor(h/2)
for l = 1 to rnd(8)+2
c = rgb(rnd(254)+1,rnd(254)+1,rnd(254)+1)
dx = rnd(w-1)+1
dy = rnd(h-1)+1
expo = rnd(4)+5
ptnx = rnd(4)+1
ptny = rnd(4)+1
for s = 1 to 2^expo
dot4way(x,y,dx,dy,c,ptnx,ptny)
vx = rnd(1)-rnd(1)
vy = rnd(1)-rnd(1)
dx = wrap(dx+vx,0,w/2)
dy = wrap(dy+vy,0,h/2)
next
next
unlock pixels
get image n,0,0,w+1,h+1,1
delete bitmap n
if sprite exist(n) = 1 then delete sprite n
sprite n,0,0,n
set sprite n,1,1
size sprite n,1366,768
u = rnd(3)+1
v = rnd(3)+1
sst(n,u,v)
inc seed,upkey()
dec seed,downkey()
seed = wrap(seed,1,9000000000000000000)
repeat : text 0,0,str$(seed) : sync : until upkey() = 1 or downkey() = 1
loop
function dot4way(x,y,dx,dy,color,ptnx,ptny)
stepx = (dx*2)/ptnx
stepy = (dy*2)/ptny
for nx = x - dx to x + dx step stepx
for ny = y - dy to y + dy step stepy
dot nx,ny,color
next
NEXT
ENDFUNCTION
function sst(n,u,v)
set sprite texture coord n,0,0,0
set sprite texture coord n,1,0,v
set sprite texture coord n,2,u,0
set sprite texture coord n,3,u,v
ENDFUNCTION
What it does is to generate textures into a sprite and paste it to screen - you can get some good wallpapers among the zillions of pictures it generates. Use the arrow keys to cycle through the catalogue and feel free to modify and use it at will.
Hope you find it useful or, at least, inspiring.
[size=+2]Forever and one[/size]