Members - Reputation: 100
Posted 12 April 2012 - 11:03 PM
I've just finished learning some C++ tutorials and I know the basics of the language. Some things I've made by myself without any help are: a simple calculator with a GUI(using QT), Tic Tac Toe(console only) and a simple Pong game using SDL. I've also done quite a lot of the Project Euler questions using C++ and Python. I think I know enough to do some simple 2D game development.
Can anyone suggest a good library for simple 2D games? I've considered SDL and SFML but they're mainly for graphics and they do not include any features such as physics or AI. I'm looking for something that is:
~Not too advanced or complicated
~Uses C++ (or Python, but preferably C++)
~Has an active community
~Physics and AI would be nice, but I don't mind creating my own
~Keyboard and Mouse input
~2D, with hardware acceleration
~Shaders, particles and other effects would be nice
That's it for now, can't think of anything else I need at the moment. I hope this isn't too much to ask for. Thanks.
Any suggestions will be greatly appreciated!
Members - Reputation: 435
Posted 13 April 2012 - 06:25 AM
There are many different kind of AI depending on what you want to do.
Crossbones+ - Reputation: 6807
Posted 13 April 2012 - 09:37 AM
- Is simple (but pretty powerful)
- Supports shaders
- Supports audio output (through OpenAL)
- Hardware accelerated
- Has an active community (and Laurent (the creator) is very active on the SFML forums)
- Handles keyboard, mouse, and joystick input
The game I'm working on is using SFML and Box2D, and I've been quite happy with them so far.
Members - Reputation: 118
Posted 13 April 2012 - 11:49 PM
Crossbones+ - Reputation: 6807
Posted 14 April 2012 - 07:46 AM
SDL is C-based, SFML is C++-based. SDL does not natively use OpenGL and hardware acceleration (the upcoming SDL 1.3/2.0 might be changing that, though I don't know) (if you want SDL to use OpenGL, you have to set it up and use OpenGL yourself), whereas SFML already uses OpenGL and hardware acceleration for everything. I don't think (could be wrong) that SDL gives you networking support, but SFML does. SDL is LGPL, SFML is ZLIB/PNG licensed (though some of the audio libraries SFML uses (like OpenAL and libsndfile) are LGPL). I don't think SDL is bad, but in my opinion SFML is better when working in C++ (and SFML 2.0 is even better).
I'm trying to decide between SDL and SFML. What are the main differences? I've tried a bit of SDL and I like it so far.
I hope by simple you really do mean *super simple.* Once objects can rotate or once you start supporting multiple collision shapes, it's not simple and you should use a library. But if by simple you really do mean super simple (i.e. one object type, no rotations, etc.), then yeah, you can do it on your own and it isn't too bad.
For the physics, I think I'll just make my own because all I need is something simple.
Crossbones+ - Reputation: 4171
Posted 16 April 2012 - 08:48 AM
By simple, I don't mean super simple, just not too complicated. I'll learn some SFML then. Thanks for your replies!
If you've got basic C++ skills, I've put together this (rather long) tutorial series on creating a game with SFML/C++ that might be a good place to start.
My more Popular Tutorial Series: