Hi,
I am currently teaching some young kids to code using Pythonista, our current project is Pac Man. As the kids are young I am having to take some shortcuts. For instance instead of building the background with tiles, I just want to load it from an image.
So I have saved some images from the internet and am attempting to load them into my Scene as a SpriteNode. I can import them into Pythonista without any issue, however when I try to use them in the code I get strange errors. Sometime it is ‘could not load image’, but other times it gives errors on future lines, such as if you forget a semi colon.
My image is in the same folder as the code, and I have tried lots of different images. One time one image worked, so I deleted it and tried again (need to ensure it works for kids) and it failed.
I am on iOS11 with the latest version of Pythonista. Has anybody ne experienced this issue or have an ideas?
‘’’
from scene import *
import sound
import random
import math
from joystick import Joystick
from player import Player
from tile import Tile
from direction import Direction
A = Action
class MyScene (Scene):
def setup(self):
self.background_color = '#000000'
self.background = SpriteNode('IMG_0204.PNG')
self.background.position = self.size.width / 2, self.size.height / 2
self.add_child(self.background)
‘’’