Pygame (Python Game Development) Tutorial - 29 - Attaching Snakes Head to Body

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

You can also use an r before a string to tell Python to ignore escape characters, eg r'C:\path\to\stuff' ... great videos btw!

lamkdndjfek
Автор

Im having trouble loading the snake's head. I made sure it was in the same directory as my code which is named snakehead.png. I'm getting an error prompt that says "Couldn't open snakehead.png"...any suggestions?

darrenlackey
Автор

That went wrong also! I blame the ipad youtube app

lamkdndjfek
Автор

This doesn't work for me, the problem seems to lie in the first line here, so I'm skipping this part of the tut for now, as I've tried both relative and absolute paths and many other things and I suspect its a pygame thing:

imgHead =

def snake(blockSize, snakeList):
    gameDisplay.blit(imgHead, (snakeList[-1][0], snakeList[-1][1]))
    for XnY in snakeList[:-1]:
        gameDisplay.fill(green, rect = [XnY[0], XnY[1], blockSize, blockSize])

Gunthr
Автор

Hey its showing, 'list index out of range'. Can anyone please help..?

izarhossain
Автор

My snake tail is a bit overlapping on the snake head .Can any one help me out with this?+thenewboston

deekshithpodila
Автор

Sir please help me i am having an error while loading the snake head's image

najamuddin
Автор

wow, that went somehow very wrong... the ' in that comment should be an apostrophe

lamkdndjfek
visit shbcf.ru