Thank you for watching my video and I really hope you found something useful.
Pygame on Facebook: https://www.fb.com/groups/pygame
Hello to you! In this episode I’ll be examining sprite
sheets and blitting individual cells to the display
surface.
If you’d like to know how to install and run your first Python Pygame script then watch my first video here: https://youtu.be/XAcnyCFRRpw
Download the script and image files for this tutorial…
Nice and useful video, thanks!
Small note: in Python 3.7 you must write index//cols*h instead of index/cols*h, else you will get a shifted frame from index 1
surface.blit? where did you define "surface" ?
Great video and great explanations! I get an error that says HW is not defined when i use this. Anyone know how to fix it?
While entering the blit in the draw function I'm getting an error that the rect style argument is invalid.could anyone help
Awesome tutorial.. Not only do you show what to do, you explain why.. that is sooo lacking in most tutorials. Appreciate the efforts, New subscriber here, looking forward to watching all your tutorials,
Great stuff, clear explanation and very informative. Thank you!
Good
Wow thanks !
So thats what spritesheets are for… was getting frustrated cutting and pasting the images individually into my game
Human being reporting in, thanks for making this, very helpful
I have always been wondering how to use sprite sheets, and I could never figure it out. Thank you! You have saved me from a lot of headaches, and have also given me new power and energy to work on my game!!
Just another human being watchin your vids
Wp
great explanation
Greetings, I'm getting into python codding and found your channel. First off thank you for your great videos. Second is a question. Are you a Ham Radio operator as wall as a code writer? I ask due to you intro. I love sending Morse Code in CW Mode and was instantly intrigued. Thanks and 73
Hello!
Should you help me to understand handle and offset? I saw the video n times and don't understand.
I can read better than listen. So if you can help me, I will so glad.
About my text, I hope you can understand.
Thanks!
Thank you !
Hi, first, AMAZING VIDEO! Second XD, I am experiencing an error when attempting to run the script (I am using Python 3.x and I think almost everything is adjusted for 3):
local variable 'index' referenced before assignment
and it is having the issue with:
Rosa.draw(gameDisplay,index % Rosa.totalCellCount,HW,HH,CENTER_HANDLE)
I can send the rest of the script if needed, I have this:
Rosa = spritesheet("ROSA PARKS-SPRITE SHEET.png",1,3)
CENTER_HANDLE = 3
index = 0
written below the class spritesheet but, outside of the class/functions. Any and all help will be very much appreciated!
Thanks a lot…What should i do to display a random part of the image as a stationery image instead of spritesheet?
Awesome video… I want to display random sprite instead of making it move. What should I do ?
Awesome video, very helpful. Thanks a lot!
Hello, love this tutorial! However, how do we do collision using this class?
Hey man, can you also do a vid about pygame's built in sprite functions? https://www.pygame.org/docs/ref/sprite.html#pygame.sprite.Sprite
What is the meaning of handle function?
your code doesnt work on python 3.2 but good video for the explainations
How would I be able to make them bigger? I am using a 16 bit spritesheet and am wondering how to scale them bigger without stretching them in my drawing program.
Thanks for these videos. Just discovered your channel and it has helped me so much. I am working on a 2D platform type game with a couple of my nerd-friends. Subscribed! 🙂
For me as a total noob it was a little hard to follow first, but I sticked to the end and then broke down every line of the code to understand it. Then I've removed the handle method, since it was not necessary for my purposes and the code looked much more simple! I wished you had skipped this part in the first place, but dude, your tutorial was so awesome! I dont understand why you have so few subscribers. Thanks!
That i%c, i/c trick is very clever. is that a standard thing or did you come up with that?
If I wanted to run my game at say 120fps but I didn't want to cycle through my walking sprites that fast how would I put in a delay between sprites without delaying the whole program? So that maybe I cycle through my sprites at 8 fps? Thanks!
When I run this, the sprite looks like it is just scrolling down. I copied the script exactly from your google drive and cannot tell what is wrong. Thanks for you response!
I wonder if you can solve a problem for me relating to spritesheets. I've been able to colour the unwanted background of a sprite in alpha when loading it from its own file, but having loaded an image from a spritesheet, suddenly the unwanted colour reappears. Any ideas?
I don't know what happened! I followed your instructions exactly but with my own number of columns and heights, but when I run the program, not all of the frames are shown. The project is in the folder: https://drive.google.com/open?id=0B7npJltzvD1xWXJoZWVEdVNDUW8 I would appreciate any help you can offer but I understand that you can't help everyone. The spritesheet is in the "Art" folder. 🙂