2D Game Programming (with graphics)
Page 1 of 112 Replies - 3354 Views - Last Post: 17 July 2009 - 11:26 AM
#1
2D Game Programming (with graphics)
Posted 07 July 2009 - 02:59 PM
I could start working on my game in console application form by doing these steps:
1) Initialize some character variables such as initial position 2,2 in a 5x5 array. [x = 2, y = 2]
2) Create a 2D array, size 5x5 as the game world [purposely small]
3) Put nothing in empty cells to let me know they are empty, make the player "O" and put him in 2,2, and put some obstacles in the array as "X"
4) Display the map, ask the user which direction he wants the player to move and take it in as input.
5) With the input taken in from the player, run some tests using complex if-statements to check whether or not the player is about to move into a spot with an obstacle. Prevent the move if these statements return true.
6) Redisplay the map with the updated move
I currently have the programming knowledge and ability to create this. What I would like to do is move on to the next step, graphical programming. I want to create a 2d engine that will allow me to move a character around a small map.
I understand there is a difference between just 2d movement in a game and 2d TILED movement, so If I need to, I will try to create what I just explained above in graphical form, before moving on to 2D gaming WITHOUT tiles, using collision detection.
Any help you can give me is appreciated (point in the right direction, tips, links to your favorite tutorial that you have used successfully to learn this). Thanks a lot in advance.
~Xioshin
Replies To: 2D Game Programming (with graphics)
#2
Re: 2D Game Programming (with graphics)
Posted 07 July 2009 - 03:09 PM
I would like to recommend you this tutorial, and this one. They are both about SDL and in my opinion very easy to understand. The second one is a bit larger, but I have given you the link to the first one, because I really like the autor's programming style. There is also a tutorial about Tile-Maps.
I think, 2D games are not any harder than console games. It is just in graphical form, which is sometimes even easier than fumbling around with the text output.
This was just my individual opinion and maybe you share it sometimes with me
Speedy_92
#3
Re: 2D Game Programming (with graphics)
Posted 07 July 2009 - 03:24 PM
Speedy_92, on 7 Jul, 2009 - 02:09 PM, said:
I would like to recommend you this tutorial, and this one. They are both about SDL and in my opinion very easy to understand. The second one is a bit larger, but I have given you the link to the first one, because I really like the autor's programming style. There is also a tutorial about Tile-Maps.
I think, 2D games are not any harder than console games. It is just in graphical form, which is sometimes even easier than fumbling around with the text output.
This was just my individual opinion and maybe you share it sometimes with me
Speedy_92
Thanks for the link! Is SDL the best graphic library to use in C++? What are the others and their pros/cons?
#4
Re: 2D Game Programming (with graphics)
Posted 07 July 2009 - 03:32 PM
#5
Re: 2D Game Programming (with graphics)
Posted 07 July 2009 - 05:25 PM
#6
Re: 2D Game Programming (with graphics)
Posted 07 July 2009 - 08:48 PM
Quote
Quote
Quote
Quote
SDL is a cross platform layer over some basic fundamental aspects of a game. This includes creating a window, basic event handling (in particular, keyboard, mouse, and joystick), some basic graphics manipulations and support for using opengl instead, a bit of audio support, cdrom, threads, timers, and some file i/o support. And all of this has some cohesiveness throughout the library.
SDL is C based library. I don't know about the C++ bindings, nor if I would care to use them. In fact, for C++ programmers I would suggest SFML first. It's pretty much designed along the same kind of mentality (a thin cross platform layer of functionality) but the API is going to be nicer to use.
You aren't bound to to SFML or SDL. But for a comprehensive cross platform layer, you don't get better. If you're willing to throw out cross platform, then you get DirectX as a complete cohesive package of libraries. Well, DirectX and the Windows API.
Otherwise, you tend to construct what you need from various libraries. For graphics, you might use raw OpenGL, or work with a graphics library or engine like Ogre. Threading with pthreads or Boost.thread or whatever. Timing with whatever the OS provides. Audio with something like Fmod or Irrklang. And so on.
And then you have complete game engines. If you're in a hurry, look at game engines first.
#7
Re: 2D Game Programming (with graphics)
Posted 08 July 2009 - 04:55 AM
I have created many programs in C++, but stopped for about 8 months. Starting to get back into it, reading some tutorials, and coding some small console programs.
I have also programmed in PHP and other languages for years. I think I DO have a good grasp of the beginner aspects of the language. I don't see why I wouldn't be able to start working on programs with graphics.
Sure, I agree with you that I could probably learn more advanced things inside the console right now, but I can't think of anything I want to spend my time coding. As for your comment about SFML, I will definitely check that out
EDIT
Found an awesome site for tutorials. http://www.sfml-dev.org/index.php
Today after work I will start! But I will definitely continue to learn and do more programming in the console as well.
This post has been edited by Xioshin: 08 July 2009 - 04:58 AM
#8
Re: 2D Game Programming (with graphics)
Posted 08 July 2009 - 05:04 AM
Oler1s, on 8 Jul, 2009 - 02:48 AM, said:
Quote
Bullshit.
From what I read, he/she sounds perfectly capable. Besides, graphics really aren't as difficult as people make out. Especially basic 2D stuff.
This post has been edited by gabehabe: 08 July 2009 - 05:05 AM
#9
Re: 2D Game Programming (with graphics)
Posted 08 July 2009 - 05:47 AM
my 2 cents
#10
Re: 2D Game Programming (with graphics)
Posted 08 July 2009 - 05:50 AM
gabehabe, on 8 Jul, 2009 - 04:04 AM, said:
Oler1s, on 8 Jul, 2009 - 02:48 AM, said:
Quote
Bullshit.
From what I read, he/she sounds perfectly capable. Besides, graphics really aren't as difficult as people make out. Especially basic 2D stuff.
Look at my nickname, so you can see, that everyone can handle it
#11
Re: 2D Game Programming (with graphics)
Posted 08 July 2009 - 07:00 AM
stayscrisp, on 8 Jul, 2009 - 11:47 AM, said:
#12
Re: 2D Game Programming (with graphics)
Posted 08 July 2009 - 07:09 AM
Very poignant!
#13
Re: 2D Game Programming (with graphics)
Posted 17 July 2009 - 11:26 AM
I don't know about step for developing. Plz explain for me.
Thank you very much.
I am student in thai. if eng is wrong, i am sorry. T^T
|
|

New Topic/Question
Reply




MultiQuote










|