How

Yeah, this game is pretty cool! But how does it work under the hood? And how does *Desmos* even work?

**Desmos is a pretty powerful graphing calculator[citation not needed].** And while it is pretty to easy to use normally, it's not that easy to use to create something more complex, like a game.

Luckily, there's a wonderful feature: actions. Actions allow you do update a variable, and tickers update it at a set interval. But, wait, that's too easy! And so, the monster was born. So, we stick to regressions. This tricks Desmos into updating the value when we play the slider, because it thinks it's another variable, and regressions are different than variables, so, it just works. This is also why the player wobbles: regressions sometimes get stuck between two states. But there's a problem: regressions can only update one single variable. That means no points, colors, or lines. Only numbers. This might be a good thing in the end, as it encourages variety, instead of just adding a bunch of the same things (like enemies).

Desmos is very fast at drawing polygons, but *extremely* slow at everything else. Just using the circle formula several times the program to a standstill. So, here's how the program works:

1. We get the last element in the list (as variable **c**)
2. The coordinate updates based on the action, which automatically updates everything around it
3. We move the enemies around
4. It updates the energy and health
5. It determines if you're talking to a character
6. Automatically update the text to show stuff (time, characters talking, etc.)

We also have a giant white polygon, which prevents you from seeing anything outside what you're supposed to see. It's fast enough to render everything, and you can see this for yourself by hiding the last folder. Also, the letters you type are actually variables, as you can see at the right.

We use the circle, ellipse, and the squircle (kind of an ellipse, but more squarish) formula a lot as well to check distances, like when you pick up items or take damage.

Okay, let's get more specific:

   Flowers
Flowers are a detail of the game that looks pretty cool. They are randomly generated, with a random center color and size, as well as the flower's rotation. The colors, however, are pre-generated, and there are twelve colors for the twenty-four flowers. The flower petals use polygons to render.

   Tiles
Tiles restrict your movement and also make the game look more like a 2D open-world game. The collisions are calculated with a hacky formula: the tile locations are always integers, so we floor the X and Y coordinates and determine if that value equals the location of a tile. If it does, then it counts as a collision, so it keeps the previous location. (This also means you can sort of noclip, or go through things, if you increase the speed, but it doesn't normally cause problems.) However, as you can move diagonally, you can still move if you collide in only one direction, which is helpful for navigating. Tiles are rendered with two polygons for a different border color. However, the black outline polygon is slightly bigger then the tile square.

   Trees
Trees act similar to **tiles**, but they use normal rectangular collision detection. They also use polygons to render. The tree leaves are rendered with an ellipse-like polygon.