Commit 3071e932 authored by Evan Hahn's avatar Evan Hahn

`isVisible` -> `v`: now to 1006 bytes!

parent b9808a4b
......@@ -10,6 +10,7 @@
* s = delta time
* S = Spark "class"
* t = current time
* v = isVisible?
* x = speed of time (starts at 1)
*/
......@@ -32,6 +33,17 @@ m = {
x = 1
// Is a point visible?
v = (point) => {
return (
(point.x > 0) &&
(point.x < a.width) &&
(point.y > 0) &&
(point.y < a.height)
)
}
// Bolt
B = () => {
......@@ -41,7 +53,7 @@ B = () => {
let points = [lastPoint]
let direction = Math.random() * Math.PI * 2
while (isVisible(lastPoint)) {
while (v(lastPoint)) {
let newLineLength = Math.random() * r / 6
direction += (Math.random() * Math.PI / 1.5) - (Math.PI / 3)
......@@ -114,15 +126,6 @@ B = () => {
return me
}
function isVisible (point) {
return (
(point.x > 0) &&
(point.x < a.width) &&
(point.y > 0) &&
(point.y < a.height)
)
}
// Spark
S = ({ x, y }) => {
......
......@@ -62,10 +62,9 @@ function regpackMinify (sourceBuffer) {
*/
const packerResults = regpack.runPacker(source, {
withMath: true,
hash2DContext: true,
// contextVariableName: 'c',
hash2DContext: false,
reassignVars: true,
varsNotReassigned: ['a', 'b', 'c', 'd']
varsNotReassigned: ['a', 'b', 'c']
})
const resultStrings = packerResults.reduce((resultStrings, packerResult) => {
const packerResultStrings = packerResult.result.map((r) => r[1])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment