Skip to main content

Posts

Showing posts from October, 2021

Python: PyWeek 32: Lil Miss Vampire

TL;DR A world that scrolls infinitely in any direction, an RPG-like UI, and simple, real-time fighting. My younger kids and I built this entry for PyWeek 32 based on the theme "Neverending". The key innovations are: It has a neverending world. As the player walks along, it picks up tiles and places new ones invisibly. It uses an LRUDict to remember the last million tiles you've seen. This matches real life in that if you go back to a place after 20 years, it'll look different than when you first saw it. The user interface was inspired by Super Mario RPG, but the fighting mechanics are purposely realtime. It's a lot like if you were playing Street Fighter, but all you were allowed to do was use a fast punch, a slow punch, or block. It's a little bit like roshambo. The code: The code is pretty pleasant. I made use of lots of new features in the latest Python, and I built a pretty decent developer experience. It's built on the excellent