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.

DarkBASIC Discussion / bouncing ball

Author
Message
HomerS
17
Years of Service
User Offline
Joined: 8th Apr 2007
Location:
Posted: 22nd Oct 2014 21:18
Hi all,

How is life in the classic dark basic?

I made some code for a random bouncing ball.



It looks like it flickers. Is there something to do about that?

With div studio (old basic program) i could use a double buffer. I don't know if that is possible in dbc (i can't find it in the help-files)?

Greetings!

Toedeledoki
Latch
17
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 23rd Oct 2014 01:25 Edited at: 23rd Oct 2014 08:36
I don't believe what you are seeing is a flicker but more likely a slow enough refresh rate on your monitor that you can see the ball's last position fading out after it's new position is drawn. You are using a sprite so it's not subject to the cls command. The faster the ball, the easier it is to see the last and current positions at the same time. I've noticed this effect more with LCD/LED type monitors than the old CRT monitors.

Double buffer? Well there are settings in the setup.ini that has some control over the 2d drawing; but you can also use an offscreen bitmap to draw what you want then transfer it to bitmap 0 (creating your own drawing buffer).

for example:



Enjoy your day.

Login to post a reply

Server time is: 2024-04-20 10:50:39
Your offset time is: 2024-04-20 10:50:39