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.

Newcomers DBPro Corner / What do I do about sprite flickering? Oh... and a question about arrays...

Author
Message
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 22nd May 2011 13:11
So I'm experimenting with sprites right now and I've noticed an odd problem... The sprite flickers occasionally. This seems to happen when I have the thing moving diagonally. Any way to take care of this? I've attached the executable for it, and here's the code.



Also, I know that arrays are global. If I create an array of UDTs, can I pass just one varialbe of that UDT within the array element? Let's say I create a UDT array each with a name, date, and age. Can I pass just the name, date, or age to a function?

Attachments

Login to view attachments
Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 22nd May 2011 16:15
Hi, not at my computer at the moment so I'm going to keep this short.

1. To solve the flicker problem try adding an extra ',1' to the 'set display mode' command at the top of your program.

2. I don't see why not, it would be like yourfunction( udtarray(1).element). If you want all of the .elements of the array to be passed through the function then just use a for loop.

Hope these are the answers to your questions

A clever person solves a problem, a wise person avoids it - Albert Einstein
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 23rd May 2011 07:58
It did help. I had no idea that last "1" you suggested adding had something to do with Vsync.

Hodgey
15
Years of Service
User Offline
Joined: 10th Oct 2009
Location: Australia
Posted: 23rd May 2011 08:58
Quote: "It did help."

Glad it did

Quote: "I had no idea that last "1" you suggested adding had something to do with Vsync."

Yeah, it took me a while to work it out.

A clever person solves a problem, a wise person avoids it - Albert Einstein

Login to post a reply

Server time is: 2024-11-22 22:32:41
Your offset time is: 2024-11-22 22:32:41