How do I make a sprite collide with a colour on the canvas? Why doesn't my code work?

I want to make a game where you control the sprite (MT) using buttons (U, D, L & R) to solve a maze, but every time you hit the border (yellow) you have to restart. The borders are drawn on the canvas, they are not individual sprites. How do I make it work?

This example uses a Ball I need help making a maze - #3 by SteveJG however you can also use a sprite. :wink:The border of the maze example is Black.

run the example and let me know if this works for you. Thanks

I have absolutely no idea how to do what is being told in the answer to that post, sorry @SteveJG

Herewith a very simple example

spriteMaze.aia (2.9 KB)

Export your aia and upload it here for detailed analysis.

How do you know if the yellow in your color blocks exactly matches the yellow in your background image or in the code that drew the maze?

AI2 color values are 32 bit numbers, made up of (RGBA) 8 bit numbers in the range 0-255.

If your color is off by 1 anywhere, it won't match.