pyganim | Sprite animation module for Pygame | Game Engine library

 by   asweigart Python Version: Current License: BSD-3-Clause

kandi X-RAY | pyganim Summary

kandi X-RAY | pyganim Summary

pyganim is a Python library typically used in Gaming, Game Engine, Pygame applications. pyganim has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Pyganim (pronounced like "pig" and "animation") is a Python module for Pygame that makes it easy to add sprite animations to your Pygame game programs. Pyganim works with Python 2 and Python 3. The mascot of Pyganim is a red vitruvian pig. Pyganim was written by Al Sweigart and released under a "Simplified BSD" license. Contact Al with any questions/bug reports: al@inventwithpython.com.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              pyganim has a low active ecosystem.
              It has 26 star(s) with 12 fork(s). There are 11 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 5 open issues and 0 have been closed. On average issues are closed in 1723 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of pyganim is current.

            kandi-Quality Quality

              pyganim has 0 bugs and 0 code smells.

            kandi-Security Security

              pyganim has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              pyganim code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              pyganim is licensed under the BSD-3-Clause License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              pyganim releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              pyganim saves you 622 person hours of effort in developing the same functionality from scratch.
              It has 1447 lines of code, 112 functions and 11 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed pyganim and discovered the below as its top functions. This is intended to give you an instant insight into pyganim implemented functionality, and help decide if they suit your requirements.
            • Download images from sprite sheet
            • Blits the animation to a destination surface
            • Return the surface of the given frame number
            • Return whether the animation is finished
            • Align all images in the current surface
            • Gets the maximum width of the animation object
            • Clears the transforms
            • Returns True if all the images have the same size
            • Return a copy of the object
            • Return a copy of the animation object
            • Flips the image
            • Scale all images
            • Scale the images
            • Propagate state to STOPPED
            • Rotates the image
            • Rotate the image
            • Return the frame of the current frame
            • Smooth all images
            • Make all transformed images
            • Set the state of the player
            • Set the current frame number
            • Pause playback
            • Create a copy of the animation object
            • Return the position at time t
            • Blit the animation to a destination surface
            • Set the elapsed time
            • Returns the elapsed time in seconds
            Get all kandi verified functions for this library.

            pyganim Key Features

            No Key Features are available at this moment for pyganim.

            pyganim Examples and Code Snippets

            No Code Snippets are available at this moment for pyganim.

            Community Discussions

            QUESTION

            Why does my sprite not constantly appear instead of animating through images when stood still
            Asked 2020-Feb-07 at 15:08

            So as I'm creating a game, my sprite is a bat. So far when the user holds down the left or right key, the animation works perfectly fine; however, I've tried to add in where the user is standing still, the 'flying' animation still plays, facing the direction the player was last facing so it doesn't look like the bat is simply just floating still.

            The outcome I get is the sprite doesn't appear on the screen unless I hold one of the movement keys down, when I just want it to be animating constantly, even when the user isn't moving.

            I can get the sprite to face a certain direction by displaying a single image when stood still, but not properly animate.

            I have heard of the library pyganim, but I can't use it due to the environment I'm in, so I'm struggling with options.

            Here's the relevant code for the draw function:

            ...

            ANSWER

            Answered 2020-Feb-07 at 15:08

            Because when standing still, you set:

            Source https://stackoverflow.com/questions/60115822

            QUESTION

            Exception using sprite with pyganim
            Asked 2018-Oct-17 at 21:31

            Good day. I'm trying to write a platformer. Basic actions like creating a map, creating a character, interaction and camera movement are already implemented. There are 4 files:

            Game.py:

            Responsible for creating the window, and drawing the rest. Also for enabling and disabling flags when performing any actions.

            ...

            ANSWER

            Answered 2018-Oct-17 at 21:31

            In the source for the Pyganimation Class frames are defined as each element of a list of tuples. In your program this list is called ANIMATION_STAY.

            In ANIMATION_STAY you set the value of your delay to be 0.1, this is your mistake. ANIMATION_DELAY is supposed to be an integer, not a float or double, so use a whole number instead of your 0.1.

            Later in the source when it does this: assert frame[1] > 0, 'Frame %s duration must be greater than zero.' % (i), it throws an error. Your delay needs to be >0, but it is getting rounded down to 0.

            Source https://stackoverflow.com/questions/52859109

            QUESTION

            Cant get animation to stop after certain period of time
            Asked 2018-Feb-05 at 17:11

            I'm trying to run some animations using pygame and pyganim and I want them to run when a key is pressed for a certain period of time and then stop. This is what I've got so far but I cant get the if block at the bottom to trigger, which should stop the animation. I'm assuming the time_now variable keeps updating so it's never greater the time_end. What is wrong with my code?

            ...

            ANSWER

            Answered 2018-Feb-05 at 17:11

            First, your indentation is wrong. The line while True: should not be on the same indentation level as the second line.

            Your example doesn't work because of

            Source https://stackoverflow.com/questions/48614754

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install pyganim

            You can download it from GitHub.
            You can use pyganim like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/asweigart/pyganim.git

          • CLI

            gh repo clone asweigart/pyganim

          • sshUrl

            git@github.com:asweigart/pyganim.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Game Engine Libraries

            godot

            by godotengine

            phaser

            by photonstorm

            libgdx

            by libgdx

            aseprite

            by aseprite

            Babylon.js

            by BabylonJS

            Try Top Libraries by asweigart

            pyautogui

            by asweigartPython

            pyperclip

            by asweigartPython

            PythonStdioGames

            by asweigartPython

            my_first_tic_tac_toe

            by asweigartPython

            humre

            by asweigartPython