Commit 752c6d24 authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

Fix bouncing

parent 1d9fa980
......@@ -3,7 +3,7 @@ defmodule Grains.Mixfile do
def project do
[app: :grains,
version: "0.0.69",
version: "0.0.70",
elixir: "~> 1.2",
elixirc_paths: elixirc_paths(Mix.env),
compilers: [:phoenix, :gettext] ++ Mix.compilers,
......
......@@ -111,10 +111,10 @@ 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.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
......
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