Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
grains
grains-web
Commits
64d623d7
Commit
64d623d7
authored
May 21, 2017
by
Jens-Christian Fischer
Browse files
Wrap around the conductor
parent
c6a16b37
Changes
2
Hide whitespace changes
Inline
Side-by-side
mix.exs
View file @
64d623d7
...
...
@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def
project
do
[
app:
:grains
,
version:
"0.0.7
7
"
,
version:
"0.0.7
8
"
,
elixir:
"~> 1.2"
,
elixirc_paths:
elixirc_paths
(
Mix
.
env
),
compilers:
[
:phoenix
,
:gettext
]
++
Mix
.
compilers
,
...
...
web/static/js/presencesketch.js
View file @
64d623d7
...
...
@@ -111,10 +111,16 @@ Boid.prototype.render = function() {
// Wraparound
Boid
.
prototype
.
borders
=
function
()
{
if
(
this
.
position
.
x
<
this
.
radius
)
this
.
velocity
.
x
=
-
this
.
velocity
.
x
;
if
(
this
.
position
.
y
<
this
.
radius
)
this
.
velocity
.
y
=
-
this
.
velocity
.
y
;
if
(
this
.
position
.
x
>
PresenceSketch
.
width
-
this
.
radius
)
this
.
velocity
.
x
=
-
this
.
velocity
.
x
;
if
(
this
.
position
.
y
>
PresenceSketch
.
height
-
this
.
radius
)
this
.
velocity
.
y
=
-
this
.
velocity
.
y
;
if
(
this
.
position
.
x
<
-
this
.
radius
)
this
.
position
.
x
=
width
+
this
.
radius
;
if
(
this
.
position
.
y
<
-
this
.
radius
)
this
.
position
.
y
=
height
+
this
.
radius
;
if
(
this
.
position
.
x
>
width
+
this
.
radius
)
this
.
position
.
x
=
-
this
.
radius
;
if
(
this
.
position
.
y
>
height
+
this
.
radius
)
this
.
position
.
y
=
-
this
.
radius
;
// if (this.position.x < this.radius) this.velocity.x = -this.velocity.x;
// if (this.position.y < this.radius) this.velocity.y = -this.velocity.y;
// if (this.position.x > PresenceSketch.width - this.radius) this.velocity.x = -this.velocity.x;
// if (this.position.y > PresenceSketch.height - this.radius) this.velocity.y = -this.velocity.y;
};
// Separation
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment