Jan-02-2019, 07:59 PM
Attempting to help my son.
I cannot find the error or a reason
Extract
I have also attempted the code as follow:
Same result
I also attempted with .convert()
Why is it not picking it up ?
I have read the previous post on this topic and attempted all suggestions.
I cannot find the error or a reason
Extract
import png, os, pygame pygame.init() win = pygame.display.set_mode((1200,900)) pygame.display.set_caption("First Game") WalkRight = pygame.image.load(os.path.join('Red_Knight_Right.png')) WalkLeft = pygame.image.load(os.path.join('Red_Knight_left.png')) bg = pygame.image.load(os.path.join('game background.png')) char = pygame.image.load(os.path.join('Red Knight.png')) Stab_left = pygame.image.load(os.path.join('Red_Knight_stab_Left.png')) x = 500 y = 410 #varibles width = 40 height = 60 vel = 10 isJump = False jumpcount = 10 left = False right = False Stab_left = False def redrawGameWindow(): win.blit(bg, (0,0)) if left: win.blit(WalkLeft, (x,y)) elif right: win.blit(WalkRight, (x,y)) elif Stableft: win.blit(Stab_left)
Error:pygame 1.9.4
Hello from the pygame community. https://www.pygame.org/contribute.html
Traceback (most recent call last):
File "C:\Users\******\Downloads\python_game_resourses\knight_game_combat_testing_not.py", line 8, in <module>
WalkRight = pygame.image.load(os.path.join('Red_Knight_Right.png'))
pygame.error: Couldn't open Red_Knight_Right.png
the image files are located in the same directory as the py file (C:\Users\******\Downloads\python_game_resourses\knight_game_combat_testing_not.py)I have also attempted the code as follow:
WalkRight = pygame.image.load('Red_Knight_Right.png') WalkLeft = pygame.image.load('Red_Knight_left.png') bg = pygame.image.load('game background.png') char = pygame.image.load('Red Knight.png') Stab_left = pygame.image.load('Red_Knight_stab_Left')
Same result
I also attempted with .convert()
Why is it not picking it up ?
I have read the previous post on this topic and attempted all suggestions.
