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 / Text won't appear?

Author
Message
SkyBox
14
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 30th Apr 2012 20:54
I'm working on an edutianment project for my game design class. It involves asteroids coming at you with random words appearing above each one. You have to type that word to destroy that given asteroid.

When I set the text to be attached to the asteroid (It is not positioned on the screen, but instead moves with the object), it will not appear visible. I have tested the text on smaller programs and it worked fine. It looks like now when I try to work with this, either something is conflicting with it(I get no errors), or they are buried under another layer of graphics.


Here is the part of the code that is important:
Sergey K
22
Years of Service
User Offline
Joined: 4th Jan 2004
Location:
Posted: 1st May 2012 10:46
I see loops, but I don't see Sync command inside it.

try to insert SYNC command inside loop, just before the LOOP command at the do,loop. also add SYNC ON and SYNC RATE 60 at top of your code..

more 3d models .x/.obj and more foramts here:
[href]https://www.turbosquid.com/Search/Index.cfm?keyword=gogetax1&x=0&y=0[href]
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 1st May 2012 13:01 Edited at: 1st May 2012 13:02
I'm not certain if the sleep command would cause any trouble, but you could try...



that should work I think. I'm assuming the text you are talking about is the one before you enter your game loop

The fastfood zombie killer
SkyBox
14
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 1st May 2012 21:06
For basic purposes, the the text "cube" is supposed to appear on all of the asteroids that spawn. I put a sync on and rate inside the main loop, as well as the text code.

Another issue I have discovered, is that it might not appear still because I cannot work with the name of the asteroid.x object, which appears to be number "p" and ranges from 1 to 9. Is there a way to put that in the text code I was talking about? Just saying text center "p" for example, doesn't seem to work.

Here is the asteroid again:
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 3rd May 2012 02:39 Edited at: 3rd May 2012 02:40
if this is the area your talking about:


then you will need to add sync right before the loop command

The fastfood zombie killer
SkyBox
14
Years of Service
User Offline
Joined: 23rd Apr 2012
Location:
Posted: 3rd May 2012 06:20
Still not working. I put the code into a loop with sync right before the loop command. It is not in the main loop, but its own loop above that main loop.

When I load the game, none of the asteroids spawn.
Mychal B
15
Years of Service
User Offline
Joined: 21st Jul 2010
Location: Coos bay, rainville
Posted: 3rd May 2012 13:23
Did the asteroids spawn before, or was it when you added the sync command?

The fastfood zombie killer
Green Gandalf
VIP Member
21
Years of Service
User Offline
Joined: 3rd Jan 2005
Playing: Malevolence:Sword of Ahkranox, Skyrim, Civ6.
Posted: 3rd May 2012 14:06
SkyBox

I think you put the text statement in the wrong place.

Try this which is your code with one important change (plus lots commented out because I don't have the files and I've used spheres instead of planet objects). The important change is that the text command needs to be in the main loop, otherwise the text gets wiped each sync.

If you run this as is you should briefly see "CUBE" attached to a sphere which rapidly moves off screen.



Hope that's what you wanted.

Login to post a reply

Server time is: 2026-07-08 10:38:08
Your offset time is: 2026-07-08 10:38:08