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 / sync problems

Author
Message
Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 10th Aug 2011 12:37
My problems with this are two-fold and I believe they are sync related, although I am not positive.
First my animated sprite won't animate.
Second only parts of my text show up on the screen for more than a flash. I am combining the text and animated sprites with a 3d environment. For some reason putting certain segments of text in a function make it not appear, but it can work properly in a subroutine.
This example only allows the menu text to appear even in a subroutine, the additional text just vanishes. Also the animated sprite won't animate.



Am I doing something terribly wrong or what?

"So it goes."
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 10th Aug 2011 18:10
Without seeing the rest of the code and media I'm not sure about the text problem. The PLAY SPRITE command needs to be seen more than once to work properly... try putting it within the WHILE/ENDWHILE. And is that a pause for 10 seconds?

Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 11th Aug 2011 01:28
Ok, I moved the play sprite command withing the while/endwhile as you suggested and it fixed the animation problem. No the pause doesn't last for 10 seconds, its over in a fraction of a second. Here is a zipped file with all the media and the current version of the code.

"So it goes."
Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 11th Aug 2011 01:39
Ok, I moved the play sprite command withing the while/endwhile as you suggested and it fixed the animation problem. No the pause doesn\'t last for 10 seconds, its over in a fraction of a second. Here is a zipped file with all the media and the current version of the code.

sorry for posting this twice, the file was too large and I had to remove some media and modify the code to allow the difference.

"So it goes."

Attachments

Login to view attachments
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 11th Aug 2011 20:50
With SYNC ON you have to SYNC every time you want to update the screen (like while waiting for the user to hit a key). Without SYNC you won't see any changes to the screen.

The pause routine you have a FOR/NEXT loop as a delay. That kind of delay varies according to each persons computer... whats decent on your computer may be too fast or too slow on somebody elses computer. It's better to use the TIMER() command so you can use a constant timed delay in specific milliseconds. With TIMER() 1000 = 1 second. Alternatively you can use the WAIT command and do exactly the same thing in a single command rather than using that function.



Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 12th Aug 2011 03:10
thank you for your assistance. I can get the text to show up by syncing in the functions now, but still cannot when there is an input command. It seems to make all of the previous text vanish. Is there a way around this?

"So it goes."
Grog Grueslayer
Valued Member
19
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 12th Aug 2011 06:41
Np.

The INPUT command freezes all action till the user hits the enter key. So when you have SYNC ON it's impossible to SYNC while the INPUT command is running.

The ENTRY$() command allows you to do other things while getting input from the user. Because this is a command that gets input all the time we use CLEAR ENTRY BUFFER to make sure nothing from any other keypresses earlier in the code are counted in the text from the user.



Jaded Gamer
18
Years of Service
User Offline
Joined: 19th Apr 2006
Location: Iceland
Posted: 12th Aug 2011 10:30
Wow, thank you very much for all your help!
This was a major stumbling block for me.

"So it goes."

Login to post a reply

Server time is: 2024-11-24 02:54:30
Your offset time is: 2024-11-24 02:54:30