Sign in to follow this  
Eddy Allen

Best language to make 2d games

Recommended Posts

Hey, Im new here so I hope this is in the right forum. Now I have an Idea for a 2d platformer but I've only ever coded VB.Net HTML and CSS. I was wondering what would be the best language to make a 2d platformer and then other games. I was thinking of C++ but I've also thought of Java. Im just about to enter into college to study computer science and my first CS class is Intro to Java so I was thinking to start learning Java now. But if C++ is better for overall game creation ill learn both at the same time.

So basically if tl;dr

- Java or C++ for game creation (or other)
- What would be a good engine for a 2d platformed?

Share this post


Link to post
Share on other sites
Making platform games in Java is only a wise idea if it's for Android. In any other scenario I'd say C# would be better (especially because of the XNA library). I wouldn't recommend C++ if you're just starting to program - I think C# would be a better choice for now, especially because it's similar to Java in many ways (which, as you said, you'd be learning at the university).

If you're however open to other languages, I'd recommend Python as well. With its extensive SDL-based pyGame module, it's quite fast and easy to write fully playable 2D games. There's plenty of tutorials for that, I'd recommend these for starters: [url="http://inventwithpython.com/index.html"]http://inventwithpython.com/index.html[/url] Edited by Vodahmin

Share this post


Link to post
Share on other sites
Awesome I was really thinking about python but wasnt sure of its game capabilities, I've got some ideas for python bots I want to make but thats for another forum. Nothing illegal though

Share this post


Link to post
Share on other sites
C# is fairly similar to VB.net IMO, easy enough to pick up, then you can use the XNA library which I find to be greatly superior to python+pygame. XNA can also be used with VB.net (and even ironPython) but the XNA tutorials mostly focus on C#.

Share this post


Link to post
Share on other sites
Best language is the one you're most familiar with. I, for one, like to do my things in c++, but if you're just starting out, XNA isn't bad. But try to go beyond XNA when you know enough. XNA is good up to a point.

Share this post


Link to post
Share on other sites
I mean I know that, and I understand it, Ive studied VB.Net for two years in highschool. Only programming class besides HTML and CSS. But .Net just isnt good for gaming I mean I can make programs in it but thats about it

Share this post


Link to post
Share on other sites
.Net is getting increasingly popular for making games. Most of the games on xbox live indie games are made in XNA. Terraria and Bastion are 2 popular titles made in XNA. I've seen in an older version of XNA someone made an engine capable of loading quake 2 data files (essentially a quake 2 engine reimplementation) Edited by 6677

Share this post


Link to post
Share on other sites
A really great place to start game programming is with Python using the SDL wrapper [url="http://pygame.org/news.html"]Pygame[/url]. Python is really easy to learn, and if you're going to get into game development, having to worry about learning a much more complex language like C++ or Java AS WELL as game programming theories and concepts, could really set you back. Pygame is also EXTREMELY easy to use with Python and has pages and pages of really usefull documentation on their website, something I found VERY usefull.

Share this post


Link to post
Share on other sites
[quote name='breinygames' timestamp='1344306230' post='4966885']
A really great place to start game programming is with Python using the SDL wrapper [url="http://pygame.org/news.html"]Pygame[/url]. Python is really easy to learn, and if you're going to get into game development, having to worry about learning a much more complex language like C++ or Java AS WELL as game programming theories and concepts, could really set you back. Pygame is also EXTREMELY easy to use with Python and has pages and pages of really usefull documentation on their website, something I found VERY usefull.
[/quote]

I also agree on this choice. Once you get the hang of pygame dump python and just switch to C++ with native SDL. The API is pretty much the same since pyGame is just a bunch of binders to SDL.

It's also advantageous since python is an easy scripting language that takes very little time to deploy. I even know a few C programmers who mock things up with python sometimes.

Share this post


Link to post
Share on other sites
Language_Structure ( Python != C++ ){}

Any way, what language to use to make 2D games?

Python / Pygame is easy, however is [b]not portable at all [/b]( don't get me started on Py2Exe )
C# / XNA is a bit harder than Python, but is very popular -- Mono makes it portable to any system
Flash / Action Script 3 is great for web games
Java is very portable, but can be a resource hog.
C++ is very portable, but takes a lot of time to develop


There are quite a few other languages to pick from, however one has to take into consideration portability AkA, how easy it is for others to install and use your finished product.
Some scripting languages used in 2D games - Lua, Ruby, Boo, HTML 5 Edited by Shippou

Share this post


Link to post
Share on other sites
If your goal is to create a game, I would suggest you try [url="http://unity3d.com"]Unity[/url]. Games written with Unity can be run on Windows, Mac, Android and iOS. Lots of developers are using it with great success.

Share this post


Link to post
Share on other sites
Nobody can make that decision for you, different languages exist for a reason. Languages are a series of trade-offs. Java is a higher programmer productivity language that pays a price with (potential) speed. C++ is a higher (potential) speed language, with heavy costs in programmer productivity ( and sanity! ). Which is best often comes down to you.


Actually that's not completely true; the ecosystem plays a huge part of it. Both Java and C++ have good (and free) tools available. Libraries are a big part of it, and both have some good choices there too, although C++'s selection is by far it's biggest strength. I would suggest [url="http://www.gamefromscratch.com/post/2011/08/04/I-want-to-be-a-game-developer.aspx"]reading this guide[/url] for a better idea of languages available, their primary tools and libraries and the merits of each.

Finally we can offer you our own opinion. Me, myself, unless I had to ( platform requirements, client demands, etc ) I wouldn't touch C++ with a 10 foot pole, unless I was working with a very large team. If I was looking to actually ship, if working in 3D I would probably go with C#/Unity, or in 2D I would use a higher level language like LUA with MOAI. Personally, I've been interested in HTML5 lately, so Javascript has been on my mind. It's a hateful hateful language that is a ton of fun to develop in! :) I've recently done some tutorials using [url="http://www.gamefromscratch.com/page/Cocos2D-HTML-5-Tutorial-Series-table-of-contents.aspx"]Cocos2D[/url] if you want a taste for HTML5 development. Edited by Serapth

Share this post


Link to post
Share on other sites
[quote name='Shippou' timestamp='1344340318' post='4966985']
Python / Pygame is easy, however is not portable at all ( don't get me started on Py2Exe )
C# / XML is a bit harder than Python, but is very popular -- Mono makes it portable to any system
[/quote]
I've corrected you on the C#/XML thing before. XML is just a markup language/document. XNA is what your after. Proof: [url="http://en.wikipedia.org/wiki/XML"]http://en.wikipedia.org/wiki/XML[/url] [url="http://en.wikipedia.org/wiki/Microsoft_XNA"]http://en.wikipedia....i/Microsoft_XNA[/url] Last time you even downvoted me for correcting you which makes no sense seeming as you were genuinely wrong. And btw the guy thats already downvoted you wasn't me

Python/Pygame is also VERY portable. The same code will run on any system with python and pygame installed without any issues. Theres other options besides Py2Exe. Mac has python preinstalled so just include a note on how to install pygame. Linux almost always has python preinstalled so its a simple case of providing a quick note on how to install pygame aswell (which is in almost every distro's repository). I'd say its VERY portable. Edited by 6677

Share this post


Link to post
Share on other sites
If you are fairly new to programming i would suggest you tu use python
With one of the graphic library( pygame pyglet pyopengl) and a physics engine like pymunk. It's easy and if you work hard you can create amazing things !

C# is a really good idea aswell

If you just wanna create a 2d game there is no need to get into c++ or java

Share this post


Link to post
Share on other sites
It doesn't matter.

Hell, I'm teaching a class on making games in JavaScript. There's lots of them out there these days (games, not classes).

Do whatever you know best. Learn as many programming languages as possible. Eventually, you will see that it doesn't matter.

Share this post


Link to post
Share on other sites
[quote name='capn_midnight' timestamp='1344362015' post='4967070']
It doesn't matter.

Hell, I'm teaching a class on making games in JavaScript. There's lots of them out there these days (games, not classes).

Do whatever you know best. Learn as many programming languages as possible. Eventually, you will see that it doesn't matter.
[/quote]

This is great/horrible advice :)

Learn as many programming languages as possible... eventually. One of the biggest problems with new (all?) developers is getting distracted by shiny and new. Learn one language well before moving on, as minimal exposure to many languages doesn't help you one bit, at least until you've mastered at least one.

Share this post


Link to post
Share on other sites
[quote name='Serapth' timestamp='1344362888' post='4967079']
One of the biggest problems with new (all?) developers is getting distracted by shiny and new.
[/quote]
I think this is a great point. I'm new to games development (but not programming in general) although to start my path into games I decided to go down the XNA route. I'm basically having to pick up knowledge on C# (never used before) from the tutorials and my VB.net and python experiences, hang on, just discovered something glinting on this webpage over here, brb....

Share this post


Link to post
Share on other sites
[quote name='Serapth' timestamp='1344362888' post='4967079']
[quote name='capn_midnight' timestamp='1344362015' post='4967070']
It doesn't matter.

Hell, I'm teaching a class on making games in JavaScript. There's lots of them out there these days (games, not classes).

Do whatever you know best. Learn as many programming languages as possible. Eventually, you will see that it doesn't matter.
[/quote]

This is great/horrible advice [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

Learn as many programming languages as possible... eventually. One of the biggest problems with new (all?) developers is getting distracted by shiny and new. Learn one language well before moving on, as minimal exposure to many languages doesn't help you one bit, at least until you've mastered at least one.
[/quote]

Multiple examples are better than one. If you can see the same program implemented in 3 different languages, it's a lot easier to pick out what is the C/Python/Java of it and what is the algorithm of it.

Yeah, distraction is a problem, but the beginner's single-minded focus on The Best Programming Language Evar is worse.

Share this post


Link to post
Share on other sites
Hello there, I am new here and I am relatively new to the programming scene. I have only fully started programming since last September and have already been experimenting with creating a 2D platformer in a variety of languages for my first trials of creating games. I am also writing this in the perspective of making your game with an accompanied engine.

From my experience of trying to create a 2D platformer, I went through a variety of languages before I could decide on what I mostly researched and experimented on. After starting from Java, Actionscript 3 and HTML/5/CSS, you can start to gather what languages may have the future (for yourself) for creating a 2D platformer game. When I first wanted to make a game, I tried C++ thinking I could make it all. It was unsuccessful, way too much of a leap for a beginner like me. Anyone by any means can start with C++, but I find its a huge learning curve, especially from someone like me who experience is a visual designer, not a programmer. Thinking of a language like Java is a great start about thinking what to program in for a 2D game. Languages to look at are:[list]
[*]C#
[*]Actionscript 3
[*]Javascript
[*]Java (like you mentioned)
[/list]
Now there are languages out there that you wouldn't expect to be used for game programming. Take languages such as Javscript or HTML5. They are starting to have engines out there being made. The point I am making is that any language out there can or is starting to look towards game development. The biggest tackle (and this was when I was trying to simply create my first platformer) is yourself knowing what you are willing to program in, the confidence and also just how well the language has been used in the gaming industry.

After many failed or successful attempts (even if it is just putting a sprite in the game), I question myself on the language and engines related to it.[list]
[*]What games have been made out there using that language?
[*]What engines are available for that language? How well can something be made with them?
[*]How well are the engines supported? Are they now in history or have they got a thriving community and up-to-date documentation?
[*]Whats the learning curve for this language?
[/list]
Deciding the language for a 2D platformer is entirely your own decision and to see (like as I mentioned above) how well that language can progress.

Now in my personal opinion, after experimenting with a variety of engines/languages, I decided that it was best to settle on Actionscript 3 language for creating my 2D platformer. The reason being, its actually more in depth then what I first saw it as "Flash".

Creating a actionscript 3 game is actually relitevly easy to setup. There is a great free IDE out there called "FlashDevelop" and the Flex SDK allows you to export to play in Flash. Now the situation is what engine do I use? Well there is an engine out there called "Flixel" specifically designed for classic retro 2D games. The only limitation (without sounding cliche) is anyones imagination. Flixel just requires you to program your game, create your assets and your off. The documentation and community out there is great, and the examples of work is high! Take a look at "CANABALT", a 2D running game that has now hit the mobile market. I highly recommend flixel for creating a 2D platformer and getting an idea of how programming in a commonly used gaming language is.

In conclusion anyone has their opinion on what language or engine to use, it really is just your own choice on what you think is the right way to make your game. I hope I have helped and good luck with your creations [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img]

- DeveloperJazz Edited by DeveloperJazz

Share this post


Link to post
Share on other sites
Well this got off-topic fast, didn't it?

I have stripped the topic of the irrelevant and off-course discussion concerning cx_freeze and Python, etc etc. Take it to some other forum, please. Edited by Josh Petrie

Share this post


Link to post
Share on other sites
Some months ago I decided to create a 2D game based on Terraria - [url="http://en.wikipedia.org/wiki/Terraria"]http://en.wikipedia.org/wiki/Terraria[/url]

I actually started out with Unity (3D engine for C# and Javascript). But doing 2D in a 3D engine felt like a complete waste.
So. I decided to give XNA a try, and after a few online tutorials I decided to buy a book about XNA 4.0(my very first programming book). After working through half of it (the part that covered 2D) I decided that I'd give it a try in XNA. And I've never been happier with my choice.

During the last 2-3 months I've learned a lot. XNA does a lot of the hard stuff for you, while still giving you the feel that you are actually creating something.
I'll link to a video below that I've made recently showing the progress of my game. It might not be much for the pros out there, but for me, who's mostly self taught, I am quite proud of what I've accomplished so far. - My point is - I'd go for XNA since it's a nice first step into game developing (I'm still taking my first steps) and I'm pretty sure that if I had jumped straight into c++, I wouldn't have gotten this far, and chances are I would've lost my motivation on the way.

[b]The Video:[/b]
[media]http://youtu.be/o1saLTJ_Afs[/media]

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