Skip to content

Commit

Permalink
Added some love <3
Browse files Browse the repository at this point in the history
  • Loading branch information
kaliumxyz committed Apr 20, 2017
1 parent 2af081c commit 1044db0
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 30 deletions.
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -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.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# ASAP
A Simple Aesthetic Particle engine.
# ASAP
A Simple Aesthetic Particle engine.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<link href='style.css' rel='stylesheet'>
</head>
<body>
<h1>press space</h1>
<h1>press space or tap the screen</h1>
<canvas width="1000" height="1000">If you can read this, your browser does not support HTML5 canvas.</canvas>
</body>
<script src='load.js'></script>
Expand Down
5 changes: 3 additions & 2 deletions load.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 5 additions & 4 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
'use strict'

const context = canvas.getContext('2d')

// Lets not hamper any further keypresses shall we?
Expand Down Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ h1 {
top: 80px;
position: fixed;
text-align: center;
user-select: none;
}

0 comments on commit 1044db0

Please sign in to comment.