Welcome to the first 20 liner from the Darkforge!
Here we've got a classic demo effect from the yesteryear. I re-created this in DBV1.04 over 2 years ago and here we go again only this time in 16 lines, using types, much smoother and Pro handles twice the number of stars without breaking sweat. That's progress for you!
` =============================================================
` A Screaming Product Of The DARKFORGE (www.darkforge.co.uk) :)
` =============================================================
` Welcome to the first 20-liner entry from the Darkforge!
` We've got 1000 parallax stars on-screen and it's smooth as
` pie on a crumbling P3-450 with 32meg GeForce card.
` This entry is based on my code from April 12th 2000 given the
` DBPro treatment. Only 16 lines of code this time around.
` Enjoy -Rich-
` =============================================================
sync rate 0 : sync on : hide mouse : starcount=1000
type star x y speed endtype
dim stars(starcount) as star
for c=1 to starcount
stars(c).x = rnd(640) : stars(c).y = rnd(480) : stars(c).speed = rnd(5)+1
next c
do
cls 0
for c=1 to starcount
tempx = stars(c).x : inc tempx,stars(c).speed : if tempx > 640 then tempx = 0 : stars(c).y = rnd(480)
stars(c).x = tempx
ink rgb(50*stars(c).speed,50*stars(c).speed,50*stars(c).speed),0
dot stars(c).x, stars(c).y
next c
sync
loop
If anyone needs the code explained just shout!
Cheers,
Rich
"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming