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 / Can someone tell me why my screen is black?

Author
Message
OneShot
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 14th Jun 2007 06:33 Edited at: 14th Jun 2007 06:54
I am really sorry..this is SUPER nooby. But im trying to get the basics down. If I keep copying off of guides I will never get it. For some reason...when I run this its black I don't see anything. I know im missing something, if you would be kind enough to help me out with my code! Please?




*UPDATE* Part of the code was left out...so I updated it !

Just started! Help!!!!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2007 07:23
There is a lot more involved to what you eventually want to do with the player and the camera, however its probably best to learn some parts first before trying to move on.

I rewrote your code as an example to show you, the clearer its laid out, the easier it will be to see the problems at hand, use the arrow keys to move your players ball around, as you can see the camera does not turn with the player etc.

I would do TDKS tutorials before trying to do anymore with this project, get to know the language first, the more commands you understand the better it will be to solve problems int he future.

Anyway I have tried to structure your code so its easier to manage.

Practice using arrays and explore types, they will allow you to manage a lot of data much easier.

Notice also in this example Im using integer based variables to control your 3d media numbers, this will follow on in practice when you get to types etc..




OneShot
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 14th Jun 2007 07:36
Wow...that layout you have is amazing...I have been working on these codes for weeks. I just thought I would give me self a quiz and see how far I could get w/o refference. Otherwise..I will be looking off tutorials for the rest of my life! Excuse my newbieness if you will

Just started! Help!!!!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2007 07:41
I wouldnt say the layout is amazing, however as you code more you will develop your own layout.
The neater it is the better it will be to read later on.

if that was a self quiz, you got some right and some wrong, however mistakes breeds success so keep at it.


OneShot
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 14th Jun 2007 07:41 Edited at: 14th Jun 2007 07:42
BTW I just noticed...whenever I load image ground.bmp my screen goes black when I execute the code! Why does it do this?

Just started! Help!!!!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2007 07:54
I can assume your using DARKBASIC PRO.

You need to create a MASTER folder for your game development.
You need to save the source file [DBA]
as well as the project file [DBPRO] into this folder.
Make sure as well on the right hand side in the options window
that your exe will be created in the same folder.
rename it to something like game.exe and resave your project file.


To be tidy, create another folder in your master folder and call it media.

Your texture should be square 32 x 32 64 x 64 etc , but it doesnt have to be in all cases.

To load it from here you would need to feed it the correct path

media/texturename.bmp


However the reason why your code is going black is to do with your sync off command

remove it all together, and right up the top like i have done in my example
set up your sync

sync on : sync rate 60
I set my demos to 60 frames a second.
now your world wont appear to be so black.

indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2007 08:20
just to make it clearer as well.
here is a snippet showing you that a texture works as described with the snyc


OneShot
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 14th Jun 2007 08:20
Could you just give me a quick refresh on a good process on texturing an object?

Just started! Help!!!!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2007 08:43 Edited at: 14th Jun 2007 08:45
sticking with the last example, this is a simple method of loading a texture and applying it to a standard primitive, then rotating it on the screen.




or we could generate a texture with code and grab it as an image.



if something requires a lot of complexity you will need to explore making a UV map from a 3d package.

OneShot
17
Years of Service
User Offline
Joined: 18th Jan 2007
Location:
Posted: 14th Jun 2007 08:49
Oh wow...I like the second way. That can get really complicated...i've never really understood on how to generated images in the code

Just started! Help!!!!
indi
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 14th Jun 2007 08:58
keep practicing and making examples of the commands for yourself.
you will get the hang of it.

Login to post a reply

Server time is: 2024-11-25 17:25:41
Your offset time is: 2024-11-25 17:25:41