Particle Incremental

WIP

by Blackcatgame77

HTML

<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">

    <title>Button simulator</title>
    <meta name="description" content="A game about physics and particles">
    <meta name="author" content="Blackcatgame77">
  </head>

  <body>
    <canvas id="canvas1" width=960 height=540 style="border:1px solid lightgrey;">
      Your browser does not support the HTML5 canvas tag.
    </canvas>
    <script>
      "use strict";
      let canvas;
      let context;

      window.onload = init;

      window.onclick = function() {
      	buttonDetector(event);
      }
      

      function init() {
        canvas = document.getElementById('canvas1');
        context = canvas.getContext('2d');
        window.requestAnimationFrame(gameLoop);
      }

      function gameLoop(timeStamp) {
        draw();
        window.requestAnimationFrame(gameLoop);
      }

    </script>
  </body>

</html>

JavaScript

/*
For currency & unlocked variables
1:up quarks
2:down quarks
3:charm quarks
4:strange quarks
5:top quarks
6:bottom quarks
7:electrons
8:muons
9:tauons
10:electron neutrinos
11:muon neutrinos
12:tauon neutrinos
13:gluons
14:photons
15:Z bosons
16:W bosons
17:Higgs bosons
18:protons
19:neutrons
20:hydrogen
21:helium
22:lithium
23:beryllium
24:boron
25:carbon
26:nitrogen
27:oxygen
28:fluorine
29:neon
30:sodium
31:magnesium
32:aluminum
33:silicon
34:phosphorus
35:sulphur
36:chlorine
37:argon
*/
let currencies = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
let currenciesFixed = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
let classifierQto = 0
let classifierLto = 0
let classifierBto = 0
let classifierCto = 0;
let unlocked = [1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
let scene = [0, 0, 0, 0];
let Qgain = 1 / 60;
let Lgain = 0;
let Bgain = 0;

function prefixer(value, amount) {
  if (amount < 1000) {
    currenciesFixed[value] = currencies[value].toFixed(1)
  }
  if (amount > 1000) {
    currenciesFixed[value] = (currencies[value] / 1000).toFixed(1).replace(/\.0$/, '') + 'K';
  }
  if (amount > 1e6) {
    currenciesFixed[value] = (currencies[value] / 1e6).toFixed(1).replace(/\.0$/, '') + 'M';
  }
  if (amount > 1e9) {
    currenciesFixed[value] = (currencies[value] / 1e9).toFixed(1).replace(/\.0$/, '') + 'B';
  }
  if (amount > 1e12) {
    currenciesFixed[value] = (currencies[value] / 1e12).toFixed(1).replace(/\.0$/, '') + 'T';
  }
  if (amount > 1e15) {
    currenciesFixed[value] = (currencies[value] / 1e15).toFixed(1).replace(/\.0$/, '') + 'Qa';
  }
  if (amount > 1e18) {
    currenciesFixed[value] = (currencies[value] / 1e18).toFixed(1).replace(/\.0$/, '') +...