Advertisement

2D animation advice/tecnique

Started by January 12, 2002 08:17 AM
9 comments, last by mickey 22 years, 8 months ago
hi! i''d like to do a 2d anim without blitting the background everytime i blit the sprite, how will i do that? thanks in advance!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
oh and one more thing, i alredy tried doing this by directly blitting to the primary surface but everytime my sprite moves, it left behind trails... hope you got the picture, thnkas again!
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Advertisement
ei better yet, does dirty rectangles scheme solve my dilemma? it if does, pls provide a very short instruction,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
I don''t know why you would want to do this, but you could copy the rect of the background where you blit your character first, and then blit the copy back over that spot the next frame.
Turring Machines are better than C++ any day ^_~
hahaha that''s just what i did intrest86 thanks very much! do you know any other tecniques?

hahaha that''s just what i did intrest86 thanks very much! do you know any other tecniques?

http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Advertisement
and intres86, one more thing, why, doesn''t anybody really do this? do animation directly to the primary surface? doesn''t it make things a bit faster coz you don''t have to blit everything all else up?
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
Doesn''t that waste memory, catching the area of the screen you are about to move to. Computers are so fast now, blitting a background isn''t going to effect your performance that much. And if you have that much on screen that you think blitting the background will slow the refresh down, won''t wasting the memory holding a part of the screen by? Please correct me if I am wrong here.
You''ll have to clear the screen. Obviously, the trails are left by the blitting of your sprite, which stays there until you clear it.

There are many ways to clear the screen but you''ll do fine blitting an entire background. I don''t know what API you''re using, so I can''t tell you how to clear the screen exactly.

Do not blit to the primary surface directly, because, this is being accessed by the hardware. Thus, your scene might appear on screen before it''s done. This might not be a problem today on a small game. But it will cause flickering or something, especially on older computers runing a demanding game. Just blit to the back buffer and flip it when you''re ready.
okey guys thanks!!!

yes, the blitting is very very very fast, so there no problem blitting everything else all up! (of course, like darkor said, to the backbuffer)

am using api, we use the DDBLTFX structure to do a colorfill,
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,

This topic is closed to new replies.

Advertisement