Close

Stage Library

A project log for PyBadge Hacking

Hacking on Adafruit's PyBadge

dehipudeʃhipu 04/13/2019 at 10:432 Comments

I have now ported the #Stage, a Tile and Sprite Engine to CircuitPython's 4.0 displayio system, so now it runs on any of the Adafruit boards. Here is the Jumper Wire example game running on the PyBadge:

The screen on the PyBadge is a bit larger, so you can see a bit of trash on the right hand side of the screen. If the game was written for a bigger screen, it wouldn't be there.

Unfortunately the Stage library is sensitive to how the MADCTL register of the display is set, as it doesn't do rotation in software. That means I had to modify the initialization code on the pybadge, to make it fit what ugame does. Fortunately displayio doesn't care, as it does have software rotation, so the two could be brought in sync.

The sound on the prototype of PyBadge I have is pretty bad, so I have sound disabled in this demo. Hopefully the final version will be better.

Discussions

Olivier Lecluse wrote 04/17/2019 at 11:10 point

I tried to get circiutpython-stage working for an itsybitsy M4.

I downloaded your version of circuitpython from git

I added the circuitpython-stage module as frozen in circuitpython/ports/atmel-samd/boards/itsybitsy_m4_express/mpconfigboard.mk

I compiled without error got a firmware  but the stage module does not work. It fails when I try 

bank = stage.Bank.from_bmp16("ball.bmp").import(stage)

dir(stage) shows no Bank object

Have you got any suggestion to make it work  ?

  Are you sure? yes | no

deʃhipu wrote 04/17/2019 at 11:49 point

This is still all a bit experimental, we will have proper writeups once everything is cleaned and working. Stage will be enabled by default on the PyBadge, and we will have ready definitions for the MakeCode setups. It just takes some work to do that, sorry.

  Are you sure? yes | no