diff --git a/mods/noblegas.js b/mods/noblegas.js index bb16d9e9..ff9aadfd 100644 --- a/mods/noblegas.js +++ b/mods/noblegas.js @@ -106,7 +106,7 @@ elements.frozen_xenon = { elements.radon = { color: elements.neon.color, behavior: behaviors.GAS, - colorOn: ["#d33d7c","#f73273","#c03190"], + colorOn: ["#3dd3cb","#32f7e7","#31c0a8"], category: "gases", state: "gas", conduct: 0.8, @@ -156,7 +156,7 @@ elements.radon = { elements.liquid_radon = { color: elements.neon.color, behavior: behaviors.LIQUID, - colorOn: ["#d33d7c","#f73273","#c03190"], + colorOn: ["#3dd3cb","#32f7e7","#31c0a8"], category: "states", state: "liquid", tempHigh: -58, @@ -170,7 +170,7 @@ elements.liquid_radon = { elements.frozen_radon = { color: elements.neon.color, behavior: behaviors.WALL, - colorOn: ["#d33d7c","#f73273","#c03190"], + colorOn: ["#3dd3cb","#32f7e7","#31c0a8"], category: "states", state: "solid", tempHigh: -68, @@ -182,7 +182,7 @@ elements.frozen_radon = { elements.oganesson = { color: elements.neon.color, behavior: behaviors.GAS, - colorOn: ["#5bdce6","#56a9f7","#56b0e4"], + colorOn: ["#b5e65b","#b9f756","#aee456"], category: "gases", state: "gas", conduct: 0.8, diff --git a/mods/scenexe.js b/mods/scenexe.js index 54a2e842..cbcf157a 100644 --- a/mods/scenexe.js +++ b/mods/scenexe.js @@ -1,3 +1,11 @@ +/* + ____ _ + | _ \ __ _| |_ __ _ + | | | |/ _` | __/ _` | + | |_| | (_| | || (_| | + |____/ \__,_|\__\__,_| + +*/ polygonColors = function(sides){ let baseColors = [ /* @@ -33,6 +41,68 @@ polygonColors = function(sides){ return "rgb(0, 0, 0)" } } +const usefulMiscColors = { + playerBlue: "rgb(0, 176, 225)", + barrelGray: "rgb(153, 153, 153)", + playerGreen: "rgb(0, 224, 108)", + playerRed: "rgb(240, 79, 84)", + playerPurple: "rgb(216, 43, 207)", + bodyGray: "rgb(95, 103, 108)", + fallenGray: "rgb(192, 192, 192)", + celestialPink: "rgb(237, 110, 222)" +} +const upgrades = { + weapons: { + annihilator: [ + { + theta: 0, + damage: 150, + reload: 1, + angle: 0, + spread: 0, + yoffset: 0, + xoffset: 0, + length: 1.9, + width: 1, + type: 0, + bulletHealth: 60 + } + ], + twin: [ + { + theta: 0, + damage: 150, + reload: 1, + angle: 0, + spread: 0, + yoffset: 0, + xoffset: 0.5, + length: 1.8, + width: 0.45, + type: 0, + bulletHealth: 60 + }, + { + theta: 0, + damage: 150, + reload: 1, + angle: 0, + spread: 0, + yoffset: 0, + xoffset: -0.5, + length: 1.8, + width: 0.45, + type: 0, + bulletHealth: 60 + } + ] + }, + bodies: { + + } +} +polygonList = [] +zoomLevel = 0.5 isKeyDown = { w: false, a: false, @@ -41,6 +111,66 @@ isKeyDown = { i: false, o: false } +let mouseX = 0; +let mouseY = 0; +camera = [0, 0] +scenexeplayer = { + x: 0, + y: 0, + facing: 0, + vx: 0, + vy: 0, + level: 1, + rotation: 0, + radius: 40, + collisionMass: 520, + type: 1, + bodyDamage: 5, + maxHealth: 10000, + health: 10000, + regenDelay: 14, + regenSpeed: 0.0001, + timeSinceHurt: null, + color: usefulMiscColors.playerBlue, + barrels: [ + { + theta: 0, + damage: 150, + reload: 1, + angle: 0, + spread: 0, + yoffset: 0, + xoffset: 0.5, + length: 1.8, + width: 0.45, + type: 0, + bulletHealth: 60 + }, + { + theta: 0, + damage: 150, + reload: 1, + angle: 0, + spread: 0, + yoffset: 0, + xoffset: -0.5, + length: 1.8, + width: 0.45, + type: 0, + bulletHealth: 60 + } + ] +} +bullets = [] +debug = false +/* + _____ _ _ + | ___| _ _ __ ___| |_(_) ___ _ __ ___ + | |_ | | | | '_ \ / __| __| |/ _ \| '_ \/ __| + | _|| |_| | | | | (__| |_| | (_) | | | \__ \ + |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/ + +*/ function HSVtoRGB(h, s, v) { var r, g, b, i, f, p, q, t; if (arguments.length === 1) { @@ -112,6 +242,13 @@ function makeVisible(color){ colorObject.b = Math.max(40, colorObject.b) return objectToColor(colorObject) } +function darkenPercent(color, percent){ + let colorObject = colorToObject(color) + colorObject.r = Math.floor(colorObject.r * percent) + colorObject.g = Math.floor(colorObject.g * percent) + colorObject.b = Math.floor(colorObject.b * percent) + return objectToColor(colorObject) +} // when wasd keydown, set isKeyDown to true document.addEventListener("keydown", (event) => { if (event.key === "w") { @@ -161,6 +298,18 @@ document.addEventListener("keyup", (event) => { } } }) +document.addEventListener("mousemove", (event) => { + let rect = canvas.getBoundingClientRect(); + mouseX = event.clientX - rect.left; + mouseY = event.clientY - rect.top; +}); +let mouseDown = false; +document.addEventListener("mousedown", (event) => { + mouseDown = true; +}); +document.addEventListener("mouseup", (event) => { + mouseDown = false; +}); orbitalSpeed = function(sides){ return 1/(1.00672*Math.pow(0.344151, sides) + 0.000002) } @@ -210,8 +359,6 @@ function polygonCount(random){ } } } -polygonList = [] -zoomLevel = 0.5 function newPolygon(sides){ polygonList.push({ sides: sides, @@ -236,12 +383,8 @@ function newPolygon(sides){ polygonSize = function(sides){ return 18 * Math.pow(1.47, sides - 3) } -for (var i = 0; i <= 400; i++){ - sides = polygonCount(Math.random()) - newPolygon(sides) -} function drawPolygon(ctx, polygon, index){ - if (Math.abs(polygonList[index].x-camera[0]-polygon.radius