IntroductionGames are cool, and making them is an even bigger flex πͺ. I mean, look at the people who made Doom; they're basically legends. But usually when you think "game engine", you think Unity, Unreal, maybe a sprinkle of JavaScript. You don't think graphing calculator. Well, what if I told you Desmos has everything you need to build a working arcade game? State variables, conditional logic, randomization, and even clickable objects. No JavaScript. No libraries. Just math doing things math was never meant to do.Step 1: Wait, Desmos Has Actions (event listeners)?Before anything else, you need to know about Desmos Actions because this whole project runs on them. Actions are the feature that lets Desmos react to clicks. You write them with the right arrow symbol β (just type -> on your keyboard), and they look like this:a β a + 1\That single line means: when this action fires, update a to be a + 1. It's basically an assignment statement; the closest thing Desmos has to actual code. Actions require an account on Desmos to use the full "clickable" feature, so go make one if you haven't already.\Once you have an account, go into Account Settings β Advanced β check the Actions checkbox. Now you're cooking.Step 2: The Playing Field (It's Just a Polygon)Every game needs a world. Ours is a 100Γ100 grid defined by a single polygon:polygon((0, 0), (100, 0), (100, 100), (0, 100))\Desmos's built-in polygon() function takes a list of points and draws a filled shape between them; no x, no y, no equations involved. This one square is the entire arena. Everything happens inside it. The axes are still technically there; we just ignore them.\Step 3: The Target (A Circle That Knows Where It Lives)The actual game object is this inequality:(x - a)Β² + (y - b)Β² β€ r\If you remember your high school geometry, this is the interior of a circle centred at (a, b) with radius βr. Desmos shades the entire region where the inequality holds, so this draws a big filled circle on the graph. The magic is that a, b, and r are all variables; meaning the circle's position and size can change at runtime. Define them, and you have a live, movable, resizable target:a = 82.04b = 46.89r = 7000\Step 4: Randomise the Position (This is Where It Gets Fun)Letβs make a target that teleports every time you click it. Here's how we move the circle:u = a β random() Β· 90p = b β random() Β· 90\u(x) fires an action that reassigns a to a fresh random number between 0 and 90. p(x) does the same for b. Fire both, and the circle jumps to a completely new spot inside the arena.\The random() function in Desmos generates a value between 0 and 1 each time an action runs; it's not the same number every time. Multiply by 90, and you've got a coordinate that stays comfortably inside the 100-unit grid. Clean.\Set these expressions to be "clickable" (via the expression settings panel β Clickable toggle), place their label points somewhere visible on the graph, and you've got buttons.\Step 5: Make It Harder (Shrink the Target)A game that doesn't get harder isn't a game. Every time the player triggers this action, the circle gets smaller:o(x) = r β 5r/8\5/8 = 0.625. So, each trigger multiplies the current radius by 0.625. Hit it once: 62.5% of original. Hit it twice: 39% of original. After a handful of clicks, you're chasing a tiny dot. That's your difficulty curve, no code required.\ Just click on the small β buttons next to u, p, and o to change the positions and make it smallerStep 6: Track the ScoreYou need to know how many times the player has clicked. Enter the click counter: (why I decided to call it z i do not know).\Here we have a function that increases the score (z) by 1 every time it is clicked. We also have displayed the score in some blue text on the graph itself. ${β¦.} allows you to display a variable (z) in this instance on a label, just like JavaScript (hmmm, what a coincidence).z = 0f = z β z + 1\Step 7: THE CIRCLE IS THE BUTTON (wait what)So, here's the thing. You've been building all these separate action functions; u, p, o, g, f; and thinking you need a bunch of individual buttons to fire them. You don't. Because Desmos lets you attach actions directly to the circle itself.\Click on the settings in the graph panel, click the blue (or any other colour depending on what you have) button for the line, hit the Clickable toggle, and in the "On Click" field, type:u, p, o, f\\That's it. Now, when the player clicks the shaded circle on the graph, Desmos fires all five actions simultaneously in a single click:u β new random x positionp β new random y positiono β shrinks the radius by 5/8f β increments the click counter\The circle moves, shrinks, and scores itself. One click. No separate buttons needed. The target is the button, which is honestly exactly how a clicker game should work, and we should have thought of this from the start πββοΈ.\You can even see this in the expression list: line 1 shows "Run u, p, o, f on click" right underneath the equation. Desmos is basically documenting your game logic for you.Step 8: THE TICKER β> A COUNTDOWN THAT KILLS YOUOkay, so up until now, the game has had no pressure. You could sit there and stare at the circle for an hour, and nothing bad would happen. That changes with the ticker, Desmos's built-in time-based event system.\Click the "+" button to add a new expression, and click ticker. Desmos drops in a special ticker block at the top of the expression list. It looks like this:Run ___ every ____ ms\That's it. We set it so that every 1000 milliseconds (once per second), Desmos automatically fires an action. No clicks required. The clock is ticking, whether the player likes it or not.\We are running this action:q = { k > 0 : k β k - 1, k = 0 : r β 0 }\Every second, k drops by 1. When k hits 0, r gets set to 0 and the circle disappears (r is the radius). k is a countdown timer (I probably should have named it t, but if something works, donβt touch it). The label on the point at (80, 110) is set to `time: ${k}` so the player watches their remaining seconds tick down in real time on the graph.\The score display works the same way; the point at (20, 110) has its label set to `score :${z}`, so hitting the circle increments z and the score updates live next to the timer.\And the reset button, the polygon at the bottom with the start label on (50, -5); runs:r β 7000, z β 0, k β 10One click resets the radius back to full size, wipes the score, and refills the countdown to 10. Fresh game, no page reload needed.Step 8: Putting It All TogetherHere's the full expression list, cleaned up:| # | Expression | Purpose ||----|----|----|| 1 | (x-a)Β²+(y-b)Β²β€r | The circle target (what you will be clicking on) || 2 | a = 82.04 (hidden) | X-position of circle || 3 | b = 46.89 (hidden) | Y-position of circle || 4 | r = 7000 (hidden) | Radius of circle || 5 | u = a β random()Β·90 | Randomize X on click || 6 | p = b β random()Β·90 | Randomize Y on click || 7 | o = r β 5r/8 | Shrink radius on click || 8 | z = 0 | Hit counter || 9 | f = z β z+1 | Increment hit counter || 10 | k = 8 | Time remaining || 11 | q = {k>0: kβk-1, k=0: rβ0} | Decrease time, if time = 0, do not show circle || 14 | polygon((0,0),(100,0),(100,100),(0,100)) | Game arena || 15 | (20, 110) | Score display || 16 | (80, 110) | Time display || 17 | polygon((40,0),(60,0),(60,-10),(40,-10)) | Start button |Fire up actions on each of the function expressions, link them to your button points, and you have a working game.Step 10: Play ItThe loop goes like this:Circle appears somewhere random on the 100Γ100 gridPlayer clicks MOVE β circle teleports to a new random positionPlayer clicks HIT β radius shrinks by 37.5%When the timer hits 0 circle disappearsYou can see the score anytime\The difficulty ramps naturally as the circle decreases in size. What starts as an easy, large target becomes a pixel-hunting nightmare by round 5. That's game design without a single line of JavaScript.ConclusionLook, I know Desmos is supposed to be for graphing parabolas and impressing your calculus teacher. But the Actions system is genuinely powerful enough to build interactive programs that feel more like code than math. State variables, conditional logic, randomisation, counters; it's all there.\Could you build this in Unity in ten minutes? Absolutely. Would it be as much of a flex? Absolutely not.\Go build something weird in Desmos. Your friends will either be impressed or deeply confused, and honestly, both outcomes are great.