I'm making a game sprite, with animations for transitioning to different states, such as idle, sleeping, etc. I'm wondering what the most efficient way to play the animations is. As of now, I have a couple of ideas:  store all frames as separate PNG images, and display only the frames for the current state (e.g. play frames 1-5 for idle, 5-10 for transitioning, 10-15 for sleeping) make the animations into GIFs and play the one corresponding to the current state. merge them all into a spritesheet.  Please let me know which would be the best approach, or if there's a better way to do things. I'm new to handling images and animation with code, so I'm not sure what the advantages and disadvantages are. Thanks! In case the information helps anyone, I'm planning to use Python for this (although I could also do Java or C++, if there are good solutions in those languages), and the sprite image size isn't large, it's pixel art.
I have seen many examples of how to render sprites from a spritesheet but I havent grasped why it is the most common way of dealing with sprites in 2d games.  I have started out with 2d sprite rendering in the few demo applications I've made by dealing with each animation frame for any given sprite type as its own texture - and this collection of textures is stored in a dictionary. This seems to work for me, and suits my workflow pretty well, as I tend to make my animations as gif/mng files and then extract the frames to individual pngs.  Is there a noticeable performance advantage to rendering from a single sheet rather than from individual textures? With modern hardware that is capable of drawing millions of polygons to the screen a hundred times a second, does it even matter for my 2d games which just deal with a few dozen 50x100px rectangles?  The implementation details of loading a texture into graphics memory and displaying it in XNA seems pretty abstracted. All I know is that textures are bound to the graphics device when they are loaded, then during the game loop, the textures get rendered in batches. So it's not clear to me whether my choice affects performance.  I suspect that there are some very good reasons most 2d game developers seem to be using them, I just don't understand why.
Travel duration from Earth to a star at 9.8 m/s² acceleration Object glitching/dissapearing in render due to parenting problems I have completed my animation but I realised when I render it that one of the propellers blades starts to glitch. On some frames it is in shot and some it is out of shot and this is really strange. These 'blades' are both parented to the same 'propeller' and the 'propeller' is parented to the middle ball. I have baked the animation through so this shouldn't be a problem. These propellers are passive rigid bodies. I have tried to figure out this problem and I just can't get to a solution. I've never had it where a rigid body object glitches out like that in the rendered animation, it's almost like it's jumping, which on the render these frames show the object as invisible. The video attached will show.   If anyone has experienced problems like this or knows an answer to my dilemma that would be greatly appreciated, thanks! I want to write several classes, most of them will use KOMA classes as base class.  However I stumbled upon the problem that some options (mainly concerned with layout) are not processed if given in the wrapper class:    \begin{filecontents}{test.cls}     \ProvidesClass{test}[2015/01/01]     \DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrartcl}}     \ProcessOptions\relax     \LoadClass[paper=a5]{scrartcl}   \end{filecontents}  \documentclass{test}  \usepackage{blindtext}  \begin{document}   \section{Test}   \blindtext \end{document}   This results in   LaTeX Warning: Unused global option(s):     [paper=a5]  If i give the option as \documentclass[paper=a5]{test} it is used correctly, because I pass the options to scrartcl. However I want to change the defaults for the layout.   How can I achieve this? US doctor working in Tripoli wants me to open online account default constructor for int This might seem like a very simple question, but what is the easiest way to turn a normal vertical list into a horizontal one? Reference template variable within Jinja expression How can I list all the printable ASCII characters in the terminal? How are constraint forces represented in Lagrangian mechanics? Comparing integers: arithmetic expression or conditional expression In Bash, two integers can be compared using conditional expression     arg1 OP arg2      OP is one of -eq, -ne, -lt, -le, -gt, or -ge. These   arithmetic binary operators return true if arg1 is equal to, not equal   to, less than, less than or equal to, greater than, or greater than or   equal to arg2, respectively. Arg1 and arg2 may be positive or negative   integers.   or arithmetic expression:     &lt;= &gt;= &lt; &gt; comparison      == != equality and inequality   Why do we have two different ways for comparing two integers? When to use which?  For example, [[ 3 -lt 2 ]] uses conditional expression, and (( 3 &lt; 2 )) uses arithmetic expression. Both returns 0 when the comparison is true  When comparing two integers, can these two methods always be used interchangeably? If yes, why does Bash have two methods rather than one? Got French Schengen visa but no "VIS" after giving fingerprints How do I get a tourist visa/card for Cuba? How do I get a tourist visa (or a tourist card) for Cuba?  I live in the Netherlands, but I'm not a Dutch citizen, I have an Italian passport. MCMC in a frequentist setting I have been trying to get a sense of the different problems in frequentist settings where MCMC is used. I am familiar that MCMC (or Monte Carlo) is used in fitting GLMMs and in maybe Monte Carlo EM algorithms. Are there more frequentist problems where MCMC is used? Number Theory: which primes are a sum of two squares? Problem: show that if the prime $p = a^2 + 5b^2$ then $p \equiv 1 \textrm{ or } 9 \pmod{20}$.  Is there any other way to prove this other than to check each case $p = 1, \ldots, 19 \pmod{20}$ and show that only 1 and 9 work? How to migrate from test environment to production environment? The migration is from the local environment to the production environment. The production environment has run some time and created a lot of articles.   In order to add new things to my site, I added a custom theme and installed CCK, Views and other modules in my local test environment. Now that the local test environment is finished, how do I migrate it to the production environment, without destroying the content of its database? Why is it possible to answer a question twice? You normally answer a question and you have the opportunity to answer again. The second time, a message is shown suggesting the use of the edit tool, but I think it's kind of wrong. I mean, if you answer something and then you want to say anything else you know that you must use edit.  Why not disable the answer button if you already have an answer? Chocolate and oil mixed When I melt 16 oz of chocolate I add 4 oz of oil how long can I keep this and how should it be stored. Someone said something about botulism ?? Flag indicator present on Meta, but no flags visible It looks as if the 10k-tools flagged post list is b0rken.  Next to the review link in the toolbar there is a flag counter showing there are 10 flags to be reviewed:    Clicking on that flag counter leads to an empty page:        The moment I visit that page (through clicking on the flags counter, or by going to the review queue first then clicking on Tools, selecting the flags tab if not already selected), the flags counter disappears from the toolbar:    but after a while (half an hour, an hour?) the flag count re-appears in the toolbar.  Either the counter is wrong (presumably taken from a Redis cache somewhere) or the 10k flag review page is falling over every time someone tries to load it.  This at first appeared to happen only on Meta, on Stack Overflow the flags page has plenty to review. However, there are now  on Stack Overflow. Alert on edit after a downvote I wonder if it would be possible to extend the current notification system.   Namely, if I downvote a question and that thing had an edit, I'd be happy to see that in my inbox. As possibly the cause for downvote was cleaned up and it should be undone. Headphones microphone is not working I'm trying to use my headphones with my Ubuntu 13.10. My headphones are Nokia BH-905i, which can be connected via Bluetooth or green+pink wires.  If I use bluetooth, voice quality is terrible or microphone doesn't work. If I try to choose "Headset" option from In and Out tabs in Sound Settings, they're disabling each together.  In Out tab, I'm using "High sound quality A2DP", because it betters voice quality.  How could I get my microphone working? Sound out works fine.