Sign in to follow this  
NLScotty

2D game, best way?

Recommended Posts

NLScotty    954
Hello,

I'm familiar with C++ and I would like to create a small game. I would like it to look like this:
[url="http://www.google.nl/imgres?imgurl=http://www.jeroendenhartog.nl/wp-content/uploads/2011/04/day4-1.jpg&imgrefurl=http://www.jeroendenhartog.nl/2011/04/09/day-4-your-guilty-pleasure-game/&usg=__CFhDFshXGACv7h78VztYqBJjAgE=&h=600&w=800&sz=100&hl=nl&start=13&zoom=1&tbnid=LqzxI7wyocHDfM:&tbnh=128&tbnw=162&ei=cqDnTejSPMmXOrv5udoJ&prev=/search%3Fq%3Dmaplestory%26hl%3Dnl%26biw%3D1024%26bih%3D597%26gbv%3D2%26tbm%3Disch&itbs=1&iact=hc&vpx=120&vpy=239&dur=2274&hovh=194&hovw=259&tx=216&ty=77&page=2&ndsp=15&ved=1t:429,r:0,s:13&biw=1024&bih=597"]Pic[/url]

I found all small pieces of pictures, which has been drawn 200 times or something and it makes that. Is this the right way?


There are a few questions which I would like to get answered.

[list=1][*]Is it better to use Direct3D or 2D? Looks like there is way more help for 3D and it looks neater, I tried 2D.[*]Someone has a book which covers Direct3D for 2d or a 2D book if it's better?[*]Would be networking with send()/recv() be hard?[/list]I hope I can get this of the ground this holiday, in a few weeks, so I should start learning.

Thanks for reading.

Share this post


Link to post
Share on other sites
beatlefan    198
For you first question: Direct2D only works on Vista and Windows 7, so if you want your game to work on XP you should use Direct3D. Also you don't have to make 3D games in Direct3D, you can create 2D games with it.

Share this post


Link to post
Share on other sites
Jon Hellebuyck    100
I recommend using Direct3D for 2D. I was in your shoes two years ago and looked at things like DirectDraw, but there are so many advantages to using 3D to do 2D that I decided to use 3D and haven't looked back.

With 3D you can draw 2D images to the screen with alpha and transparent areas, using a textured quad (triangle strip) or blitting to the back buffer using CopyRects(). As a bonus you can use the 3D matrix functionality to do rotation, scaling, and translation, all hardware accelerated. With that and all the other things that come with using textured quads (filtering, lighting, etc.) that you might want to use, 3D comes in pretty handy even if you never use that third dimension.

Speaking of the third dimension, that's another reason I'm glad I went with 3D: learning how to use vertices. You know you want to do 2D now, but there may come a day when you decide you want to do something with 3D, and using 3D for 2D will help you build a foundation for that. While setting up textured quads you'll learn about vertex coordinates, texture UV coordinates, and color modulation. Once you understand those concepts it becomes much easier to make the jump to 3D.

As for books, I've got a recommendation but it's out-of-print and possibly out-of-date. I used Ernest Pazera's "Focus on 2D in Direct3D." It's tailor-made for what you're doing, but it focuses on DX8.1, so there may be newer things about DirectX that make 2D easier that wouldn't be covered in it. It's probably worth looking for a newer book that covers whatever advances there have been in DX10 and DX11 for 2D, if any.

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