Thanks for watching the video! If you found it useful, please leave a like on the video, and if you want to see more Pygame tutorials, then be sure to subscribe! The next Pygame RPG Tutorial will be out next week.
Your channel is very underrated. Like it should be illegal for your channel to not have a million subs You are helpful, informative, very clear and easy to understand. Thank you for helping me out!
Brilliant !!! The description of how everything gets called is helping me a lot. I could never make sense of it before myself. I look forward to seeing the next tutorial.
Beautiful, i commented your first part on the tutorial with some problems. Got that fixed and added some music to it aswell. Im hoping next part comes out soon! Big ups on the tutorial!
@@ShawCode Cheers. Its easy when its fun. Any idea of when #3 is coming cause im kinda stuck. I've successfully replaced the black bakground with a proper one and the red block with random sprite. Now im trying to get animations on the player to work, but i cant seem to figure it out. Would love some insight from you!
The 3rd tutorial is out, and the next one will be out this weekend. It'll show you how to use images with sprites, and then we might move onto animations.
Hi there. At 6:38, can you clarify how the player object gets added to the all_sprites group with line 11? From my understanding, doesn't self.groups get a copy of the value game.all_sprites? Or does line 12 have to do something with adding the player object to all_sprites? Otherwise, great tutorial and thank you!
@@yousefangox3022 It appears that your update and movement methods are inside of the init method - you need to have them outside of the init method, but still inside the player class.
Did everything up to this point in pygame 2.4.0. on python 3.11.4. No errors. When I run it, the player doesn't move when I press a key. What happened?
The tutorial's amazing, and I'm glad that I found it as I've been wanting to create something of a RPG as I'm learning Python. Though, for some reason whenever I press my arrow keys, there's no movement. Would I just have to change 'LEFT' to 'A' or something like that? update: switched the controls to fit a AWSD format; but for some reason, it doesn't move up or down
Hi! I have a prolem and please answer. From "self.events()" to i don't know where it gives me the next error: self.run = False TabError: inconsistent use of tabs and spaces in indentation I erased the hole line and rewrite it until here. What do I do?
I am using Sublime text 3 and i know what tabs and spaces are and how to find which one which but i don't really want to practically rewrite the whole code
Something went wrong, help me, I did it like in the video. self.groups = self.game.all_sprites, self.game.blocks AttributeError: 'Game' object has no attribute 'all_sprites'
Your tutorials are really great and easy to follow, thanks :) If I wanted to add a system where pressing space caused the player sprite to jump, how would I go about doing that? Thanks again!
Thanks! I'm not sure how jumping would logically work in a top-down RPG like this, but you would have to get the space keypress first, and then once the keypress is detected then a method would be called, maybe making the player appear bigger or something like that?
Thanks! I do, you can join here: discord.com/invite/RvNFCymnPn. It is paused at the moment, so you can't talk, but you can still join. It will be open soon.
Thanks for watching the video! If you found it useful, please leave a like on the video, and if you want to see more Pygame tutorials, then be sure to subscribe! The next Pygame RPG Tutorial will be out next week.
Hello Shaw!
I somewhere made a mistake so could you upload your codes so I can find my mistake?
Your channel is very underrated. Like it should be illegal for your channel to not have a million subs
You are helpful, informative, very clear and easy to understand. Thank you for helping me out!
Thanks, I'm glad you are finding these useful!
This is my favorite tutorial.
I hope you will have 1m subs.
from algeria
Thanks, I'm glad you found it useful!
You have a real talent for explaining things! Great tutorials, looking forward to the rest of the series!
Thanks, the next tutorial will be coming out today!
Great video man, i've gotten into a pickle trying to use pygame but then you cam along and helped a lot
These tutorials are wonderful! Hands-down, the most easy-to-understand. Keep up the good work, man!
Thanks, I'm glad you find them useful!
Brilliant !!! The description of how everything gets called is helping me a lot. I could never make sense of it before myself. I look forward to seeing the next tutorial.
Thanks! It's good that you understand it now. The next tutorial will be out next weekend!
I have to say, your style has been better than TechWithTims version of Pygame tutorial. Glad I found your content.
Thanks!
Nice stuff mate! Greetings from Chile 🤘
Hey, thanks!
Beautiful, i commented your first part on the tutorial with some problems. Got that fixed and added some music to it aswell. Im hoping next part comes out soon! Big ups on the tutorial!
Thanks, it's cool that you managed to fix the bug!
@@ShawCode Cheers. Its easy when its fun. Any idea of when #3 is coming cause im kinda stuck. I've successfully replaced the black bakground with a proper one and the red block with random sprite. Now im trying to get animations on the player to work, but i cant seem to figure it out. Would love some insight from you!
The 3rd tutorial is out, and the next one will be out this weekend. It'll show you how to use images with sprites, and then we might move onto animations.
@ShawCode - Thank you for this channel. You create some really high class material - Very easy to follow. Cheers!
You're very welcome!
Hi there. At 6:38, can you clarify how the player object gets added to the all_sprites group with line 11? From my understanding, doesn't self.groups get a copy of the value game.all_sprites? Or does line 12 have to do something with adding the player object to all_sprites? Otherwise, great tutorial and thank you!
I think it's line 12 but I'm not sure
the movement doesn't work for me
i check it multiple times but everything should be fine
please if you now help me
Please could you copy and paste your code for me to look at?
@@ShawCode class Player(pygame.sprite.Sprite):
def __init__(self, game, x, y):
self.game = game
self._layer = PLAYER_LAYER
self.groups = self.game.all_sprites
pygame.sprite.Sprite.__init__(self, self.groups)
self.x = x * TILESIZE
self.y = y * TILESIZE
self.width = TILESIZE
self.height = TILESIZE
self.x_change = 0
self.y_change = 0
self.facing = 'down'
self.image = pygame.Surface([self.width, self.height])
self.image.fill(RED)
self.rect = self.image.get_rect()
self.rect.x = self.x
self.rect.y = self.y
def update(self):
self.movement()
self.rect.x += self.x_change
self.rect.y += self.y_change
self.x_change = 0
self.y_change = 0
def movement(self):
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT]:
self.x_change -= PLAYER_SPEED
self.facing = 'left'
if keys[pygame.K_RIGHT]:
self.x_change += PLAYER_SPEED
self.facing = 'right'
if keys[pygame.K_UP]:
self.y_change -= PLAYER_SPEED
self.facing = 'up'
if keys[pygame.K_DOWN]:
self.y_change += PLAYER_SPEED
self.facing = 'down'
@@yousefangox3022 It appears that your update and movement methods are inside of the init method - you need to have them outside of the init method, but still inside the player class.
@@ShawCode thank you so much
it works
As always, can't wait for the next episode!
It will be coming out this weekend, or at the beginning of next week!
Subbed! Great content, young man! 🙌🌟👏
Thanks for the sub!
Very nice, Shaw! Thank you a lot, from Brazil.
Glad you liked it!
I have a question: How to make characters move keys be w up, s down, a left, d right, and not in capital
instead of pygame.K_UP, pygame.K_LEFT e.t.c
you have to do pygame.K_w, pygame.K_a e.t.c
make sure the letters are lowercase
error pygame.sprite has no attribute sprite
please help me
hey bro, very nice thank you so much for your great videos, goodluck
Glad you like them, thanks!
@@ShawCodeyour welcome bro, 👌
Very helpful thanks very much keep up the good work,
Btw do you have a Patreon?
I'm glad you found the tutorial useful! I don't have a Patreon, but if you want to support me, a like on the video would help!
when i try to run a project i get a "ModuleNotFoundError: No module named 'pygame'"
how can i fix it?
open command prompt and type "pip install pygame"! it should work!
Did everything up to this point in pygame 2.4.0. on python 3.11.4. No errors.
When I run it, the player doesn't move when I press a key. What happened?
I had the update function and movement function trapped inside the init function
@@Gyrossssssss It's okay, I fixed it by writing "keys[pygame.key]:" instead of "keys==[pygame.key]:" in their places.
Hi, thanks for the tutorial. I have a problem ... The red square on my screen just moves from left to right. It does not move up and down. Thanks
Please could you copy and paste your code for me to look at?
Did you forget to change x_change to y_change when you copy and pasted it
The tutorial's amazing, and I'm glad that I found it as I've been wanting to create something of a RPG as I'm learning Python. Though, for some reason whenever I press my arrow keys, there's no movement. Would I just have to change 'LEFT' to 'A' or something like that?
update: switched the controls to fit a AWSD format; but for some reason, it doesn't move up or down
same, just moving up left and right but no up and down. checked the video twice
Hi! I have a prolem and please answer. From "self.events()" to i don't know where it gives me the next error:
self.run = False
TabError: inconsistent use of tabs and spaces in indentation
I erased the hole line and rewrite it until here.
What do I do?
Which text editor are you using? You can fix this by converting all of your tabs to spaces, or vice versa.
I am using Sublime text 3 and i know what tabs and spaces are and how to find which one which but i don't really want to practically rewrite the whole code
You don't have to re-write all your code. Just check this link out: stackoverflow.com/questions/22529265/sublime-text-3-convert-spaces-to-tabs
can you make a video about your sublime text settings
I might do, thanks for the idea!
Which code editor should I use
Vs code or pycharm or sublime.
It really just comes down to what you prefer. I use Vim, but out of those three I would go with Visual Studio Code.
Something went wrong, help me, I did it like in the video.
self.groups = self.game.all_sprites, self.game.blocks
AttributeError: 'Game' object has no attribute 'all_sprites'
Please could you copy and paste your code?
@@ShawCode I've already fixed everything. But thanks for responding)
Your tutorials are really great and easy to follow, thanks :)
If I wanted to add a system where pressing space caused the player sprite to jump, how would I go about doing that?
Thanks again!
Thanks! I'm not sure how jumping would logically work in a top-down RPG like this, but you would have to get the space keypress first, and then once the keypress is detected then a method would be called, maybe making the player appear bigger or something like that?
@@ShawCode i think he just forgot it was a RPG game lol, like a mario style player
Damn that movements smooth. I wonder if pygame has a physics systems or if you have to implement it?
Pygame doesn't have any physics, but it isn't too hard to add.
Awesome 👍🏻
:D
Nice tutorials. Do you have code in a Git account?
Thanks! Sorry, I haven't got any of the source code for these tutorials.
nice nice bro
Thanks!
Cloud you plz make video about bash and c
Thanks for the idea, I might make that!
Excelent!!
Hello man. Im watching ur videos and i literally copied ur code but my "red Square" dont move. Any Idea pf what is happening? Nice video btw!
Thanks! Please could you copy and paste your code for me to look at?
Bro please upload more tutorials!
The next one is coming out at 2 PM today!
Always see your🥰
:)
Nice
Thanks
Do you have a Discord? I am a big fan of yours
Thanks! I do, you can join here: discord.com/invite/RvNFCymnPn. It is paused at the moment, so you can't talk, but you can still join. It will be open soon.
dam what an absolute chad
agreed
YEAAAAH
:D
1:23
cool
I hope you found it useful!
noice
:D
Engineer gaming
Agreed
100th comment.
cool
Thanks!
@@ShawCode do you have Instagram
Sorry, I don't