Python and Pygame: Using sprite animations in your game

Pubblicato il: 11 novembre 2021
sul canale di: Chris Strange
446
10

Ever wondered how to animate a sprite using Python and Pygame? Here’s how! This isn’t the only way of doing it, but it is the easiest way I’ve found. I will step through how to create a character that has animations for walking forward, backward, left and right. The PC can also cast a spell, swing a sword and fall down.

This video has six parts that have to do with how to create an animated sprite, working from the simplest case to the final result.

00:00 Introduction
00:20 Overview
01:10 Tutorial 1 -- One image, filled background
05:15 Tutorial 2 -- Animated player character (one animation--walking)
08:15 Tutorial 3 -- Added a background
12:04 Tutorial 4 -- Give player character six possible animations instead of just one
20:40 Tutorial 5 -- Make sure the character cannot travel off the edge of the window
22:30 Tutorial 6 -- Give the player character a total of 22 animations.

This is my home on Twitter (@Strange451):
  / strange451  

Here is my code on GitHub:
https://github.com/poly451/Tutorials/...

This is the animation I used (Baldric):
https://opengameart.org/content/four-...

Here are links to the videos in my ongoing "How to create an RPG with Python and Pygame" series:
Part 1:    • Python: Creating a Grid With Pygame, Part 1  
Part 2:    • Pygame: Creating a Grid, Part 2  
Part 3:    • Python: Creating a Grid, Part 3  
Part 4:    • Python: Creating a Grid, a Player and a Mo...  
Part 5:    • Pygame: Creating an RPG with Pygame, Part 5  
Part 6:    • Creating an RPG with Pygame and Python, Pa...  


In questa pagina del sito puoi guardare il video online Python and Pygame: Using sprite animations in your game della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Chris Strange 11 novembre 2021, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 446 volte e gli è piaciuto 10 spettatori. Buona visione!