diff --git a/LICENSE b/LICENSE index 8864d4a..911ea4a 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,21 @@ -MIT License - -Copyright (c) 2017 - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +MIT License + +Copyright (c) 2017 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index c01c93a..6313265 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# ASAP -A Simple Aesthetic Particle engine. +# ASAP +A Simple Aesthetic Particle engine. diff --git a/index.html b/index.html index 5cbba33..36ed6cc 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,7 @@ -

press space

+

press space or tap the screen

If you can read this, your browser does not support HTML5 canvas. diff --git a/load.js b/load.js index 4583a53..a438f12 100644 --- a/load.js +++ b/load.js @@ -19,5 +19,6 @@ window.onresize = _ => { window.onload = window.onresize -// call load() if space is pressed. -window.onkeydown = e => e.keyCode===32 && loadScript() +// call loadScript() if space is pressed. +window.onkeydown = e => e.keyCode===32?loadScript():e +window.onclick = loadScript \ No newline at end of file diff --git a/main.js b/main.js index 703b5e0..d503e9e 100644 --- a/main.js +++ b/main.js @@ -1,4 +1,5 @@ 'use strict' + const context = canvas.getContext('2d') // Lets not hamper any further keypresses shall we? @@ -99,16 +100,16 @@ const gravity = entity => { let y = particle.coords.y - entity.coords.y if (particle !== entity){ - particle.acc.x += 1 / x - particle.acc.y += 1 / y + particle.acc.x += force / x + particle.acc.y += force / y } // actually implement gravity pl0x }) } const move = particle => { - particle.coords.x += particle.acc.x - particle.coords.y += particle.acc.y + particle.coords.x += particle.acc.x / particle.mass + particle.coords.y += particle.acc.y / particle.mass } // collision stuff here. diff --git a/style.css b/style.css index 278d071..e5f7b25 100644 --- a/style.css +++ b/style.css @@ -9,4 +9,5 @@ h1 { top: 80px; position: fixed; text-align: center; + user-select: none; }