Jump to content

  • Log In with Google      Sign In   
  • Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

Sign up from the right-hand sidebar on our homepage and read Tuesday's newsletter for details!


We're also offering banner ads on our site from just $5! 1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Advice in starting 2D game programming


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
13 replies to this topic

#1 Fractalux   Members   -  Reputation: 102

Like
0Likes
Like

Posted 20 June 2012 - 06:58 PM

I need help in starting on 2D game programming. I consider myself to be an intermediate programmer with roughly 3 years (not in school years; I mean allocated over classes, internships, and self-taught projects) of programming experience with the C family of languages (excluding Objective-C), JavaScript, and just recently Java and HTML5.

I've never done any game programming. Closest thing to it is some graphics exercises in a textbook, but I want to start now that I have a free summer. What I want to know is what is my next step?

I did some research (googling considered research?) and stumbled on this site so I decided to post. If I am not mistaken a good place to start with 2D programming would be Flash (and HTML5?), pygame, and SFML?

Ultimately, I want to program a game in a similar form to a 16-bit era 2D sidescroller but with updated graphics like Braid or Rayman Origins and then move over to a 3D sidescroller like New Super Mario Bros. or Trine with a full team. What would be a great starting point for this? I don't mind if I have to start very basic, like actually programming a 16-bit game or a simple 1 to 2 level pseudogame. I am comfortable (mentally/psychologically but of course not physicaly) coding/debugging for prolonged hours of time with a textbook on my desk. So the preferred method of learning would be a textbook and practice.

I am a bit short on cash so any open source/free/reduced education pricing software to aid in programming the game would be grealty appreciated. Hardware is of no concern at this stage since I am just looking to code for mac/windows computers (eventually iOS [Though I would need to learn Objective-C first] and consoles maybe).

So where do I start?

Sponsor:

#2 greenzone   Members   -  Reputation: 672

Like
0Likes
Like

Posted 20 June 2012 - 07:43 PM

If you are already familiar with the C family I would jump right into Opengl with C++ or C#. there are a plethora of tutorials online that can get you started quite quickly with 2D side scrolling level of graphics. opengl 2.0 es is used for the iphone apps and there are alot of quite user friendly tutorials on setting that up. also the Opengl Red book is free online if you are trying to save money and it will also help get you started. I also would recomend this route because as your skills grow the C++ language and openglAPI will allow your growth rather then potentially limit you. Nehe also uses many out dated techniques is also a great sorce to get your understanding of opengl and game programing in general up to speed. specifically this Nehe tutorial would help you with the basics of how potentially a side scroler could be set up from textures to moving objects. also if you wanted a mario 16 bit look to the game you can just make textures in photoshop or gimp that have that look and apply them to your flat geometry with that set up. others will give you potentially different advice and it could be valid but this is what i would recomend. any ways good luck

Edited by greenzone, 20 June 2012 - 07:44 PM.

J-GREEN

Greenpanoply

#3 BeerNutts   Crossbones+   -  Reputation: 2978

Like
1Likes
Like

Posted 20 June 2012 - 10:14 PM

Honestly, I wouldn't get into OpenGL to begin with. Start with a simple API, like SFML for C++. It does everything you want in terms of 2D graphics, and it provides most of the other tools needed to make a game: Input, Audio, Windows, Networking, and Graphics.

The link to my old blog (in my sig) details steps I took to make a 2d game using C++, CodeBlocks, chipmunk-physics (as my 2d physics engine). However, Serapth has a blog that he details creating Pong using SFML which is more beginner oriented: http://www.gamefroms...PP-Edition.aspx
(Be Aware, his tutorial might still be based on SFML v1.6, whereas SFML v2.0 is the latest release, and I'd suggest using it)

Good Luck
My Gamedev Journal: 2D Game Making, the Easy Way

---(Old Blog, still has good info): 2dGameMaking
-----
"No one ever posts on that message board; it's too crowded." - Yoga Berra (sorta)

#4 szecs   Members   -  Reputation: 2173

Like
0Likes
Like

Posted 20 June 2012 - 11:39 PM

Start by doing. start wit smaller games, like Pong, Tetris, Breakout etc.

#5 Fractalux   Members   -  Reputation: 102

Like
0Likes
Like

Posted 21 June 2012 - 12:02 AM

If you are already familiar with the C family I would jump right into Opengl with C++ or C#. others will give you potentially different advice and it could be valid but this is what i would recomend. any ways good luck


Honestly, I wouldn't get into OpenGL to begin with. Start with a simple API, like SFML for C++. It does everything you want in terms of 2D graphics, and it provides most of the other tools needed to make a game: Input, Audio, Windows, Networking, and Graphics.

Good Luck


These are two conflicting suggestions but I like the potential for growth greenzone mentioned taking his method. This is however subjective to what is written among these posts and I still have my own research to do before I chose a formidable option. So I'll take a look at both before deciding which route to commit to. Thanks.

Start by doing. start wit smaller games, like Pong, Tetris, Breakout etc.


I always take the basics to be fundamentally important to every skill. Thanks.

#6 6677   Members   -  Reputation: 1058

Like
0Likes
Like

Posted 21 June 2012 - 02:58 AM

C# is primarily a windows language but thanks to mono can be coerced into running mac, windows and linux. I think mono also works on solaris and BSD. Mono has iOS and android ports (monotouch and monodroid respectively) however unlike regular mono these aren't open source and I believe are about $500 each.

C# isn't a brilliant beginners language though. VB.net is very similar syntax but much easier. Jumping in at the deep end with game programming with no prior programming experience will probably just make you want to quit.
My recommendation:
Assuming your on windows, download VB.net express from microsoft. Learn how to write code in that.
Somewhere much further down the line download C# express, install it AND then install XNA (its order specific)
Play around in C# for a bit just to familiarise yourself.
XNA is a very good rendering framework that also has excellent sound and input libraries. XNA projects will run on windows XP and above, windows phone 7 and xbox 360. It works very nicely for 2D (which is what I'm doing at the moment) and where its not really a full engine it can be forced to do just about any task involving rendering so its not limited to making games. It doesn't work with mac or linux unforuneately but theres other frameworks that are cross platform but not as easy to deal with as xna.

#7 Kasbe   Members   -  Reputation: 106

Like
0Likes
Like

Posted 21 June 2012 - 03:06 AM

I would like to add SDL with C++ to the list. There's plenty of game development related tutorials out there, and I've found it very intuitive and easy to use, yet powerful.

#8 ASnogarD   Members   -  Reputation: 212

Like
0Likes
Like

Posted 21 June 2012 - 12:14 PM

One thing to note is both SDL and SFML have the ability to let you use OpenGL, so you dont need to give up on OpenGL if you go SFML or SDL, and as SFML and SDL are both 2D focused and allow for relatively easy access to all you will need to make 2D games they mesh up nicely with your stated goals.

"Ultimately, I want to program a game in a similar form to a 16-bit era 2D sidescroller but with updated graphics like Braid or Rayman Origins and then move over to a 3D sidescroller like New Super Mario Bros. or Trine with a full team"

#9 Fractalux   Members   -  Reputation: 102

Like
0Likes
Like

Posted 21 June 2012 - 01:27 PM

C# isn't a brilliant beginners language though. VB.net is very similar syntax but much easier. Jumping in at the deep end with game programming with no prior programming experience will probably just make you want to quit.
It doesn't work with mac or linux unforuneately but theres other frameworks that are cross platform but not as easy to deal with as xna.


I forgot to mention it but VB was the language I was first introduced to and yes it was fairly easy. I also have some experience with C# but I did not want to go the XNA route because of what you mentioned. Thank you for the advice nonetheless.

I would like to add SDL with C++ to the list. There's plenty of game development related tutorials out there, and I've found it very intuitive and easy to use, yet powerful.

One thing to note is both SDL and SFML have the ability to let you use OpenGL, so you dont need to give up on OpenGL if you go SFML or SDL, and as SFML and SDL are both 2D focused and allow for relatively easy access to all you will need to make 2D games they mesh up nicely with your stated goals.

"Ultimately, I want to program a game in a similar form to a 16-bit era 2D sidescroller but with updated graphics like Braid or Rayman Origins and then move over to a 3D sidescroller like New Super Mario Bros. or Trine with a full team"


If that is the case then I'll most likely start with sfml/sdl (since I am most comfortable with C++) and when needed/wanted I'll look into OpenGL, but does anyone know any books I can buy to help? I know I can find countless tutorials but I would prefer a book if possible. Thank you all for the suggestions.

#10 ASnogarD   Members   -  Reputation: 212

Like
2Likes
Like

Posted 21 June 2012 - 03:12 PM

The only book I know of for SDL is Focus on SDL, but I cant vouch for how good it is.
I would suggest IF you go SDL , visit :

http://lazyfoo.net/index.php for good tutorials and tricks , plus articles.
http://www.sdltutorials.com/ for some more SDL based techniques

or for SFML you could try

http://www.gamefromscratch.com/

Both SDL and SFML have lots of online resources but I doubt you will find many books to read through on the subject.

Hope that helps some.

#11 martinis_shaken   Members   -  Reputation: 145

Like
0Likes
Like

Posted 22 June 2012 - 09:19 AM

SDL and www.lazyfoo.net

His tutorials are amazing for setting up the environment, and understanding the basic logic and flow of a game. Each tutorial adds a new game element to your toolbelt, and by the end you are able to recreate just about anything.

I had a game programming class in college that followed his tutorials and it was awesome. By the end of the semester we had made breakout, bejweled, space invaders, and a custom project (I re-made super mario for the snes (only the first couple levels though)). It was a quite rewarding experience. I cannot recommend SDL and lazyfoo strongly enough.

#12 birko19   Members   -  Reputation: 146

Like
0Likes
Like

Posted 22 June 2012 - 03:05 PM

Here are the options I have used for 2D game development:

- C# with XNA (This is my current favorite).
- C++ with SFML.
- C++ with SDL.
- Python with Pygame.

I know XNA might turn you off based on its lack of platform options, but imo it's the best out of the four I tried when it came to productivity. I also have tried C++ with OpenGL alone but this might not be your best option since OpenGL only handles graphics, you would need something else to handle input, sound, etc.

Edited by birko19, 22 June 2012 - 03:07 PM.


#13 Fractalux   Members   -  Reputation: 102

Like
0Likes
Like

Posted 22 June 2012 - 04:40 PM

The only book I know of for SDL is Focus on SDL, but I cant vouch for how good it is.
I would suggest IF you go SDL , visit :

http://lazyfoo.net/index.php for good tutorials and tricks , plus articles.
http://www.sdltutorials.com/ for some more SDL based techniques

or for SFML you could try

http://www.gamefromscratch.com/

Both SDL and SFML have lots of online resources but I doubt you will find many books to read through on the subject.

Hope that helps some.


Yes it does help, thank you, and based solely on reviews the book doesn't seem all that detailed in specifics but provides an overview of SDL itself.

SDL and www.lazyfoo.net

His tutorials are amazing for setting up the environment, and understanding the basic logic and flow of a game. Each tutorial adds a new game element to your toolbelt, and by the end you are able to recreate just about anything.

I cannot recommend SDL and lazyfoo strongly enough.


I've already set up sdl but have not had a chance to code. Will start on the rest of the tutorials on Monday after a short weekend off.

I know XNA might turn you off based on its lack of platform options, but imo it's the best out of the four I tried when it came to productivity. I also have tried C++ with OpenGL alone but this might not be your best option since OpenGL only handles graphics, you would need something else to handle input, sound, etc.


Actually my main reason for putting of XNA development is because my school offers a course in it and I'd much rather learn something a course at my school won't teach. Also I found out a graphics class using OpenGL is being taught as well so I will be signing up for it next quarter. But for now I will be learning SDL/SFML through tutorials.

#14 antiHUMANDesigns   Members   -  Reputation: 58

Like
0Likes
Like

Posted 23 June 2012 - 06:33 PM

I also recommend openGL. And SDL works well with openGL, I actually used them together for a long time, until recently when I switched to GLFW, which is light-weght and everything you need for a good openGL base.

So yes, I would say SDL and openGL.

Using openGL for 2D stuff also teaches you how to do the same thing in 3D (in a sense, because openGL is the same whether you use 2 or 3 dimensions, really), at no extra cost, so for that reason it's great.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS