Search code examples
bbc-microbit

Microbit: Plot x y does not work when a sprite is on the screen


I have a program that aims to function like an etch-a-sketch. If you hit A, the X coordinate will change, and if you hit B the Y coordinate will change.

I use a sprite as the 'crosshair' and pressing A+B will plot a point at the current coordinate. The problem is whenever there's a sprite on the screen plot just doesn't work.

image description


Solution

  • Using sprites will start the microbit game engine which will render the sprites and override any kind of animation you are trying to show. I would suggest you do all the drawing with sprites and the game engine.

    This would mean that when you press A+B it would create a new sprite for the location. Any example of doing this is:

    Example sketcher code