I'm trying to make a sprite randomly move through a maze that is drawn on a canvas. The heading is initialized at a random movement when the screen loads.
I implemented a clock that is supposed to check if the background of the nearest pixel in the heading of the sprite is white or not. If it is not white, it is supposed to calculate a new heading.
What is the best and most reliable way to make this work?
Any help is much appreciated