News:

Building a 3D Ray Tracer  By stevmjon

Main Menu

Screen Havoc

Started by geecee, April 18, 2009, 04:12:36 AM

Previous topic - Next topic

geecee

Hi there!

Here's a little programme that plays havoc with your screen.

PlayBASIC Code: [Select]
; PROJECT : Screen Havoc
; AUTHOR : geecee
; CREATED : 18/04/2009
; EDITED : 18/04/2009
; ---------------------------------------------------------------------
rem Open an 800x by 600y screen in 16bit mode (windowed)
OpenScreen 800,600,16,1

rem This command will hide the mouse pointer
mouse off

rem Programme main loop
do
c=rnd(255)
ink rgb(c,c,c)
y=rnd(600)
line 0,y,800,y
for i=1 to 500
dot rnd(800),rnd(600)
next i
ink rgb(rnd(255),rnd(255),rnd(255))
for i=1 to 50
dot rnd(800),rnd(600)
next i
x=rnd(800)
y=rnd(600)
ink rgb(0,0,0)
box x,y,x+20,y+1,1
sync
loop

end



:D
Enjoy
geecee
LANG MEY YER LUM REEK

A smile costs less than electricity and gives more light :)

kevin

#1
  A little tip,  if you're going to plot lots dots to video memory (ie the screen)  then don't forget to enable Manual buffer locking

 see -> Locking / Unlocking Buffers - Where and When

PlayBASIC Code: [Select]
rem This command will hide the mouse pointer
mouse off

rem Programme main loop
do
c=rnd(255)
ink rgb(c,c,c)
y=rnd(600)

lockbuffer
line 0,y,800,y
for i=1 to 500
dot rnd(800),rnd(600)
next i

ink RndRGB()
for i=1 to 50
dot rnd(800),rnd(600)
next i
unlockbuffer

x=rnd(800)
y=rnd(600)
boxc x,y,x+20,y+1,1,rgb(0,0,0)

sync
loop




geecee

Thanks for your reply kevin.

I was unaware of that ...... There's such a lot in the documentation to read and try to understand and remember.

:)
geecee
LANG MEY YER LUM REEK

A smile costs less than electricity and gives more light :)