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 / Maps and Movement

Author
Message
vgking101
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Virginia
Posted: 10th Apr 2005 11:19
Can i have a flattened 3d map and have a 2d character move on it? And how do i make something move across a map instead of the screen?

If i just posted this sorry, i couldn't find it lol.
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 10th Apr 2005 22:47
u have to use 3d objects on 3d maps DB has some models included in the media


hope thats what ur lookin for

kR
Sephnroth
22
Years of Service
User Offline
Joined: 10th Oct 2002
Location: United Kingdom
Posted: 11th Apr 2005 00:47
If I understood you right, you want a top-down 3d world with a 2d character to move around it?

Create a 3d world like you would any other, but obviously without ceilings etc. Then use the camera rotation commands and place the camera above your world, pointing down. (if your map is one big object i THINK theres a command to make the camera look at an object which would center it in the view nicely).

The way to get a 2d character in a 3d world is by making an object called a plane and loading your 2d sprite as a texture and using it to texture the plane. Keep the plane facing the camera at all times. to move it around the world you change its X and Z co-oridinates, NOT x and y like you would a real sprite. Hope thats some help, its been a while since i used dbp

[07:16:59-pm] « Sephnroth » you were dreaming about lee...
[07:17:13-pm] « Mouse » stfu
[07:17:22-pm] « Mouse » he was hanging himself lol
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 11th Apr 2005 02:07
bad idea using a matrix as a top down map as it uses up a lot of memory there are a few examples thati found helpful in the 2d forums for maps but they involve arrays. Have a look

kR
vgking101
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Virginia
Posted: 11th Apr 2005 03:55
Thanks for the help but i dont want it top down. I want it sideways. Its a biking game and i want to see the 2d biker sprite on the 3d world from the side. Is it possible to do hit test things with the sprite and map?
kRx
20
Years of Service
User Offline
Joined: 2nd Apr 2005
Location: Canterbury, Kent, UK
Posted: 11th Apr 2005 06:02
from what im aware 3d objects and 2d objects cant work togather i may be wrong if anyoine whats to question what im saying.. not really sure what to say to help sorry

kR
vgking101
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Virginia
Posted: 11th Apr 2005 06:05
well that's ok. I can use a 2d map.
HWT
20
Years of Service
User Offline
Joined: 1st Apr 2005
Location: Earth
Posted: 11th Apr 2005 08:10
Hi

I'm not exactly sure what you are looking for but I typed out this code that be of some use:

Quote: "Is it possible to do hit test things with the sprite and map? "

In DBC, it's not possible to have 2D sprites collide with 3D. But, instead you can make a 3D object act like (i.e. look like) a 2D sprite.

If you want to know more, please don't hesitate to ask.

Cheers!

HelloWorld Tommorrow
vgking101
20
Years of Service
User Offline
Joined: 10th Apr 2005
Location: Virginia
Posted: 11th Apr 2005 08:29
So:

can i have a biker. 2d
a level, 2d. The level is what the biker will ride across.
A background BEHIND the level for added effect. The level will be scollable.


See attachment.

Attachments

Login to view attachments
NanoBrain
20
Years of Service
User Offline
Joined: 20th Jan 2005
Location: Portland, OR
Posted: 11th Apr 2005 14:41 Edited at: 12th Apr 2005 00:19
vgking101,

You can achieve your goal even with a 3D background. For 3D, use a plane as the image of the biker, changing it's textures as needed, for animation. Create and place a 3D scene around for the camera to see. With this, for scrolling you have the choice of moving the camera and the biker along with it. Or, scrolling just the background and keeping the camera and biker in place, maybe somewhat.

With a 2D background, I suggest using a sprite for the biker image, also changing it's image when needed, for animation. For the background paste an image over and over, changing it's coordinates for a scrolling effect. I'm not sure what friction this would have on the processor.

I truly suggest to go with the plane and a 3D background, because in DarkBasic at least, a sprite simply cannot be rotated.

+NanoBrain+

Login to post a reply

Server time is: 2025-05-23 08:44:08
Your offset time is: 2025-05-23 08:44:08