[XNA] 2D Point and click games - how do they work?

Started by
9 comments, last by cmasupra 12 years, 9 months ago
I am interested in making a 2D point-and-click game but I am confused. How is the scene set up graphically and programitically? (I'm a programmer)

Here's my take:

So I've this test character:

UObwD.png

And here's a test scene (its a wallpaper):

Ld4Iv.png


I want the character to walk through that bridge and I want it to look real.

To do that I've cropped this from that picture:

MqiW4.png


And added it above the original picture. Now I've added the character in the middle of these two pictures.

And I've accomplished this:

pAL1n.gif


Am I doing it right? Will I have to save both images separately?

P.S: I'll be using XNA.


Thanks
Advertisement
Yep, that's just about how I'd do it if i had a static scene like that.
(Of course, the cropped tree and bridge image is missing a bit of transparency, but it's just an example, right. :) )

You could have the tree as a separate image, the bridge as a separate image, and associate each image with a depth value.
I recommend making a simple editor that allows you to import objects to different layers, setting their offset inside their respective layers, and scaling them etc.
This will also allow you to give the tree some parallax coefficient, so the foreground would be scrollable at a different pace relative to the rest of the scenery.

You don't need to save the images separately, but I'd make a set of files each with its own category or theme of images. Then if you need to use the tree several places in one scene,
or in multiple scenes, you can easily just get it no matter what level or where in a level it's supposed to be.

In case this is not a quick draft of how you'd imagine assembling things, i apologize. I haven't really messed much with scenes composed and stored as single images.
Composition of a scene allows you to create a fair amount of variation and new places easily.
Alternatively to cutting the image up and layering it, you could use a pseudo depth buffer as well. In it you would have key-values (graphically for editing you could use something like Magenta or some other stand-out color), then, when drawing your sprites, check the buffer at the sprite's position and don't draw anything that collides with the Magenta value.

Just a thought. I do think it would be more difficult to implement this efficiently than just layering, but, from a development standpoint it it would be quicker and simpler than chopping all your map screens up in randomly sized chunks.
-Or you could use an actual depth buffer...
Hahaha. Very true. I get into old school mode when you start talking about P&C adventures, though.
I am not that good with XNA. How does depth buffers work? I Googled it but couldn't find any useful tutorials.

I am not that good with XNA. How does depth buffers work? I Googled it but couldn't find any useful tutorials.

Well alright, then perhaps The Doc's suggestion about the pseudo-depth buffer would actually be the way to go.
Otherwise, have a look at this very basic XNA article: http://xna-uk.net/bl...-z-buffers.aspx
Perhaps that will give you some ideas...

Also, we're talking about "layering" stuff here, right? As far as the technique you're using now, it looks just fine.
I am not the OP, but I am having sort of the same issues with a game im trying to make.
I need to have a real Depth Buffer in XNA, but cant find anything that really explains them.

I went to the suggested link, and though I understand the concept, is there anything that tells where to put the different commands?

Do they go in the Render fucntion, or the Load, or Init ?

Does anyone have a simple example they would be willing to share, something showing just how to set up a depth buffer in a clean xna project?

Thanks
Should this be in the XNA forum? Just asking...

-- Tom Sloper -- sloperama.com


Should this be in the XNA forum? Just asking...

[font=arial, verdana, tahoma, sans-serif][size=2]Well, I can only help finding resources, as I don't have any XNA experience myself.
The OP was quite general at first, but I think now the thread would be better off in the XNA forum...[/font]

This topic is closed to new replies.

Advertisement