DVD Logo Bounce

For one of my classes I am teaching I assigned them to create a simple “screensaver” using the LED blocks on Makecode and I used “The Office” clip where they are watching a dvd logo bounce around the screen. This is what I want to create as a challenge on the microbit. Just a single LED bouncing around the LED grid on the microbit. Can anyone help me with this using makecode?

Here’s probably the simplest blocks you could get: https://makecode.microbit.org/_1t8M4hbMjc3T

The issue is that it will always move in the exact same pattern; with a 5x5 grid and the movements constrained to 45 degree segments (when moving 1px at a time) it will always bounce between the same few pixels on the edge. I could look at writing up a nicer bounce on there, but I’m unsure it would be useful as it would like be in javascript and slightly complicated.

If it’s helpful, the arcade editor might be a bit better suited for this sort of thing; it has that behavior built in for sprites, it’s a bit easier to write by hand if you want it to be a challenge with conditional logic, and either way there can be a bit of a fun challenge to make it all a bunch of things at once if any students are feeling up to it: https://makecode.com/_i6gT8mdjxEDe . Also, the paint brush example on the home screen under graphics and math is something I made as a variation on this, where I also gave it random acceleration and trace the path it follows :slight_smile:


I see what you mean with the microbit, maybe with a shake it could send the ball in the different direction to change it up and I like your idea of changing the acceleration when it hits the edge. I really appreciate the help and all of the examples which is really cool of you. I agree arcade is better suited for this project.

Cheers and thank you!

1 Like

Some changes I made to your original code. Again, thank you for your help!

1 Like