Skip to content

Microgames

ellestuff. edited this page Mar 31, 2026 · 2 revisions

What are Microgames?

Microgames are short, quick minigames, as found in games such as WarioWare and MINDWAVE, which can now be created and played in Balatro.

Note: It is recommended that you are familiar with the LOVE framework when developing microgames.


General Values/Methods

These can be found in the slimeutils.microgames table.

  • Values
    • running: Whether the microgame gameplay is active
    • *playing: Whether a microgame is playing.
    • *queue: The queue of microgames being played. [1] is the current microgame.
    • *anims: The current animation set.
    • *timer: The current time for the microgame in seconds, with 0 being the start of the gameplay.
    • **microgame: The currently running microgame.

*Returns nil or false if a queue isn't active

**Returns nil or false if a microgame isn't active

  • Methods
    • enqueue(queue,microgame,t): Add a microgame to a queue table

      • queue: A list to add the microgame to.
      • microgame: The microgame to enqueue.
      • t: A table of other values that may be useful.
        • (Optional) end_func(): Code to run after the microgame, intended for using what happened in the microgame to influence Balatro gameplay (eg: Scaling a Joker based off how many points earned in the microgame)
        • Other values can be stored in the table and then read elsewhere by referencing slimeutils.microgames.queue[1].t
    • init(queue, anims): Starts the microgame gameplay.

      • queue: The list of microgames to play, made using the enqueue function.
      • (Optional) anims: The animation table to use for transition animations.

Animation Tables

These are tables containing the transition animations for the microgames, along with the durations of each animation. Although optional, this table is expected to be provided when running slimeutils.microgame.init.

  • Table values
    • durations: Key-value table containing the duration of animations in seconds. (eg. start = 1, finish = 2)
    • start, finish, pre_game, post_game(time, frame): The code for drawing each animation to the screen.
      • time: How far into the animation it is, in seconds. Does not start at 0 and has a single frame where it exceeds the duration.
      • frame: A frame count from the start of the animation that starts at 1.

Microgames

Microgames are the games that get queued and then played ingame. Although possible to put in a larger file as a table, it is recommended to instead give each microgame its own file, returning the table at the end of the file, and then loading it using SMODS.load_file(path)().

  • Values

    • duration: The length of a microgame in seconds.
  • Methods

    • draw(), update(dt): These function similarly to their respective LOVE callbacks.
    • init(): Runs on the microgame's creation in the pre_game animation.
    • start(): Runs at the start of actual microgame gameplay.

Note: This may not seem like much, but this is by design. As this is your own microgame, it is up to you to add your own entries to the table to access externally, such as in the microgame queue entry's end_func function. You could use this to add things such as a score counter or a custom info_vars function. This is merely a framework to build upon.

Clone this wiki locally