BeepMini Dev Notes

I post experiments, fixes, and decisions, including things that never ship and what I am working on now that may not be public.


Did lots of work on the adventure game plugin today. This is what powers Key Kwest.

Fixed keyboard input so that dragging a crate does not run faster than walking. This was caused by the walk delay being reset when the character moves, but not being reset when the crate is dragged.

Added animations to player movement when dragging a crate.

I have been working on the adventure game plugin that powers Key Kwest.

I was adding hearts to the editor so that you can refill your health. I realized that the process for picking up hearts is almost the same as collecting coins and keys. So I made a generic “pickup” system that replaces a lot of the code for coins and keys. This will make future pickup objects a lot easier to add.

Each pickup has a location, a sprite (tile, and colours), and optional attributes, plus a callback function that runs when picked up.

Added visual effects animations to BeepMini. This makes it easy to add things like explosion animations, sword swipes etc. The animations are all tile-based.

The animations have a selection of frames that are specified in an array, the same as used for Actors. The animation has a defined speed (in frames per second) and can be set to loop or not.

You should draw the animation in your game loop by calling b8.Vfx.draw( animationId, startTime ) where startTime is the timestamp when the animation started (you can get this from b8.Core.now()).

When the animation finished b8.Vfx.draw will return false, so you can use that to know when to stop drawing it.

You can see a demo of the Vfx system in the BeepMini examples: Vfx Demo.

I have started adding a utility that generates tile paths for characters to follow in the mapper. This could actually be used for anything to follow, for example NPCs wandering around, or platforms moving.

It uses a string of directions like “UUDDLLRR” to indicate up, down, left, and right movements. You can also add numbers to indicate the object should repeat the movement.

You give it a start position and the string and the utility returns an array of tile coordinates that the object should move through. Initially this is going to be used for enemy movement patterns in the adventure game plugin, but it could be used for other things too.

You can read more about this in the Path docs.

I have added a reset system. All BeepMini modules can not implement a reset() function that will be called when the game is reset. This is useful for resetting game state without reloading the entire page.

Specifically I wanted this so that I could make the game preview system work in the adventure game editor. Without this that game state would be corrupted between previews since some of the code would still be active from the previous run.