XNADevelopment.com - Scrolling a 2D Background (2.0)

scrollingbackground I have completely re-written and posted the tutorial covering scrolling a 2D background on my site . This tutorial has been upgraded with improved code and art assets and is now completely re-written for the XNA 2.0 framework.

I have also take the time to create a more advanced version of the source code. I tend to target beginners with my site so I don't always make my code as "robust" as it could be. Often, it teaches a concept, but it's not easy to reuse in another project. The advanced version of the code attempts to delve a little deeper into just how you might structure your code in a more object oriented approach for future reuse. Both the simpler and advanced versions of the code are available as separate source code downloads.

Head on over and check out the tutorial on Scrolling a 2D Background.

As always, I'm *BEGGING* for some comments and feedback. Seriously, even if it's just to say "Hi!". I love to hear from people that have read the tutorials and enjoyed them or even from people that didn't enjoy them. If you have some advice to give on how I should improve, I'd love to hear that too. And of course, if they're helping you out, I'd love to hear that as well. Just a couple comments can really make a difference in helping me stay motivated so if you have a few seconds, just take a little time, I really appreciate them!

Print | posted @ Saturday, March 08, 2008 10:22 PM

Comments on this entry:

Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Francesco at 3/8/2008 11:16 PM

Great tutorial!!How about parallax scrolling?
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Glenn Wilson at 3/8/2008 11:39 PM

Here is a link to a Parallax Scrolling Example.

http://www.virtualrealm.com.au/blogs/mykre/archive/2007/08/18/parallax-scrolling-background-using-the-xna-framework.aspx
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by pugmartin at 3/9/2008 8:30 AM

hi there you like people saying hi? HI!!

more serious now, i had started following joran omarks xnatutorial series and was thoroughly enjoying them until he exploded (or something.. he s currently very busy with other stuff). unfortunately i couldnt find anything else out there that fitted my requirements (no previous c# knowledge, though previous c/basic/directx/java etc knowledge). everything seems either aimed at being fully proficient at xna beta/1.0 and no c# skills... or full c# skills and totally proficient at xna 1.0!

all i wanted was something to guide me as a total beginner and i think in your site i have found it.
for some strange reason, despite my c and directx background, i have so far struggled with xna. its very frustrating.

thanks for the ray of light your tutorials have given me, and i hope you dont "blow up" a la joran!

thanks again, pugmartin
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by George W. Clingerman at 3/9/2008 9:36 AM

@pugmartin - Thanks for the great comment! Yeah, when we all started our XNA sites years ago when the beta came out, Joran was one of my favorites. I LOVED his weekly roundups of everything XNA. His life got kind of busy so he had to stop, but he had made a lot of great content.

I can't see myself stopping writing tutorials anytime soon. I've been running XNADevelopment.com for over a year now and I still really like doing it. It's good to hear you think they might work for you.

Awesome feedback! Thanks so much for taking the time!
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by George W. Clingerman at 3/9/2008 9:38 AM

@Francesco - Thanks for the feedback :) . I don't currently have a parallax scrolling tutorial, but I will probably at one at some point.

Until then, I Glenn's right he's got one currently on his site that should help you out.

Thanks again for taking the time to comment! I appreciate it.
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by samizel at 3/11/2008 9:00 AM

Hey, I like your tutorials very much, they are really nice written. I´n in C# but a total noob at xna so I need more tutorial like that ;).

mfg
samizel
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Chris R at 3/11/2008 12:32 PM

Hey, just wanted to say thank you for the tutorials. I really do appreciate the work you've done.

If I could make a suggestion it would be for a tutorial about organization. I find my projects get quite larger and it can often seem overwhelming.

Apart from that please keep up the good work. :)
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Cory F - cdxgames at 3/13/2008 1:04 PM

Just wanted to say thanks for this tutorials.. If it's a boost to your ego, your original 1.0 tutorials is what got me started on xna.. =) I remember the original tutorial for scrolling backgrounds had a couple issues, this looks wonderful! Thanks! Parallax next, then .. no, the list is too long..

also, whatever cms your using to run this site wont validate my email. May need an update, its cdxgames@q.com and apparently thinks a 1 letter domain isnt real.
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by George Clingerman at 3/17/2008 7:26 AM

@samizel - Thanks! I've been working hard at making my site a great place to come for beginners. It's good to hear the hard work is paying off.
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by George Clingerman at 3/17/2008 7:28 AM

@Chris R - Thanks for taking the time to comment!

Project organization is a tricky thing. I'm still not sure *I* do it right. I think, like a lot of development topics, it's one of those things you pick up over time and it's an evolutionary process.

If I can think of a good way to approach the topic, I'll see if I can write something up on it.
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by George Clingerman at 3/17/2008 7:32 AM

@Cory F - Thanks, it's great to hear I was a help to getting you started. Thanks for taking the time to say something!

Parallax scrolling is definitely something on the list..if you look at the advanced Scrolling source code, it's really just as simple as declaring a new scrolling background object for each of your layers..think you can figure it out ;)

Yeah, GeeksWithBlogs is pretty tight on keeping spam out of the comments. I bet if they lift their single character domain restriction we would get flooded! Sorry about that and thanks again for the comment!
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Computer Student 2 at 4/7/2008 7:23 AM

Hey i was wondering if you still had that tutorial on XNA in version 1.0 b/c my school is using 1.0 and i would like a scrolling background in my game.

Thanks!
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Brian Johnson at 4/13/2008 8:12 AM

Thanks for the tutorial. I had a little blip going from 1.0 to 2.0.(xna)

Did anyone else only have the background only cycle through once?
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Alan at 4/20/2008 9:31 PM

I was wondering if there is a way to make the animation smoother? I'm using a core 2 quad @ 3ghz with 4 gigs of ram and 8800gtx, and I still see some choppyness with the background scroll with both the beginner and advanced methods that you show here.
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Caio Pavanelli at 5/2/2008 5:56 AM

Hello there George,
this is the first XNA tutorial starting from the real beginnig that I found on the web.
I'm used with c#, but never heard about XNA before these days.I found many tutorials starting from the 3d development, but only now I have idea from what is a sprite, hehe.

The examples are just simple and easy to follow, great didactic.

Keep on this great job, and thanks.
Gravatar # re: XNADevelopment.com - Scrolling a 2D Background (2.0)
by Soaban Ramachandran at 5/16/2008 2:52 PM

Hey there :)
This site is like the bibel :D
I love it (and im not even religious)
...

I was wondering if you could release a tutorial for the advanced version of the scrolling 2d Background?

Thanks in advance for this great site :)
sign Soaban

Your comment:

Title:
Name:
Email:
Website:
 
Italic Underline Blockquote Hyperlink
 
 
Please add 2 and 7 and type the answer here:
 
Twitter