Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines
(+1)

Nice game! It took me a few runs to actually read the tutorial text to learn how to leave the level, but otherwise a good game.

The concept was easy to understand, but unique enough that I could imagine the game providing a different experience than many other incremental games on here.


Also, a note on the overflow issues and how to solve it: Usually, when adding y>0 to a variable x, we might try something like this:

if (x + y > MAX_VALUE)
    x = MAX_VALUE;
else
    x = x + y;

But this runs into the risk of x+y overflowing in the if statement, becoming negative, so the statement is always false. However, we can rearrange the statement like this:

if (x > MAX_VALUE - y) // Subtract y from both sides
    x = MAX_VALUE;
else
    x = x + y;

and since we're increasing the value of x, we can guarantee that y>0, so MAX_VALUE-y is always between 0 and MAX_VALUE.


We can do a similar trick for countering underflows as well, so when calculating x-y we can write:

if (x < MIN_VALUE + y)
    x = MIN_VALUE;
else
    x = x - y;

Combining these into one Add() function would look something like:

func Add(x, y)
    if (y > 0 and x > MAX_VALUE - y)
        x = MAX_VALUE;
    else if (y < 0 and x < MIN_VALUE + y)
        x = MIN_VALUE;
    else
        x = x + y;
   return x;

I should note that I've never worked with PICO-8 before so some of this code could be off but the logic works for whole values, at least.