Toolkit Options for 2D Python Game Programming [closed] - python-3.x

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are some toolkits for developing 2D games in Python? An option that I have heard of is Pygame, but is there anything that has more range to do more things? What are the good and bad parts about the modules?

I use pygame myself and it is very good. It has good documentation and tutorials, and is quite well designed. I've also heard wonderful reviews of pyglet.

I have used and would highly recommend pyglet, which provides 2D sprite graphics, hooks into OpenGL effects, audio support, file asset management, and excellent text layout and display support (not something you always find in a 2D game library). The API is sane, well-documented, and easy to get started with, and goes deep (especially if you're an OpenGL wizard).
As a companion to pyglet, I have used and would also suggest Cocos2D, which adds scene management, improved sprites, tiled map support, and fancy (accelerated) effects to add a little polish. Cocos is still young, but taking shape quickly, and already has fairly solid documentation.

A blog post covering several of the alternatives, including PyGame, PyCap, SpriteCraft, and ika. I have also seen pyglet mentioned.
You may also want to look at Panda, which is a very easy to use 3D engine with Python bindings. It is used for rapid prototyping at Carnegie Mellon's ETC.

I think pygame is the standard for game development in Python, I don't know of any others. A book you may be interested in is Game Programming with Python, Lua, and Ruby. Not only does it cover Python (and, I believe, the pygame module), but it also gives you exposure to Lua and Ruby. It's also available on books24x7 if you have a subscription there.

Another option is pycap which is a wrapper for the popcap framework with Python.

If you're already familiar with using OpenGL in another language (probably C or C++) then PyOpenGL is awesome. I was surprised as to how easy it was to switch from OpenGL/C to OpenGL/Python. The performance isn't half bad either.
I've heard good things about PyGame and Pyglet though I must admit I haven't really done much messing around with either one.

I've only heard people talk about pygame. It has tons of followers & plenty of functionality.
Recently I saw this book at barnes & noble which I might check out one day. It looked good.

Related

What are the main benefits of using Haskell for web developing? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm learning Haskell for great good.
I'm pretty into OOP and the various type systems. I used Java to develop webapps (Java EE, spring, Hibernate, struts 1.x), now I'm using regularly Python (pylons, django, sqlalchemy, pymongo) and Javascript. I had a huge improvement in my personal productivity: the lightweight approach, duck typing, awesome iterators, functions as first class citizens, simple syntax and configuration, fast tools like pip and distribute (and much more) helped me a lot.
But the first reason of my productivity boost is the Python language itself.
What are the main benefits of using Haskell for web developing?
For example, how its type inference can really improve my web app? So far, I noticed that when you decorate your function with its type-signature you are adding a lot of semantics to your program. I expect all this effort to come back in some way, to save many lines of code and to make them sound. I really like the sharp distinction between types and data, I'm starting to understand how they works, but I want something back :P
Don't get me wrong, I've just started studying Haskell so Maybe I'm missing some awesomness but I really want to understand its paradigm and when it's worth using it.
Most web applications aim to be stateless and handle concurrency well. Its also rather important to scale (Google SEO reasons, and user experience).
Haskell handles these problems rather well (although IMHO in more academic and perhaps less "human" intuitive way).
That being said due to the sheer lack of people doing web app dev (compared to say node.js) and that traditional web app dev has been more focused in a OOP mind frame it might be rather difficult.
I had some issues trying to use it as you can see in my questions below:
How do I do automatic data serialization of data objects?
Handling incremental Data Modeling Changes in Functional Programming

Learning a new language project [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Does anyone have a standard project that they use when learning a new language. Kinda like a specification document of a project that includes all aspects of programming. Does anyone use some sort of beginning type project when learning a new language? I guess it also depends on the type of language and what's it's capable of.
Contributing something to an open source project seems to work for me. In addition to getting exposed to some coding habits in the language , you get to work on something useful.
Going through the first few problems of Project Euler is a very good way to get a handle on topics like I/O, recursion, iteration, and basic data structures. I'd highly recommend it.
A friend of mine had a coworker who coded a minesweeper every time when he wanted to learn a new language with GUI.
I like making simple websites for learning.
Pro: you can put it online and show it to people.
Con: the language has to be suitable for web development.
Writing a simple ray tracer:
math functions (pow, sqrt, your own intersection routines)
recursion (because it is a whitted style recursive one)
iteration (for all pixels)
how to write custom types (rays, possibly vectors)
pixel wise graphics
have something to play with compiler's (optimization-) flags
optional:
simple GUI
file reading writing
I've also done so with metatrace.

Is there a need to code a new 3D engine? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
Coding a new 3D engine is fascinating but I there are so many out there. Is it sane for a programmer to start a new one? Are there industry sections in need?
Reasons to do it:
You want to learn about how to make a 3D engine, and don't really care if anyone but yourself uses it.
None of the existing engines do what you want and it's too much trouble to modify their source code (if you can even get it).
You have such an awesome idea and no other engine has done it so you need to do it because whatever you're doing doesn't exist yet.
Reasons not to do it:
You don't have enough of these resources: time/budget/expertise.
An existing engine fits your needs perfectly.
There are lots of reasons to build a new 3D engine (in no particular order):
The old one is a first person shooter, but you want a flight simulator.
The old one works, but isn't easy to use or has too many bugs
Someone else owns the old one
New hardware feature XYZ is fundamentally incompatible with the old engine
Someone is paying you to build one
You've never built one before.
Your game (simulation) only needs χ, but the old engine provides χ, ψ, ζ, α, β, γ, δ, and even π.
I happen to be building an OpenGL-based 3D engine in my off time right now. By implementing it myself, I'm expanding my basic knowledge of OpenGL way more than I would have by programming to someone else's interface (way more than I did when I implemented my own software affine texture mapped engine years ago). The downside is that I may never finish it :)
Generally, you code one if you have a need for one and there doesn't already exist one that suits your need.
Is there someone out there who needs an engine built for them because there doesn't exist one that suits their needs? Probably.
This is highly similar to the question should I write my own program/technology/framework X instead of using an existing one?" and that has been asked plenty, so I won't go over the usual boilerplate reasons.
While the answer to this question will always be somewhat subjective, a great deal depends on the context in which it is asked.
If it's being asked along the lines of I want to learn about game engines and rendering then it always can be beneficial to write your own game engine as developing the code is arguably the best way to learn. However, there may already exist good open sourced well documented engines to learn from as well.
If it's a commercial endeavor, then it's more of an issue of whether or not an existing engine provides what is needed. Modern commercial engines are written by some truly brilliant people and contain all the latest bells and whistles so it's more than likely they would suffice. This is evident by the sheer number of games that have been developed on two of the most popular game engines: idTech and Unreal engine. However, there still may be no tech related prohibiting factors to using an existing engine where writing your own is better. Such as if it can afford to be done, whether the engine can be licensed adequately, and, if the license can be afforded.

Choosing a Job based on languages? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
How often is language the deciding factor for selecting a job?
Many of us here are well versed in many languages, C++, Java, C#, and likely have many other languages under our belt for the right occassion (really any occasion is the right occasion for Python, AMIRITE?), so this isn't so much a question of choosing a job that is a good fit based on your skill set. Rather, if you are skilled with most languages, do you pick your favorite, or do you follow the money (given the tight economy).
I'm considering coming out of retirement, and have started to look around and what's available.
Over the years, I've moved towards C# and Python; many jobs in the area are looking for .NET developers, but there are plenty of them that do not. I cut my teef on C++, consider myself adept at the language, and know my way around a Java. But I find myself really digging what they're doing to C#, and I have always loved python.
Even if the work will be interesting, how important is the language to you?
I think that although in its essence programming is bigger than any language(languages are just the means, not the goals) everyone has a preference toward some languages. However, it often turns out that our preferences are towards languages not considered mainstream.
I live and work in Bulgaria(a country known from the movies as the center of crime in Europe, though that's not the case). Here 90% of the job ads are for PHP, Java and C# developers... There is also C for embedded development(which I hate), C++ (for maintenance of older systems - no one starts new projects in C++ anymore) and Cobol :-) I'd very much like to make money developing in Clojure or Ruby for instance, but the reality is that there is simply no demand around here. Of the three options I've found Java to appeal most to me - it's a nice language, with a nice community around it and a great VM behind it. So I naturally consider Java ads first, but I'm always open to any challenges as long as find them intriguing...
I would think that one would have a bias towards not just the language they want to develop in, but in the environment and type of applications they are likely to be working with. I think that would be the deciding factor?
Java - Coffee grinder
Python - Snake charmer
C - Optician
C# - Laser eye surgeon
C++ - Night vision goggle manufacturer
Ruby - Jeweller
.NET - Fisherman
the language itself doesnot matter so much, as the technology used does.
for example, a php/mySQL developer could easier convert to ASP.NET/MSSQL, than a .NET Windows Forms programmer will. I was both and felt more support from my php/mysql skills than my desktop C# programming ones.
But when the working process is annoying to you (e.g. you don't even want to go back to C++ coz it was hell for you), you better go find .NET desktop jobs - you will find that 90% of work done in the past by you in C++ was abstracted in .NET libraries and you'll get more fun from programming (though some people love that so-called 'c++ hell' for hacking).
as Chuck Jazdzewski fatherly said, (at the end of http://www.removingalldoubt.com/PermaLink.aspx/a32977e2-cb7d-42ea-9d25-5e539423affd ) , programming is fun, but shipping is your job. Joel Spolsky (www.joelonsoftware.com) has also nice entries about that.
Consider this when you are looking for a new working environment.
I've chosen Java. I know many more, but I think its the best decision to stick with one. If you work one year Java, one year c#, one year python you will not get a job as Java programmer that should have at least 3 years of experience.
For a coder, who's profession is based on it, is should be the main deciding factor. (...with Money a very close second!)
This may sound shallow but I tend to stick with the one I know best. Having spent several years in C# and .NET I wouldn't go back to PHP or Java, not because they are bad but rather I don't want to have to re-learn everything again... it would be sort of like starting all over again.

Simple Haskell graphics library? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I'd like to experiment with Haskell a bit, and I'm hoping to write a small 2D arcade game (Tetris or Breakout).
Can you recommend a simple graphics library that will help me to get started quickly?
Btw, I've been experimenting with SDL and wxWidgets, but haven't yet succeeded in running any samples because of dependency problems, working on it...
It's not exactly a "simple" library, but there is a lot of information online about OpenGL and GLUT, as well as some very good tutorials and a ton of example code.
The biggest issue you're up against is that the OpenGL and GLUT bindings in Haskell do not include the libraries that they bind to. (This is true for wxWidgets as well.) A lot of Linux distros come with OpenGL binaries bundled, but not Windows. The Haskell Platform was supposed to fix this, but it didn't seem to for me.
So, assuming you're installing on Windows, here's what I'd recommend you try:
Follow the directions in this blog to the letter. They're complicated -- involving installs of MinGW, MSys, and hand-compilation of a GLUT project from SourceForge, but it's the only way I've gotten OpenGL to work. I've now successfully installed on three separate machines, including XP and Vista, so I can safely say that these are very good directions.
Once it does work, check out these two awesome tutorials. They really opened my eyes about just how powerful Haskell can be when it comes to graphics. You'll find the code involved a lot simpler than you may have anticipated.
Check out the sample games on the Haskell OpenGL page. They're very experimental -- which is good, as it means less code to wade through than you'll find in a production system -- but they're also surprisingly sophisticated. (And yes, there's already more than one bare-bones Tetris implementation, but don't let that stop you.)
Another good source of sample code is Haskell's GLUT binding itself. Look for the examples directory and you'll find many ports of sample code from the OpenGL Red Book.
OpenGL is very stateful, so you may find the Haskell code a little daunting if you haven't fully grokked Monads yet. I'm using my OpenGL experiments as motivation to finally wrap my mind around the concept.
Good luck!
Have you perused the following lists:
Haskell Graphics Libraries:
There appears to be quite a few interfaces to OpenGL, SDL, and other graphic libs here.
Haskell GUI:
There's some wxWidget libs here as well.
Cairo Is written in C but has haskell bindings, Perhaps trying that might be a good idea. Ive only ever used its python bindings but those seemed to work well.

Resources