Well on my quest to learn python, I poked and peeked around on the web of inters. And came across some nice sites about the micro:bits, projects and coding.
But why remake of Starbit Commander? Derek has this nice example of “Tiny Astroids”, which resembled a lot like Starbit Commander. And he created it in Python… sooo.. mine Starbit Commander should get a python version too… In this little gem from Derek, he created a really really nice piece of code that animated an explosion on this 5×5 led display. I loved it. And although I wanted to create Starbit from scratch in OO, I really wanted to adopt this nice little tiny explosion.. So I contacted Derek via twitter, asked if he agreed me borrowing his explosion-code. we had a short but very nice chat on twitter and he agreed for the code to be reuse in Starbit Commander. Thanks Derek!
Well, I wanted to test and learn more python and also OO in python. So I decided to try to make Starbit Commander in an OO-style. I have no experience in this but I think (as far as I can tell) this is an OO-version of the game now. Derek mentioned on micro:bit V1’s coding OO would let you ran into out of memory errors. I haven’t seen them on the microbit V2 with Starbit Commander. (Now I’m worried if I did a proper OO-coding style ;-0)
I differed a bit from the original Starbit code. While de MakeCode version has power-ups to collect, in this python-version I decided to skip that and make the astroidfield a bit more challenging by starting slow and easy and ending fast and astroid-crowded. Giving you more and more bonus score along the way you go.
This code can by found here. And watch that explosion… Thanks again Derek Graham!