Description
Hey 👋 this is very cool
Intended platform
It looks like it is Windows platform specific for a python bundled with tkinter. Might be a good idea to share with folks how you set that up. Just-in-case.
In my case; I'm on a mac; which doesn't bundle tkinter by default.
Using TKinter (mac instructions)
Homebrew
If folks are using homebrew, they can brew install python-tk
; but some of the options are OS specific... Kinda defeating the purpose of a cross-platform library for GUI; but that is TK, not your project specific.
pyenv
For folks using pyenv (I happen to use homebrew and pyenv); an additional step; as well as running or doing something to install libtk and libtcl; is to ensure your python build supports dynamic libraries. env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.11.8
.
There are more comprehensive guides which also cover linux; but I've only so-far tested with OSX
Bug?
I noticed, sometimes the creature would go left, right, left, or right, left, right. I narrowed this down to being at, the window border. Rather than call self.change_direction()
, which involves random
; I use self.dir = -self.dir
, which simply put, reverses the direction.
Thanks for sharing this code. Hope some of this helps.
Update: Todo
- Contribute documentation on OSX setup
- Contribute fix for screen edge changing direction
- Contribute fix for OSX transparent display