aboutsummaryrefslogtreecommitdiffstats
path: root/examples/declarative/particles/spaceexplorer/content/helpers.js
diff options
context:
space:
mode:
Diffstat (limited to 'examples/declarative/particles/spaceexplorer/content/helpers.js')
-rw-r--r--examples/declarative/particles/spaceexplorer/content/helpers.js8
1 files changed, 8 insertions, 0 deletions
diff --git a/examples/declarative/particles/spaceexplorer/content/helpers.js b/examples/declarative/particles/spaceexplorer/content/helpers.js
new file mode 100644
index 0000000000..c38c4c0eed
--- /dev/null
+++ b/examples/declarative/particles/spaceexplorer/content/helpers.js
@@ -0,0 +1,8 @@
+function intersects(item, x, y, e){
+ return x+e >= item.x && x-e <= item.x + item.width && y+e >= item.y && y-e <= item.y + item.height;
+}
+
+function direction(x1, y1, x2, y2){
+ return Math.atan2(y2-y1, x2-x1) * (180/Math.PI);
+}
+