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.

2D All the way! / Yet more drawing order stuff.

Author
Message
CrayZemon
20
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 9th Jul 2003 22:40
My current 2D project doesn't require parallax scrolling. However, I need a certain drawing order. As I look at designing the particle and explosion system in my game engine I forsee a little problem.

Say an enemy is destroyed and the player zips across the explosion cloud. I want the player to be behind that sprite.

The particle effects in the engine, like explosions, will be pre-drawn. Therefore my question is how do you draw those sprites so that they override all the other sprites in the game. Do you:
1. number then the highest?
2. number them the lowest?
3. Make them first?
4. Make them last?
5. Something else?
6. Is it hopeless?

Thank you in advance for this.
"I need gopher-chucks!!"
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Jul 2003 00:21
SET SPRITE PRIORITY

Higher priority sprites are drawn later (and so on top of) lower priority sprites.
CrayZemon
20
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 10th Jul 2003 02:27
Sorry Ianm, I wish I had DBpro, but I don't. I've had similar problems with this in the past with no avail. Like I said, I'm not doing anything parallax complicated, all I'm trying to do is set up a way to make a limited number of predrawn sprites to be drawn first all the time: kinda set in stone.

"I need gopher-chucks!!"
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 10th Jul 2003 22:32
When you post, please say that you have DBC - it saves time for both of us.

Have a look at underwaredesign.com - kevin has a sprite-priority library there for DBC.
CrayZemon
20
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 11th Jul 2003 19:05
Thanks.

"I need gopher-chucks!!"
CrayZemon
20
Years of Service
User Offline
Joined: 16th Jun 2003
Location: United States
Posted: 11th Jul 2003 20:40
Well, I see the webpage, and I see a rather nifty engine called mappy. The only problem is, if I use it in my code, is that I didn't want the game to be windowed, and I would lose a sense of originality pride within my own code (and the learning experience that comes with generating it all yourself).

I'm beginning to wonder if 2D is really worth it in DBC. I'm not making any conclussions here, but my purpose in messing around in 2D was to develope programming technique and skill, that I lost years ago when I quit programming, before I move to a 3D project. Perhaps I should step down to an even simpiler project.

"I need gopher-chucks!!"
CPU
20
Years of Service
User Offline
Joined: 4th Jul 2003
Location: Carlsbad, CA
Posted: 26th Jul 2003 00:32
there is a way to order sprites, however it requires declaring the sprites in a certen order, the ones that are declared first in the code have the lowest priority and the ones declared last have the most priority ex:
sprite 1,x,y,2
sprite 2,x,y,2
sprite 3,x,y,2
`sprite 3 will have the higest priority, sprite 2 is in the middle
`and sprite 1 has the lowest priority, that's the only way that i
`know of to set sprite priority in DBC

Well i hope someone out there can benifite from this little bit of knowledge

Sparring - Loved by many, Pefected by few.
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 26th Jul 2003 00:49
The best solution with this problem consist in stopping using sprite, i wrote some french tutorials and i can give you the link but they're very old (but they run fast) and i don't code this way animore...

Dri

Pour des yeux déformés la vérité peut porter un visage grimaçant.
CloseToPerfect
21
Years of Service
User Offline
Joined: 20th Dec 2002
Location: United States
Posted: 26th Jul 2003 02:28
http://www.dbcode.underwaredesign.com/
a whole list of thing to make 2d better in dbc
Dr Dri
21
Years of Service
User Offline
Joined: 18th Mar 2003
Location: France
Posted: 26th Jul 2003 14:30
yes you can say "2D"

Dri

Pour des yeux déformés la vérité peut porter un visage grimaçant.

Login to post a reply

Server time is: 2024-03-29 08:39:15
Your offset time is: 2024-03-29 08:39:15