The Dink Network

Fragile graphics

February 9th 2007, 08:11 PM
anon.gif
RadFrog
Ghost They/Them
 
I used a horizontal bridge in my current work, and everything went fine. Today I attempted to put in a vertical bridge and am so frustrated I could - - - well, nevermind that.

The bridge is composed of three sprites; two ends and a middle. When Dink (or the person sprite I placed on that screen) passes over the bridge, in moving from one bridge sprite to the next, they "Fall through". The effect is fine halfway, but as dink moves to the upper end of a given section, the bridge blocks the view of his legs.

I have tried altering the hardbox and depth dot in as many ways as I can think of. Enlarging, reducing and even moving the hardbox off the graphic seems to have no effect. Neither does the placement of the depth dot.

If anyone will throw me a lifeline on this, I will be eternally grateful. I am completely stupified.

Thanks in advance.

RadFrog
February 9th 2007, 08:43 PM
spike.gif
Dinkedit- select bride and press 8. Se depth que to 1.

Windinkedit- right click, properties, set depth que to 1.

Script- sp_que(&current_sprite,1);
February 9th 2007, 08:44 PM
custom_magicman.gif
magicman
Peasant They/Them Netherlands duck
Mmmm, pizza. 
Don't mess with the hardbox and depth dot. Not for this particular problem.

Instead, set the depth-que (I don't know what key combo it is in DinkEdit) to some negative number. Why it happens? Here's an explanation:

The Dink Engine draws sprites with low y-coördinates before those with high-coördinates. The point where Dink's legs suddenly get covered by the bridge is the point where Dink's y-coördinate gets lower than the bridge's y-coördinate. Dink will be drawn before the bridge, and the visual result is that Dink is "under" the bridge. The depth-que overrules the y-coördinate when drawing (the function in DinkC is sp_que(&sprite, &number); ). So, if you set the depth-que to -100, the bridge will be drawn as if its y-coördinate was -100, which is lower than Dink's y-coördinate, so the bridge will be drawn before Dink. This results in a bridge that's drawn under Dink.

Setting it to "Background" might work, but if it's a bridge over water, or other animated tile, it will disappear. It'll also disappear when Dink gets a levelraise and everytime fill_screen(&color) or draw_background() are used.

In short: set the depth-dot to -100, or something else. Background might work, but it can easily screw up the sprite.
February 11th 2007, 09:30 AM
duckdie.gif
radfrog
Peasant They/Them
 
Thank you both for the solution, and the explination. I had a problem with a "disappearing" sprite in another place in this current work. It was a marvellous effect - the sprite would show when Dink walked onto that screen. Then it would suddenly be gone. I thought about how I might incorporate it into the storyline, but the tme before disappearing was unpredictable, and I deemed it useless. I solved it by using a different approach to the presentation, but it would have been much easier if I had known what I just learned.

Than you very much.

RadFrog