Sign in to follow this  
hoogie

Backgrounf for a 2D platformer in D3D9

Recommended Posts

Hi, I have been working on an engine for a 2D platform game lately and currently have sprite entities displayed to the screen using the LPDIRECT3DDEVICE9->Draw function. I was just wandering what the correct method for displaying a background? As backgrounds usually move separately to the other sprites I assumed there was either a different way of loading or displaying the background image, does anyone have any knowledge of these techniques? PS I am currently utilizing Direct3D and not DirectDraw Thanks for any help

Share this post


Link to post
Share on other sites
Well I think there is no "correct" method for displaying a background.
Maybe you can use a quad and put the background texture onto it.

What you mean with "as backgrounds usually move separately" ?
Do you mean animated backgrounds ?

Share this post


Link to post
Share on other sites
I think he might mean parallax scrolling. Textured quads are good, but do make sure you turn off the Z-buffer before rendering. Filling the whole screen and depth checking will cripple your fps.

Share this post


Link to post
Share on other sites
what I meen by "as backgrounds usually move seperately" is that all player/enemy/object entities appear to be close by and interactive and move as expected however the backround image behind it all doesnt always move and when it does it usually have a distinctive effect to it.

So generally everyone thinks having a textured quad for the backround and then standard sprite displays for the player and enemies etc?

Thanks

Share this post


Link to post
Share on other sites
use ID3DXSprite it does all the job for you, and also, is it one big image which covers the entire screen or your background is made up of tiles?

Share this post


Link to post
Share on other sites
Well basically I am trying to make a scrolling game like Super Metroid or Turrican, so as the player aproaches the edge of the creen it will move along. So in theory if I display a background the size of the screen I cant just keep displaying the same background over and over again can I?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this