summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--about/css/main.css1
-rw-r--r--cars/js/main.js18
-rw-r--r--js/background-sparkles.js4
3 files changed, 13 insertions, 10 deletions
diff --git a/about/css/main.css b/about/css/main.css
index c3e08d0..bd80b97 100644
--- a/about/css/main.css
+++ b/about/css/main.css
@@ -28,4 +28,5 @@
.important {
color: red;
+ font-size: 20px
} \ No newline at end of file
diff --git a/cars/js/main.js b/cars/js/main.js
index 010a278..6e551f2 100644
--- a/cars/js/main.js
+++ b/cars/js/main.js
@@ -72,12 +72,12 @@ class Wall {
this.width = width / 36;
this.length = this.width * 2;
this.isAccelerating = false;
- this.rotation = 0;
+ this.rotation = 0; // If you set this to 100, it goes wack lmao 9/15/2019
this.color = paintColor;
this.history = [];
const options = {
density: 0.01,
- friction: 0.2,
+ friction: 0.0, // Usually 0.2 but Jared wanted to move easier 9/15/2019
mass: 50
};
this.body = Bodies.rectangle(
@@ -205,7 +205,7 @@ class Wall {
let engine;
let world;
- const exaustClouds = 25;
+ const exaustClouds = 25; // Set this to anything above 50, it goes wild 9/15/2019
let car;
let computerCar;
let ball;
@@ -247,19 +247,21 @@ class Wall {
}
function keyReleased() {
- if (keyCode == UP_ARROW) {
+ if (keyCode == 87) { // UP_ARROW
car.accelerating(false);
- } else if (keyCode == RIGHT_ARROW || keyCode == LEFT_ARROW) {
+ } else if (keyCode == 68 || keyCode == 65) { // RIGHT_ARROW, LEFT_ARROW
car.rotate(0);
}
}
+ // TODO: Add multiple key layout functionality, eg. both WASD and arrow keys.
+
function keyPressed() {
- if (keyCode == RIGHT_ARROW) {
+ if (keyCode == 68) { // RIGHT_ARROW
car.rotate(PI / 72);
- } else if (keyCode == LEFT_ARROW) {
+ } else if (keyCode == 65) { // LEFT_ARROW
car.rotate(-PI / 72);
- } else if (keyCode == UP_ARROW) {
+ } else if (keyCode == 87) { // UP_ARROW
car.accelerating(true);
}
}
diff --git a/js/background-sparkles.js b/js/background-sparkles.js
index bce6b94..50f073c 100644
--- a/js/background-sparkles.js
+++ b/js/background-sparkles.js
@@ -12,9 +12,9 @@ var pattern = Trianglify({
width: window.innerWidth,
x_colors: ['#040404', '#f9f9f9', '#fffff4', '#fbf7f5', '#d55454'], // Cappuccino: ['#854442', '#3c2f2f', '#fff4e6', '#be9b7b', '#4b3832']
y_colors: ['#f9f1f1', '#f9f9f9', '#fffff4', '#fbf7f5', '#f9f1f1'], // Random colour generator: "#"+((1<<24)*Math.random()|0).toString(16)
- variance: 10,
+ variance: 10, // Gives it more style
seed: Number.parseInt(Math.floor(Math.random() * 100)), // TODO: Live seed transitioning.
- cell_size: 160
+ cell_size: 160 // Cell size
});
// // Canvas