A great discovery!

Posted by
May 18th, 2012 2:49 am

So I know that a lot of you guys played my game, “Tiny’s World” (the one with the mouse), and I know that many [all] of you, including me, experienced severe lag. Though I didn’t put this in the game info, that game was the first that I have ever written. I’m here to say that I realised why the lag was so unbelievably high and the framerate, so low. Basically, I have been placing (“blitting”, as PyGame calls it) images on the screen, when actually I should be blitting sprites as they are all constantly moving. To fix this, I changed the pixel format of all my images using Surface.convert_alpha() which converts the Surface (image) to a sprite form. When I changed all my regular game objects, I increased my framerate from 15 to 17 FPS. This was much to my disdain, as I expected more. But then, I proceeded to change my (moving) background images to sprites, and I managed to get the framerate to in excess of 100 FPS! 😀

What I’m here to say is, I love ALL you guys and the LD. Thanks to all you guys who run it and contribute it. And thank you for all those helpful (constructively criticising) comments you made about my game and for all the suggestions which I am currently working on adding into my game.

And by the way, I am working on a post compo version of my game and if anyone is interested in it. It wont lag [or will lag much, much less] and I will be adding features you have expressed your interesting in in your comments when you played it.

Thanks again for the LD, as I’m learning more and more about Python; both its strengths and weaknesses.

If you want to play the old version of my game (for the time being, before I upload a new version), it’s here:


7 Responses to “A great discovery!”

  1. Topaz says:

    So yeah, leave a comment if you’re interested in my working on a post-compo version :)

  2. Thief says:

    It’s certainly an interesting tip about pygame, I’m just going to go look into it…

    • Topaz says:

      Just a tip, Surface.convert() [where you put the surface where it says Surface] converts the image to a sprite.
      Surface.conver_alpha() converts it into a sprite form WHILE maintaining the levels of transparency.

      • Topaz says:

        Image = pygame.image.load(‘resources/coolimage.png’)
        #currently it’s a surface in standard form
        #Now it’s a sprite with the same amount of transparency 😀
        #And with a sprite, you can still do this:
        screen.blit(Image, (X,Y))
        #except it’s much more efficient!

  3. MadGnomeGamer says:

    #210 Overall(Jam) 2.45 –your score

    #302 Overall 3.19 –my score

    How is it possible to score higher and rank lower? Could someone explain this to me?

Leave a Reply

You must be logged in to post a comment.

[cache: storing page]