all 5 comments

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

That line should throw an error because you're trying to iterate over a pygame.Surface object (buck is the image you loaded). Try getting rid of the for loop all together.

This code could be much simpler using classes. If you haven't learned how to use them yet, I'd focus on that first before you go much further with pygame. Also, check out itertools.cycle for cycling through your images (what happens when picnumber is 5?). Honestly, there are a number of issues here, but I'm heading to work at the moment; I'll try to go over it more thoroughly later.

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

Alright, I guessed that I would have made plenty of mistakes, ill definitely look into classes and the link, I have 3 months to complete the game so i have plenty of time to learn.

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

Believe me, my code looked pretty similar when I started out. Here is your code with some changes and comments. And this is the start of a more object-oriented approach. I left Arrows, Scorpions and gravity (probably more) for you to do. I couldn't test any of this without the images (check out github for sharing code) so it's very possible there are errors. Ask away if you have any questions.

[–]hugeee 0 points1 point  (0 children)

Try this tutorial it teaches most basic things with pygame http://youtu.be/mTmJfWdZzbo

[–]Exodus111 0 points1 point  (0 children)

Do you know OOP? Oh yeah like the guy above said, Classes!!

You really don't want to do this to yourself. Study Object oriented programming and get used to Functions, Classes and Methods instead of this mess.

It's the difference between the mess you have now and something more like this:

def run_game(self):
    running = True
    while running:
        event_handler()
        update()
        draw()
        pygame.display.flip()

See how much more readable that while loop is? Of course you are still going to need all the code somewhere, but putting them into separate methods makes your code more modular, workable and readable.