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 Discussion / Text in a 3d game

Author
Message
Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 15th Nov 2002 06:01
Yes, I made a simple program below, Everything is coo, but I want the Y position of the rocket to be printed to the screen. How do I do this? Here is my code;



Rem this will show you how to load a 3ds model rocket and make it move up
rem on its own. The rocket will then dissapear at a certain height
rem this will also show you how to use the PITCH UP COMMAND

sync on
sync rate 30
make matrix 1,1000,1000,10,10
randomize matrix 1,20

load bitmap "rock059.bmp",1
get image 1,0,0,28,28
prepare matrix texture 1,1,2,2
load object "rocket.3ds",1
y#= 1
A$= "30"



do
rem make the rocket move upwards on its own
y#= y#+0.2

position object 1,0,y#,0
rem now we will make the rocket dissapear if it is to high!!
if object position y(1)>100 then hide object 1

if upkey()=1 then pitch camera down 1.6
if downkey()=1 then pitch camera up 1.6
if rightkey()=1 then turn camera right +2
if leftkey()=1 then turn camera left +2
sync
loop
indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 15th Nov 2002 06:04
for any variables that are not a string

convert them to a string and place them in a text command

text 10,10,"moo"
text 10,30,mystring$
text 10,50,STR$(myinteger)
text 10,70,STR$(myfloat#)



in your instance do this
text 10,10,STR$(y#)

Jigga
21
Years of Service
User Offline
Joined: 13th Nov 2002
Location:
Posted: 15th Nov 2002 15:35
okay, but the height of my rocket is still not on the screen!!. Where in my code do I put text 10,10,STR$(y#) ;?
I see my rocket flying up, but see no text.

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 15th Nov 2002 17:21
in main loop
best at end just before sync

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 15th Nov 2002 17:22
you may need to add a ink rgb(255,255,255),1
before the do statement also

TheNVS
21
Years of Service
User Offline
Joined: 25th Oct 2002
Location: United States
Posted: 16th Nov 2002 00:19
all you have to do is this.
do
ship#-object position y(1)
set cursor 0,0
print ship#
sync
loop
if you have a problem with this, i would like to know.

indi
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Earth, Brisbane, Australia
Posted: 16th Nov 2002 03:21
print is an alternative command that works also.
Some people say its slower and is a little limited
than using the text commands, hence u cant set the font size
and font type.

John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Nov 2002 05:10
If you want the text to show- make it a sprite

RPGamer

Final Fantasy, best series ever made.
John H
Retired Moderator
21
Years of Service
User Offline
Joined: 14th Oct 2002
Location: Burlington, VT
Posted: 16th Nov 2002 05:11
PS- I was having this prob too- displaying text from my arrays for my battle system for my RPG Going good so far! If you need help making text an array, its like mostly making bitmaps, get image, and then sprite.

RPGamer

Final Fantasy, best series ever made.

Login to post a reply

Server time is: 2024-03-29 10:07:04
Your offset time is: 2024-03-29 10:07:04