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 / data tutorials

Author
Message
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 14th Aug 2007 04:07
hey... i'm looking for a tutorial on using 3D data to build a level so that the level looks like this:

1=wall
2=key
3=locked door
4=point
5=finish mark
9=player

plz help...

Why do they turn against me? Especially when i need them the most?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 14th Aug 2007 21:36
This isn't too hard to do.

Firstly you don't want to have your player as part of your world, because he isn't.


Make an array to store this data in

Then you need to read the data into your array, I will leave this part to you, but ask if you want me to explain.

Now that you have your world stored in an array you need a way to display it. You need to create different 3D objects for all the things in your world. I would keep everything as primitives now, you can always change it later. This can be written at the beginning of the program (or better yet in a gosub at the end).
Again, ask you want any pointers.

To display the world you need to scale up your world to the size of your objects. You use their positions in the array to position them on screen.
Try making one without the doors first. What are the "points"?

Your signature has been erased by a mod because it was rubbish.
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 15th Aug 2007 06:53
how do i get it to recognize the data 4 each object/number?

Why do they turn against me? Especially when i need them the most?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Aug 2007 12:48
something like this


Your signature has been erased by a mod because it was rubbish.
hpfan273
18
Years of Service
User Offline
Joined: 19th Jan 2007
Location:
Posted: 15th Aug 2007 20:42
ahhhhh.. ok... thanx... but then... the data... do i do something like this:


Why do they turn against me? Especially when i need them the most?
Libervurto
18
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 15th Aug 2007 21:17 Edited at: 15th Aug 2007 21:30
I see what you're doing but no that's not the right way.
Your array is fine there's no need to alter it, you just need to scale up (multiply) the values when you are displaying.
e.g.

Remember that a 3D floor uses the X and Z axis not Y. It makes no difference to the code as they are just variable names, but it could be confusing.

Your method of assigning values to your array would have returned an error. You should be assigning one value to one position in the array.
Think of an array as a filing cabinet.

Each drawer holds the same amount of files.
By entering

I am storing the number 2 in file number 3 of drawer number 0.

here is your array

Your array is being used to make a grid: each draw is a row on your grid, and each file is a square on that row.
So when you assign a value to your array, you are assigning the value to the box at the co-ordinates you have specified.

Your signature has been erased by a mod because it was rubbish.

Login to post a reply

Server time is: 2025-05-30 13:32:30
Your offset time is: 2025-05-30 13:32:30