omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Scene module animated spriteNode

    Pythonista
    gif scene gif scene animation animation scene
    2
    5
    3908
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Drizzel
      Drizzel last edited by

      Hey guys,
      So, im creating a little game at the moment, and I'm trying to have a character walking over the screen. My issue is that I cannot get the walking animation to run. Let's say I have this array of all of the imageNames of my animation sequence Images = ['Walking1.png', 'Walking2.png', 'Walking3.png'], how do I get them to show in order as a walking animation that can still be navigated around the screen with commands like self.WalkingAnimation.run_action(Action.move_to(400, 300, 5)?

      I tried using a gif as a spriteNode, which only showed the very first 'image' of the gif, and the gif was definitely imported correctly
      Anyone has any idea how to fix this?
      Thanks a lot,
      Drizzel

      1 Reply Last reply Reply Quote 0
      • JonB
        JonB last edited by

        If you go to the Examples/Game Tutorial folder in your pythonista library, you will find a fully worked example game, from start to finish.

        The tutotial part 3 covers exactly this topic.

        1 Reply Last reply Reply Quote 0
        • Drizzel
          Drizzel last edited by

          Yeah that's how I learned just about everything I know. The sprites in themselves are still sprites, consisting only of a singe image, and I was wondering how to have a character with for example moving legs when he walks around

          1 Reply Last reply Reply Quote 0
          • JonB
            JonB last edited by JonB

            You have to cycle the texture, just like in tutorial 3. You simulate moving legs by cycling through a sequence of static images. In the tutorial, whenever the sprite moved 40 pixels, the texture changed.

            Alternatively. you could have separate sprites for the legs, and use actions to rotate/pivot the legs.

            1 Reply Last reply Reply Quote 0
            • Drizzel
              Drizzel last edited by

              Awesome, it finally works :D

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Powered by NodeBB Forums | Contributors