Permalink
Browse files

Updated file structure and cleaned JS

  • Loading branch information...
1 parent a4237aa commit ee62a86a8acf6fdf0fbd95b4a04f6625e4d6e251 Danny Croft committed Dec 26, 2010
Showing with 13 additions and 13 deletions.
  1. BIN img/electric.png
  2. BIN img/spark.png
  3. BIN img/star.png
  4. +13 −13 js/canvas.js
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -7,29 +7,31 @@ $(function(){
function goCanvas(){
- var chosen_image = $("#image_src :selected").val() + ".png";
+ var chosen_image = "img\/" + $("#image_src :selected").val() + ".png";
var chosen_gravity = $("#gravity :selected").val();
-
+ var drag = 0.99;
+ var gravity = 0.5;
+
switch(chosen_gravity) {
case "0":
- var drag = 1;
- var gravity = 0.01;
+ drag = 1;
+ gravity = 0.01;
break;
case "1":
- var drag = .99;
- var gravity =.5;
+ drag = 0.99;
+ gravity = 0.5;
break;
case "2":
- var drag = .99;
- var gravity = 1;
+ drag = 0.99;
+ gravity = 1;
break;
case "3":
- var drag = .99;
- var gravity = 1.5;
+ drag = 0.99;
+ gravity = 1.5;
break;
}
@@ -75,7 +77,6 @@ $(function(){
this.x *= s;
this.y *= s;
this.z *= s;
-
}
}
@@ -101,8 +102,7 @@ $(function(){
this.vel.y += gravity;
}
}
-
-
+
}
function setup() {

0 comments on commit ee62a86

Please sign in to comment.