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 / sprites and camera?

Author
Message
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 22nd Sep 2004 00:54
is it possible to use sprites and then move the camera? or do I have to move all the sprites individual?
Xander
22
Years of Service
User Offline
Joined: 3rd Mar 2003
Location: In college...yeah!
Posted: 22nd Sep 2004 02:26
All of the sprites will stay in their respective positions on the screen, no matter where the camera is positioned. It is a complete different system. That is why some people use sprites for their HUD. However, I prefer to use locked plains...

Xander Moser - Bolt Software - Firewall
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 22nd Sep 2004 02:53
hmm, ok, no camera then movement, then I have to move the all of the sprites (a lot of sprites, I paste them as floor tiles) I don't think that I can use plains for this game, they usually distorts in size, it has to be pixel perfect sprites.
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 22nd Sep 2004 05:27
i don't quite understand..

but the camera commands are for 3d
2d are straight on the screen

[img src=http://blanky.pt-web.net/ddd.gif] >::p
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 22nd Sep 2004 06:19
yes, as far as I understand, then you can only use the camera for 3D, and when you program sprites you have to move all the sprites (nothing the camera can do in 2D)
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 22nd Sep 2004 08:09
There's a couple of solutions for this,

1. Write your own Move2dCamera() function. The theory behind it is that you take all active sprites and move them opposite what you tell the camera to move. And if you want the camera to zoom in closer to the "ground" then you just make all the sprites bigger and move them away from the center of the screen.

2. Use 3d plains for sprites, Highly Recommended! Mucho faster, plus you get camera functions.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 22nd Sep 2004 23:47
right now, the last sprite loaded is the one that is on top of the others, is there another way to decide which sprite is the top most?
(I want a sprite to be over other sprites)
BearCDPOLD
21
Years of Service
User Offline
Joined: 16th Oct 2003
Location: AZ,USA
Posted: 23rd Sep 2004 11:00
What you want to do is set up a system of layers.

Background
terrain
moving sprites
other

Categorize each of your sprites into these layers, they are drawn in that order so that Background is drawn behind everything, then the terrain (grass, dirt, etc.), then all the moving sprites can be placed, and if you want stuff to be on top of the sprites (like a tunnel or something) use the "other" layer.

Crazy Donut Productions, Current Project: Project Starbuks
Sony stole our name!
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 23rd Sep 2004 17:55
I have discussed this in the 2d topics, and I will just load them in the order they should be (floor tiles first, then the things on top of floor tiles, then player, etc etc)
blanky
20
Years of Service
User Offline
Joined: 3rd Aug 2004
Location: ./
Posted: 30th Sep 2004 03:11
Good idea

Also, if you decide to make some camera functions, make them for both 3d and 2d. That way, you just have to use the once command

[img src=http://blanky.pt-web.net/ddd.gif] >::p
EddieB
20
Years of Service
User Offline
Joined: 29th Sep 2004
Location: United Kingdom
Posted: 30th Sep 2004 03:13
can some 1 help me wit a code

If its not how you do it its the way you do it.
Cybermind
Valued Member
22
Years of Service
User Offline
Joined: 28th Nov 2002
Location: Denmark
Posted: 30th Sep 2004 07:06
I switched to DBPRO trial, and it is going fine

Login to post a reply

Server time is: 2025-05-24 19:50:48
Your offset time is: 2025-05-24 19:50:48