Skip to content

yeeeeees/microbit-frog

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Froggo : The Journey

A mix of Tetris and Crossy Road made for Micro:Bit microchips

Motivation

We were bored and made a little project using MicroPython.
This project was never supposed to be a big project, but community feedback would be appreciated.

Tech / Frameworks Used

Code Example / API Reference

MicroBit chip can't read python code, but it can read hex code. This python code is translated into hex code using this python to hex converter.
That converter has already microbit module installed so it is our go-to.

We use heavy OOP style of code for this project while not being oversimplified.

class Frog():
    def __init__(self, x):
        self.x = x
        self.y = 4
        self.brightness = 7
        self.isAlive = True
        display.set_pixel(self.x, self.y, self.brightness)
    def strafe(self, pos):
        display.set_pixel(self.x, self.y, 0)
        if self.x < 4 and pos == "right":
            self.x += 1
        if self.x > 0 and pos == "left":
            self.x -=1
        display.set_pixel(self.x, self.y, self.brightness)  
    def die(self):
        #global score
        self.isAlive = False
        display.scroll("u ded fam")
        display.scroll("score : " + str(score))
        display.clear()

We are facing a big problem where after 25 cars have passed, the chip runs out of RAM memory and the program raises MemoryError.
Every single feature is implemented through classes or functions.
Micropython doesn't support async module.

Tests

There aren't any tests need at the moment, but manual tests are really important.
For this project, everything above Python 3.6 will be absolutely fine. Take a look here about micropython and it's features and limitations.

Contributing contributions welcome

We use a mixture of pylint and flake8 for linting. To contribute, fork this repo, add yourself to contributors list, make changes and submit PR. Feel free to open issues, we are glad to hear feedback.

LICENSE

MIT © Saki

About

A little game on microbit using python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages