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

Started by
10 comments, last by Serapth 9 years, 5 months ago

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.

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.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.


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.

I think, therefore I am. I think? - "George Carlin"
My Website: Indie Game Programming

My Twitter: https://twitter.com/indieprogram

My Book: http://amzn.com/1305076532

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.

Sean Middleditch – Game Systems Engineer – Join my team!

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

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.

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

Thanks all. Might check out SDL, seems to have lots of resources about it rolleyes.gif

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.

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.

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?

This topic is closed to new replies.

Advertisement