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 Professional Discussion / Blinking text and image

Author
Message
Gurology
User Offline
Joined: 14th Mar 2018
Location:
Posted: 19th Mar 2018 08:57
When I compile, there is ever so slightly off a blink every now and then with all the text. But once the selection for "1. Cloud" is made, the picture goes haywire again. I've tried turning sync off and it's not working. Any suggestions? Thanks!


LOAD IMAGE "Cloud.jpg",1
cls
sync off
PASTE IMAGE 1,3,3
endif
REM Place Stats
wait key
end
Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 19th Mar 2018 13:11 Edited at: 19th Mar 2018 13:13
Try something like this...

Gurology
User Offline
Joined: 14th Mar 2018
Location:
Posted: 19th Mar 2018 15:26
So, your code definitely arranged things more logically. Now I'm having a problem closing 'nest'.. also, my text is still blinking.. check this out..

Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 00:28 Edited at: 20th Mar 2018 00:57
You need more "endif"s



You start another "if" with the "else if" but you don't end it properly...look at my next post for a better solution using select/case
Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 00:48
You could also get rid of all the if/elses with select/case command



I'm not going to code your game for you But you need a lot of work on this...

First thing I would recommend is for you to look into "functions" and/or "gosub"

You're not going to get far doing all your code "top down" like you have been doing
Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 01:09
I'd also suggest you start small with maybe 2 characters instead of 12 or 13.

You'll be re-doing your code many times before you get the hang of it.

So having only 2 chars will help you out as you learn.
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 20th Mar 2018 01:11 Edited at: 20th Mar 2018 01:23
@Zep; Does that redundant sync really stop the flickering. The reason I ask is because, other then early versions of 9Ex, I have never experienced this problem. I have used such code from WindowsXP to 10, without flicker. I seen a awful lot of post on the subject but, I have never heard if it actually worked. Some of the code I have seen supposed to remedy this, doesn't seem to relate. This isn't tested but, I would say check your graphics card settings. Buffering should be set to application controlled.

@Gurology: DarkBasic Professional has two modes, Synchronous and A-Synchronous. DB has certain functions that are designed for one or the other. Your code so far does not require turning sync on. Remember there are functions to turn sync or the backdrop off as well as on. Personally I turn sync on only when its needed.

DBPro don't have elseif. Your code is not frame rate dependent yet. So, you should use select case instead.

Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 01:16
Quote: "@Zep; Does that redundant sync really stop the flickering. The reason I ask is because, other then early versions of 9Ex, I have never experienced this problem. I "


I have no idea, I don't have any text flickering with or without the extra sync. I threw it in just in case.
Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 01:35
After removing all the sync related commands, removing the do/loop and adding a "wait key" at the end of the code

I still have no text flickering.

I suspect an older version of DBPRO he may be using.
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 20th Mar 2018 02:03
Quote: "I suspect an older version of DBPRO he may be using."


Must be a really old version. I have been here awhile and have been through many updates and have never experienced this.
Gurology
User Offline
Joined: 14th Mar 2018
Location:
Posted: 20th Mar 2018 02:04
I'm using version 1.071. I will try a few remedies and let you guys know how it turns out. I built a similar battle system using visual basic, so i decided to expand in darkbasic. learning new commands is obviously a weak point, but logic, not so much. thank you guys for all your help.
Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 02:09
Quote: "Must be a really old version. I have been here awhile and have been through many updates and have never experienced this.
"


Does the text flicker for you? I've stared at the screen for a solid 10 minutes in both windowed and fullscreen. No hint of a flicker at all.
WickedX
9
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 20th Mar 2018 02:41
No flicker at all, ever. Except for the early versions of 9Ex.

@Gurology; Best of luck.
Zep
16
Years of Service
User Offline
Joined: 31st Aug 2002
Location: From PA, USA. Currently reside in Hanoi, Vietnam
Posted: 20th Mar 2018 02:54
Quote: "I'm using version 1.071"


Do you mean 1.0761? (That's the latest version)

Login to post a reply

Server time is: 2018-10-19 04:45:46
Your offset time is: 2018-10-19 04:45:46