This experimental page started off experimenting with the CANVAS for drawing and audio.
Move around and change direction based on the colour of the background
If dark go left, if bright go right
Record where the buggy goes on another layer
https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Optimizing_canvas could be used.
Move around and change direction based on the colour of the background
If dark go left, if bright go right
Use ctx.getImageData() to read the screen. NOTE: This method is not affected by the canvas's transformation matrix.
The Butterfly Effect - Adjust the starting conditions.
X:Y
direction
level sum of R G B:
Look for edges and bounce. It is affected by its tail.
for a line follower, you need to frame
left motor left sensor =====+=================+======== right motor right+sensor So depending on the direction work out where the sensors are. You have two options do a transform. Loop detection:- Measure a postion and blur it and see if it has moved.
Doug Rice, 2024-10-06, 2025-07-15