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 / backround problem

Author
Message
Stefan p
15
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 7th Dec 2008 00:04 Edited at: 7th Dec 2008 00:06

ok running this gives me a blinking screen. its blue and has these falshing lines.
media included. Media copyrighted to me
if you can improve always happy to learn.
exe included

I was here.

Attachments

Login to view attachments
Stefan p
15
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 7th Dec 2008 00:07
second media

I was here.

Attachments

Login to view attachments
Stefan p
15
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 7th Dec 2008 00:07
thrid

I was here.

Attachments

Login to view attachments
Stefan p
15
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 7th Dec 2008 00:12
exe/all

I was here.

Attachments

Login to view attachments
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 7th Dec 2008 02:36 Edited at: 7th Dec 2008 02:38
I will have to play with the code when I get home (in about 45 minutes). I can tell you why it's happening. Basically the backdrop is kicking on when you create 3d objects (which includes sprites, as dbpro uses 3d plains to create 2d sprites). It's 9the backdrop's) default color is blue. You can try coloring the backdrop to that of the background (ie. black) by using color backdrop rgb(0,0,0). Try to see if that helps.

If not you can try turning the backdrop off. Though in order for the backdrop to 'stay off' you would have to replace the sprite commands with either paste sprite, or move sprite. As the sprite command is actually 'creating' the sprite, and will kick the backdrop on.

The final reason for the flickering is the multiple syncs throughout the loop. It's best to have one and only one sync at the end, but I know that it can cause problem with print statements. Usually print statements force you to use multiple syncs or else they don't show up. So I will have to play with the code a bit, to try to get things in a better order if possible.


~Zenassem
zenassem
21
Years of Service
User Offline
Joined: 10th Mar 2003
Location: Long Island, NY
Posted: 7th Dec 2008 03:34 Edited at: 7th Dec 2008 03:37
Here's the fixed code. Basically I added the color backdrop rgb(0,0,0) and got rid of a few unecessary syncs. I also moved the cls to the beginning of the loop.



There are still 2 other problems that need to be addressed. One is the repeat... until loop in your firing code. By coding it inside it's own loop you are stalling the main loop from running. Meaning that when you fire a bullet, no other action/processing takes place until the bullet reaches it's limit. You have to take that loop out of the mix, and just keep track of variable values to position the bullet during each pass through the main loop. Then reset the position. I'll code something up for you

Second issue has to do with rotation of the sprite. I haven't looked at the code for that part yet, but it causes the program to crash.


~Zenassem
Stefan p
15
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 7th Dec 2008 15:44 Edited at: 7th Dec 2008 15:48
thank you and i fixed up the shooting as best as i could. the repeat until was only a temp solution for me but thanks for helping. A problem is (with old code) i couldnt move the sprite forward with move sprite command.

edit: Flashing stopped yay. it was starting to give me a head ache. thanks and see if you understand the move sprite command.

I was here.
Stefan p
15
Years of Service
User Offline
Joined: 2nd Nov 2008
Location: Online
Posted: 7th Dec 2008 15:55 Edited at: 8th Dec 2008 21:38
edit1: un code

I was here.

Login to post a reply

Server time is: 2024-09-27 22:34:40
Your offset time is: 2024-09-27 22:34:40