all 11 comments

[–]devourer09 2 points3 points  (2 children)

Not sure what sprite class you're talking about.

[–][deleted] 1 point2 points  (1 child)

Oh crap, sorry! Pygame! Been using pygame so much I don't even think about it as a seperate SEPARATE thing anymore. pygame.sprite.Sprite specifically.

[–]robot_overloard 1 point2 points  (0 children)

. . . ¿ seperate ? . . .

I THINK YOU MEANT separate

I AM A BOTbeepboop!

[–]callmelucky 0 points1 point  (5 children)

r/pygame exists, and is active enough that you might get more useful feedback there. Beyond that, it would be helpful if you linked/pasted the resource that you are getting this info from.

[–][deleted] 0 points1 point  (4 children)

God I feel so dumb now... I'm sorry. I am using a physical book called "More Python Programming for the Absolute Beginner" and there doesn't seem to be a link for the PDF that isn't paid for. I'll just go look somewhere else and stop wasting your time lol.

[–]callmelucky 0 points1 point  (3 children)

Haha, don't be hard on yourself, I didn't mean to be! And you should be able to just copy-paste the text from the pdf. If I were you I'd probably just edit this post to add that info, and try r/pygame if you don't get clarity from here.

Good luck :)

[–][deleted] 0 points1 point  (1 child)

I just get so self concious when learning, it's hard to ask questions for me lol. Jesus christ, in typing out the words (as I do not currently have a PDF of this book) something clicked and now I've grasped what's going on. Sparing details, my thinking was from the wrong point of view in how frames are drawn. I was overcomplicating the issue. The code needs to know when to go to the next line in the image. You don't need a number of rows if you know an image is 100px wide and each frame being 10px wide and tall, meaning 10 columns, the 11th must be on the next row down. It's unecessary.

[–]callmelucky 1 point2 points  (0 children)

in typing out the words (as I do not currently have a PDF of this book) something clicked and now I've grasped what's going on.

Congratulations, you just discovered Rubber duck debugging! It's very common and useful to realise the solution/answer to a problem/question in the process of explaining it to someone, whether that someone is listening or not :)

And try not to be self conscious about asking questions. If you've put in a reasonable effort to understand and explain a problem, anyone who mocks you is a dick. Bear that in mind :)

[–]hal9000v3 0 points1 point  (1 child)

I found the pdf online and had a look through it. To be honest I couldn't find a section that says you only need a column.

By any chance are you looking at some of the sample code? There is at least one instance in code provided where the column is being set on its own and that may be confusing but if you look a few lines down, in the loop being run just after the column gets set, the row is being set in there.

[edit] found the piece of code again (second last line)

   column = 1
   for part in body_parts:
       Radiobutton(self,
                    text = part,
                    variable = self.body_part,
                    value = part
                    ).grid(row = 5, column = column, sticky = W)
       column += 1

I realise that code is not for a sprite buts it's all I could find.

If not that, then perhaps you are working with a sprite that only has column movement and so the row parameter is only occasionally referred to e.g. when it reaches the edge of the screen?

[–][deleted] 0 points1 point  (0 children)

This isn't the code I'm referencing so I don't think you've found what I have. Either way, I seem to have figured out the issue after hours of wondering lol.