Unlock/Upgrade functions complete


UI is more or less complete. It is quite taxing when you have such a limited field to play with, but we're making it work... please ignore my debug information in green. Some of that might stay as info for the player to know what the current reward is, or what the next upgrade costs. Or I may try to toss that into the corners of the icon. Not sure yet. Maybe I'll poll the community.


Naturally I spent a good amount of time banging my head against the wall because the upgrade/unlock greyout vs. clickable when you have enough gold was not working. It was pulling from the wrong area, or not pulling through what I thought was a global variable, but I guess not, and yes at least one instance of me literally having the information wrong in the array because I copied and pasted from another area and forgot to change the values... but at any rate - fixed it now (seemingly).


The way I am storing my data is probably woefully inefficient, but for the UI:

  • I have clicker{} that stores an x & y based on an arbitrary set of positions for each of the clickable locations & buttons. Speaking of I also store pos which helps me determine where I am and call back to any additional info (am I on the box to collect a reward, am I at the upgrade button for area 2? am I at the unlock button for area 4? etc.
  • I have a lookup array that contains two values in each cell, cx & cy. I call this by basically utilizing another array cmatrix, which visually indexes the click.pos variable to a location 1-12 which I am not just realizing may be redundant. Anyways I store the actual pixel x & y variables in an array based on click.pos, and that helps me draw the clicker properly.
  • For the various area info I keep a few nested tables/arrays within the object area{}, which is indexed to - you guessed it - the position 1-4, but of course I couldn't have the click.pos line up with it properly, no no no. Area 1 is position 1 and Area 2 is position 2, but Area 3 is position 7, and Area 4 is position 8. I originally thought I would be clever by having them set as odd/even, but it wound up being more trouble than it was worth so I brute force the location via click.pos more frequently than I care to admit.
  • Also underneath the area{} is variables for the sprite information (including an array for the frames), color & location variables for drawing the UI depending on the situation, flags to indicate if something can be unlocked/upgraded, level, and a bunch of other arrays consisting of the numbers for level multipliers or upgrade costs. Here's what one looks like in Notepad++ (easier to read than within PICO8)
  • I'm sure half of you are going to think this is so inefficient and childish, and the other half are going to think nothing of it, this is rudimentary bread and butter stuff. I bite my thumb at the former group and as for the latter - well I haven't coded anything this in depth ever, so I bite my thumb at you too. I feel accomplished damnit.

At any rate. Feeling pretty good about having at least that behind me. Some preliminary numbers for the cost to unlock, upgrade/level multipliers, and what not. Still need to figure out if they are remotely balanced or what not. Not really sure how to do that other than through playtesting.

Might try to finish the automatic reward clicker upgrade code tonight. Need to get started on the actual loading bar instead of just debug menu counters in the corner like I have now. Still need to increase the sprite sizes and draw a few more, as well as add the sfx for polish.


Also want to think about victory conditions:

  • Get every area to level10?
  • Time based? High score after 10/15 minutes?
  • Endless?

All of that feels like a tomorrow problem though.


Uploading my work as of 6/16 (since it's after midnight) for posterity and to allow some of the community to jump in and take a crack at the UI to provide feedback.

Leave a comment

Log in with itch.io to leave a comment.