Jump to content
  • Advertisement
Sign in to follow this  
allhype

Finished c++ primer plus and console. Now I want to make a 2D tile game!

This topic is 1506 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Enough with console...

 

I finished reading C++ Primer Plus 6ed and did all the programming exercises. Now I want to make a basic 2D tile game like a toon walking around with some collision detection, sound, basic animation, maybe fire a gun etc.

 

So what, directx (version)? opengl (version)? I would like to code from scratch and avoid any "game maker software" options.

 

Looking for good books which explain everything in detail also. 

 

Thanks.

Edited by allhype

Share this post


Link to post
Share on other sites
Advertisement


Now I want to make a basic 2D tile game ... directx? opengl?

 

I can empathize with wanting to jump from a console to a "real" game of some sort. And a 2D tile game isn't a bad choice to work toward. With collision detection and sound and animation ... not so much. It appears you've already shown patience in working through console examples. Continue to be patient with yourself and continue to take things a step at a time. As you want to code from scratch (no game maker software), set a more moderate goal of, perhaps, a window with 1 textured sprite/tile/quad in the center. That may not appear to be very much, but that will take you through window creation, device creation, texture loading, vertex structures, simple calculations and rendering.

 

DirectX or OpenGL? What platform? Windows? Mac? Android? In any case, you're going to get a good 50-50 mix of recommendations with that question. My advice - pick one. Google for tutorials and/or books based on the choice, and ask more specific questions about books/tutorials, etc.

Share this post


Link to post
Share on other sites

 


Now I want to make a basic 2D tile game ... directx? opengl?

 

I can empathize with wanting to jump from a console to a "real" game of some sort. And a 2D tile game isn't a bad choice to work toward. With collision detection and sound and animation ... not so much. It appears you've already shown patience in working through console examples. Continue to be patient with yourself and continue to take things a step at a time. As you want to code from scratch (no game maker software), set a more moderate goal of, perhaps, a window with 1 textured sprite/tile/quad in the center. That may not appear to be very much, but that will take you through window creation, device creation, texture loading, vertex structures, simple calculations and rendering.

 

DirectX or OpenGL? What platform? Windows? Mac? Android? In any case, you're going to get a good 50-50 mix of recommendations with that question. My advice - pick one. Google for tutorials and/or books based on the choice, and ask more specific questions about books/tutorials, etc.

 

 

^^^ +1

Regardless of DX or OpenGL, doing everything from scratch and creating a window with a texture is a lot harder than you would think.  Especially if you are trying to do everything yourself and are going to write you own file loading code.  Buckeye is right, pick something more specific, give it a try, and you'll be ready with the next round of questions.

Share this post


Link to post
Share on other sites
Using a library like SDL2 will save you a lot of pain.

It gives you windowing, input, basic audio, basic graphics, etc. There are add-on libraries for more advanced graphics, audio, fonts, and so on. You can transition to GL or D3D once you feel ready for it and still use SDL for everything else.

Share this post


Link to post
Share on other sites

You could start with the Win32 API maybe even some GDI calls or load some sounds, generally one of the first things you do is create a window then initialise you graphics libraries like OGL or DX. So maybe search for some tuts on creating a window, or if you create a windows application in your IDE this will show you how to do it.

 

There are tons of WIn32 API calls also so have a go with some of them.

 

You have to learn how to use an API call, it's essentially calling a function. Get used to the parameters, you will come across some new defined data types, like BYTE, WORD, DWORD, LPSTR when using the Win32 API, these are just defines that Microsoft like to state and then all your wide strings for unicode get used to some of this I would say, you really don't need to spend a lot of time with this, however, I think it's a good starting place. This will familiarise you when using/calling OGL/DX API's.

 

It's really not complex once you familarise yourself however what is complex is how to know all the sub systems of a game engine, the maths(2D/3D space representation) how it all intertwines together, hardware limits and code optimisations.

 

This looks like a good start, http://www.winprog.org/tutorial/start.html

Edited by rAm_y_

Share this post


Link to post
Share on other sites
Far be it from me to tell someone who *wants* to learn Win32 to not learn it, but for a beginner who wants to make a 2d tile game? Using something like SDL or SFML makes about 10x more sense than Win32.

Share this post


Link to post
Share on other sites

Hi, I started the same way as you.. have a look on HGE as well.. I have been using it to create 2d tile based little games too.. its hardware accelerated, easy to work with and you can have a sprite moving on your screen very quickly without worring too much about the inner working of directx or opening a window etc. So you don't get stuck on the very overhelming things like those mentioned and can still progress in your learning.. It has been working well for me.

Share this post


Link to post
Share on other sites

Far be it from me to tell someone who *wants* to learn Win32 to not learn it, but for a beginner who wants to make a 2d tile game? Using something like SDL or SFML makes about 10x more sense than Win32.

 

 

Meh, I'm a nearly 20 year pro programmer and believe me when I say....

 

 

@#@#$@#$@#$ Win32 programming

 

Seriously, Win32 programming in C or C++ is about as horrid as the job can get.  Fortunately it's also horribly outdated and generally not something you need to do often these days.  Never ever seeing another WinMain, message pump or WM_ switch statement would make me a very happy duck.

Share this post


Link to post
Share on other sites

 

Far be it from me to tell someone who *wants* to learn Win32 to not learn it, but for a beginner who wants to make a 2d tile game? Using something like SDL or SFML makes about 10x more sense than Win32.

 

 

Meh, I'm a nearly 20 year pro programmer and believe me when I say....

 

 

@#@#$@#$@#$ Win32 programming

 

Seriously, Win32 programming in C or C++ is about as horrid as the job can get.  Fortunately it's also horribly outdated and generally not something you need to do often these days.  Never ever seeing another WinMain, message pump or WM_ switch statement would make me a very happy duck.

 

 

 

Far be it from me to tell someone who *wants* to learn Win32 to not learn it, but for a beginner who wants to make a 2d tile game? Using something like SDL or SFML makes about 10x more sense than Win32.

 

 

Meh, I'm a nearly 20 year pro programmer and believe me when I say....

 

 

@#@#$@#$@#$ Win32 programming

 

Seriously, Win32 programming in C or C++ is about as horrid as the job can get.  Fortunately it's also horribly outdated and generally not something you need to do often these days.  Never ever seeing another WinMain, message pump or WM_ switch statement would make me a very happy duck.

 

Can you expain why it is horrid and also I said to just learn the basics, and yet again, explain why it is horrid?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!