Getting something similar on a Z80 or a 6502 using assembly was lot more complicated to learn back then. The power under your fingers is amazing nowadays you lucky people !
Hello, Do you know if it is possible to have a menu page before opening the game ? I tried some tutorials but it doesn't work with your programme. Secondly I am working on a project for school which is an endless scrolling runner game based with movements of the player in front of his camera using open CV and Tkinter. Is it possible to combine your pygame functions and replace the "if keypressed" by something like "if person head position "left" " ?
How do you add things like objects, collisions and borders to the map? Like if I wanted to add a tree that a player can't walk through, or a border around the map so the sprite does not walk off/repeat the background.
Hello! New to Python and Pygame, and trying to add the function to my own. Would you mind explaining how to add the Py function from your github to my code?
Hey I appreciate your work but I'm facing a problem sir I'm creating a kinda space race game but when I use your scroll fx it is throwing an error AttributeError: 'NoneType' object has no attribute 'scroll' please help me, sir
sir can u tell ? how we can add a wall where the sprite cannot cross the wall and it has limited space to walk pls sir i got stuck in it pls I need your help I am waiting for your help
Is there a way to set an image on the background that wont scroll with the character sprite? when i add an image like an obstacle for example i put a sprite of some spikes but they move with the character sprite and it looks like hes chasing the spikes instead of running into them. Thank you.
That's going to take some extra work, and the library doesn't really do that yet. I'm hoping to make an update soon. You'd have to recalculate the new position for the obstacles each time you scroll the background.
Oh...ok no worries. Thank you for the reply. I used your library for my very first pygame scrolling game for a bootcamp I’m in and i haven’t completed it yet but your functions are awesome and made things very simple. Thanks again.
Hi Paget, how about if I want to use the mouse to move. So if I move my mouse left it will replace the left key, and move right for the right key, etc. Could you give me some pointers?
The functions mouseX() and mouseY() will tell you the mouse position. There are several ways that you might use that to affect character movement. Does the player need to keep moving the mouse left to move the character? Or would you just move the pointer to the left side of the screen?
@@PagetTeaches I'm thinking of making a first person perspective space combat game. Will use the mouse to navigate up down right and left to follow the enemy and give a false sense of being in a 3D space
@@ChandraMarsono so you're probably wanting to see if mouseX and mouseY are higher or lower than the centre, and treat those like key presses. Maybe adjust x/y speed based on distance from the centre point.
hi , kinda of a python newb can you plz tell me why i cant do this cause i get an error saying whenever i enter setBackgroundImage: background.setTiles(img) AttributeError: 'NoneType' object has no attribute 'setTiles'
Hi, fantastic video. How do you create the gif's like the links.gif on your GitHub page, if I create a series of png files to show a character walk and upload them to an online gif converter, the result does not play like the links.gif walk in this video, you get a small segment of the first image and that's it.
Great work! I have a quastion. Is it possible to make the background fit the screen? in pygame I do it like this: bg = pygame.transform.scale(pygame.image.load('img\\bg.gif'), (resx, resy)) screen.blit(bg, (0, 0)) How can I do this with pygame_function?
@@StevePagetWorld Thnaks for your prompt reply. It must be possible to use pygame_functions and pygame simultanios. Maybe I need to know how the screen object is called. in the class Background I found this: screen.blit(self.tiles[0][0], [0, 0]) But if I type in screen.blit(bg) an error appears. Or maybe like this: setBackgroundImage(bg) This show me an error that the type of bg is NONE and it shouldn't be. Sry but I'm really new to coding, I only did a few Arduino things before. If you like the idea you could add this feature. setBackgroundImage('filename.png', scale = True)
hi . when i use this setBackgroundImage on my python 3..8 with my pygame 3 and i have this error " NameError: name 'setBackgroundImage' is not defined" .Send help please. Thankyouu
Great work with pygame functions. I'm new to python though. And like to make an rpg. besides the "touching" function, do you have other function for collision that detects blocking? Or can it be achieved using the "touching" function? Btw, thank you for the effort. I love using your script
Touching would do that for you, I think. Do you mean you want to see if the player has run into a wall or similar blocking item? What I would do is move the player sprite, but not update the display straight away. Check to see if the player is touching any blocking items (touching will detect other sprites even if the display hasn't updated yet) and if they are, move the player back as though the move never happened. Unless you're taking about walls that are printed in the background image. In which case touching won't detect that. It is possible to make invisible rectangles that represent blocked areas, and detect if the player is touching those. Is your background static (so the player moves between areas on different screens) or are you planning to scroll it?
@@PagetTeaches Hi, thank you for quick response. I'm planning to scroll it and found a demo on your repos. Btw, thank you for the idea. If you have spare time, could you please make video about blocking. Like this current video, but those edges could be walls. Or atleast add a repo on your github. Sorry for the request. And thanks again.
Btw, If I can finish this project, I'm planning to develop it. I'll use your pygame functions instead of using pygame directly(It is really a pain in the bangs 😂 ). So yeah, hopefully your script will have more updates.
Paget Teaches... I'm having trouble with drawing rectangles that move with the background image. Let's say I have a large background image that isn't tiled, and I wanted to block certain areas like walls or water. How would I draw a polygon that moves with the background image?
Another great video, could you show/explain how you would go about stopping the character from walking through certain places, i.e. walls. So that the character would stop when they hit a wall and not just walk across the top of it. Many Thanks!
That's going to take some work! I'm planning a new version that has a movable camera and tracks objects in the virtual world. It will take some time to make, but it should be good.
the character's sprites are soooooooo smooth.
You got a like for saying "Hello World"
That's what I was looking for! Keep it up, man
Thanks for creating pygame_functions. It helps me very much
Getting something similar on a Z80 or a 6502 using assembly was lot more complicated to learn back then. The power under your fingers is amazing nowadays you lucky people !
These python_features videos are priceless!
Hello, Do you know if it is possible to have a menu page before opening the game ? I tried some tutorials but it doesn't work with your programme. Secondly I am working on a project for school which is an endless scrolling runner game based with movements of the player in front of his camera using open CV and Tkinter. Is it possible to combine your pygame functions and replace the "if keypressed" by something like "if person head position "left" " ?
If I have a static background with a car that moves on all sides and I want to use a scrolling background that I need, please, I need that help.
How do you add things like objects, collisions and borders to the map? Like if I wanted to add a tree that a player can't walk through, or a border around the map so the sprite does not walk off/repeat the background.
i get AttributeError: 'NoneType' object has no attribute 'scroll'
Very cool videos! Many thanks for your consistent effort.
getting a Attribute error: NoneType has no attribute setTiles when setting background image. Any ideas?
i have that issue too
@@fishmaster-fq5fg yup, will probably be fixed with the next update :)
ya same problem here
Hello! New to Python and Pygame, and trying to add the function to my own. Would you mind explaining how to add the Py function from your github to my code?
Hey I appreciate your work but I'm facing a problem sir I'm creating a kinda space race game but when I use your scroll fx it is throwing an error
AttributeError: 'NoneType' object has no attribute 'scroll'
please help me, sir
This sounds like the sort of thing that would not be possible to fix without seeing the code. You could maybe post it on a codepile? www.codepile.net/
sir can u tell ? how we can add a wall where the sprite cannot cross the wall and it has limited space to walk pls sir i got stuck in it pls I need your help I am waiting for your help
its been 3 years, have you figured it out?
Is there a way to set an image on the background that wont scroll with the character sprite? when i add an image like an obstacle for example i put a sprite of some spikes but they move with the character sprite and it looks like hes chasing the spikes instead of running into them. Thank you.
That's going to take some extra work, and the library doesn't really do that yet. I'm hoping to make an update soon.
You'd have to recalculate the new position for the obstacles each time you scroll the background.
Oh...ok no worries. Thank you for the reply. I used your library for my very first pygame scrolling game for a bootcamp I’m in and i haven’t completed it yet but your functions are awesome and made things very simple. Thanks again.
If I had more than one backgroundtile, how would I reference the x and y value of a tile that isn't on the screen to place sprites?
Hi Paget, how about if I want to use the mouse to move. So if I move my mouse left it will replace the left key, and move right for the right key, etc. Could you give me some pointers?
The functions mouseX() and mouseY() will tell you the mouse position. There are several ways that you might use that to affect character movement. Does the player need to keep moving the mouse left to move the character? Or would you just move the pointer to the left side of the screen?
@@PagetTeaches I'm thinking of making a first person perspective space combat game. Will use the mouse to navigate up down right and left to follow the enemy and give a false sense of being in a 3D space
@@ChandraMarsono so you're probably wanting to see if mouseX and mouseY are higher or lower than the centre, and treat those like key presses. Maybe adjust x/y speed based on distance from the centre point.
@@PagetTeaches I'm a full time designer, just started to learn python. Mind if I ask questions if I get stuck?
@@ChandraMarsono I can't guarantee a quick reply, but sure!
Hey great vid! if you can i need help..when i use the scrollbackraound func its returning me ' Nonetype error object has no attribute scroll'
hi , kinda of a python newb can you plz tell me why i cant do this cause i get an error saying whenever i enter
setBackgroundImage:
background.setTiles(img)
AttributeError: 'NoneType' object has no attribute 'setTiles'
There will be a underscore after the set i.e. set_Tiles(img)
Hi, fantastic video. How do you create the gif's like the links.gif on your GitHub page, if I create a series of png files to show a character walk and upload them to an online gif converter, the result does not play like the links.gif walk in this video, you get a small segment of the first image and that's it.
I made it manually in a graphics programme. I don't do anything special other than spacing them evenly
Great work!
I have a quastion. Is it possible to make the background fit the screen?
in pygame I do it like this:
bg = pygame.transform.scale(pygame.image.load('img\\bg.gif'), (resx, resy))
screen.blit(bg, (0, 0))
How can I do this with pygame_function?
there's nothing like that at the moment, no. Scaling the background dynamically in the game is probably a rare request, to be honest.
@@StevePagetWorld
Thnaks for your prompt reply.
It must be possible to use pygame_functions and pygame simultanios.
Maybe I need to know how the screen object is called.
in the class Background I found this:
screen.blit(self.tiles[0][0], [0, 0])
But if I type in screen.blit(bg) an error appears.
Or maybe like this:
setBackgroundImage(bg)
This show me an error that the type of bg is NONE and it shouldn't be.
Sry but I'm really new to coding, I only did a few Arduino things before.
If you like the idea you could add this feature.
setBackgroundImage('filename.png', scale = True)
hi . when i use this setBackgroundImage on my python 3..8 with my pygame 3 and i have this error " NameError: name 'setBackgroundImage' is not defined" .Send help please. Thankyouu
Have you downloaded the pygame_functions library and imported it first? See the link in the description for the download.
Great work with pygame functions. I'm new to python though. And like to make an rpg. besides the "touching" function, do you have other function for collision that detects blocking? Or can it be achieved using the "touching" function? Btw, thank you for the effort. I love using your script
Touching would do that for you, I think. Do you mean you want to see if the player has run into a wall or similar blocking item? What I would do is move the player sprite, but not update the display straight away. Check to see if the player is touching any blocking items (touching will detect other sprites even if the display hasn't updated yet) and if they are, move the player back as though the move never happened.
Unless you're taking about walls that are printed in the background image. In which case touching won't detect that. It is possible to make invisible rectangles that represent blocked areas, and detect if the player is touching those.
Is your background static (so the player moves between areas on different screens) or are you planning to scroll it?
@@PagetTeaches Hi, thank you for quick response. I'm planning to scroll it and found a demo on your repos. Btw, thank you for the idea. If you have spare time, could you please make video about blocking. Like this current video, but those edges could be walls. Or atleast add a repo on your github. Sorry for the request. And thanks again.
Btw, If I can finish this project, I'm planning to develop it. I'll use your pygame functions instead of using pygame directly(It is really a pain in the bangs 😂 ). So yeah, hopefully your script will have more updates.
Paget Teaches... I'm having trouble with drawing rectangles that move with the background image. Let's say I have a large background image that isn't tiled, and I wanted to block certain areas like walls or water. How would I draw a polygon that moves with the background image?
Keep it up! I need more! I love you as I love python!
Another great video, could you show/explain how you would go about stopping the character from walking through certain places, i.e. walls. So that the character would stop when they hit a wall and not just walk across the top of it. Many Thanks!
That's going to take some work! I'm planning a new version that has a movable camera and tracks objects in the virtual world. It will take some time to make, but it should be good.
Hi! Professor. I'm from Brasil!
Olá! como você está
@@PagetTeaches where are you, our legend? :)
thanks for the video.
at 2:11 the sprite disappeared
lol
Good tutorial
sir pls help me
Thank you for your contributions
I do character mashups😊
a subscriber here
Why you don't have any subscriber
I think this must be a bug on TH-cam's reporting. I have a couple of thousand, last time I checked.
thanks