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 / Jeez, this thing flickers!

Author
Message
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 11th May 2009 10:04
I'm not sure what I'm doing wrong. For the moment I'm just experimenting with code so when I finally decide to make a game I know what I'm doing. Well, I've figured out how to put something on the screen and make it move, but it's flickering a lot. Any way to get rid of this?


Oh... and here's the code for the thing.

Attachments

Login to view attachments
bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 11th May 2009 16:22 Edited at: 11th May 2009 16:23
maybe put a sync rate 60 somewhere, not sure if that helps, but its worth a try
btw maybe you can post the media to, else we can+t see whats teh problem

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
KISTech
16
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 11th May 2009 17:55
You've got sync rate 60.

Paste image is likely to be the culprit.

Make a plain (properly spelled plane, but whatever) and texture it with your background image. Then use sprites for the images that are supposed to move. That should clear it up.

bobbel
15
Years of Service
User Offline
Joined: 5th Jan 2009
Location: In my DBPro case xD
Posted: 11th May 2009 18:10
oops, sorry
no, then i have no idea

(\__/)
(O.o )
(> < ) This is Bunny. Copy Bunny into your signature to help him on his way to world domination!
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 11th May 2009 18:52 Edited at: 12th May 2009 05:58
Runs without flickering for me? Did I miss something here? Paste image has never produced flickering for me? Maybe flickering only shows on certain/older gfx cards? I thought perhaps the OP was refering to the scrolling image flicking to its start point as opposed to smoothly scrolling back on from the top, ie line 57 changed to y=-600.
Couple things I noticed, you don`t need to unlock any pixels as they were never locked, so that line isn`t needed. All those bitmap commands aren`t needed either as they do nothing.

Edit: lol, its not line 57, as there were no images to use I just used ones at hand - it was 600 pixels high hence why I thought the "flicking" was this!
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 12th May 2009 01:38
I was just experimenting and forgot to remove that line since it didn't do anything. Here's the entire folder, media and all.

I plan on having the background scroll (I may use two or more). Nice way to add nebulas and stuff. But first I want to learn all the basics.

Attachments

Login to view attachments
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 12th May 2009 04:11
Ok I still don`t see any flickering, but I noticed the movement is jumpy - is that what you meant?
If so try this

(make sure your project settings are not set to run in fullscreen exclusive mode)
*note the sync rate is not set but instead the vsync flag is added to set display mode.
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 12th May 2009 04:40
It is that jumping that bothers me. I tried to set that vsync flag, but I get an error "Set Disply Mode does not match 'Width, Height, Depth' at line 15. I'm currently looking up other commands that could help (forgot to take out that Unlock Pixels command last time I posted, though...)
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 12th May 2009 04:47 Edited at: 12th May 2009 06:05
What version of dbp do you have installed(in the menu select "about" under "help")? I think vsync may have been introduced in a later update.

Edit: btw there is a reason for not using fullscreen which I shall explain when you get the previous snippet to work.

Edit2: Actually I`ll explain now as I`m about to goto bed, didn`t realise it was so late.
You will note that graphically the ship sprite is now flickering. In my graphics card settings if I set the quality to performance, no matter what code I put in fullscreen exclusive mode is awful with controlling the framerate smoothly, even timer based movement does not help much. However, if the graphics quality settings are on quality as opposed to performance, then its not an issue anymore. Now this could just be my card(nvidia 8800GT), so run the following code twice, once with your graphics settings on best quality and once on lowest quality and see if there is a difference in the behaviour of the refresh rate.


Edit3: You can rem out any of the lines 15 - 19 and test under the same conditions re graphics card performance/quality settings() and the use of fullscreen exlusive mode setting in the project(on the left panel in the new editor, on the right panel in old editor).
If I have this right you should find some really odd behaviour in some cases of the tests.
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 12th May 2009 05:38
That would be version 1.054. I only got DBPro a few weeks ago so I'm sure it's the latest one. The previous snippet does work, though I had to remove that one value from the set display mode command and add that sync rate line back into the program.

I downloaded the demo for SCARS (somewhere on the boards) and the ship also jumps in that program. Maybe it's something in DBPro itself?
James H
17
Years of Service
User Offline
Joined: 21st Apr 2007
Location: St Helens
Posted: 12th May 2009 05:46
No - you don`t have the latest version. Goto the home page, select the darkbasicpro product from the top menu and then hover the mouse over download in the left hand menu and select upgrades. Just download the latest one, the upgrade also includes the latest dbp editor. Once your done it should run fine. In the meantime the SCARS demo might run better if you set you graphics card settings to highest quality.
I edited my last post just after you posted it would seem, so have a read through it again once you have the upgrade sorted and the first snippet works.
Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 12th May 2009 06:27
Well, that worked. The update was all I needed for the original program, though I'm going to study your snippet to see how I can improve my coding. Thanks again for the assist!
Not_Maindric
17
Years of Service
User Offline
Joined: 10th Jul 2007
Location: Omaha, NE
Posted: 13th May 2009 02:45


Just an FYI, is should be like that. ^^^

Exit will just make it leave the If statement, kinda useless seeing as it would do that anyways. End will stop the program.

Lonnehart
15
Years of Service
User Offline
Joined: 17th Apr 2009
Location:
Posted: 13th May 2009 11:43
Heh... I should've noticed that. Thanks!

Login to post a reply

Server time is: 2024-11-24 06:40:39
Your offset time is: 2024-11-24 06:40:39