Permalink
Browse files

minor cleanup

  • Loading branch information...
1 parent dc545da commit 2f6c334182f214c95bd523ec2e2f98fc17be4336 @stravid stravid committed Dec 29, 2010
Showing with 27 additions and 12 deletions.
  1. +17 −9 demo/javascripts/base.js
  2. +10 −3 marblelog/index.html
View
@@ -1,7 +1,4 @@
Event.observe(window, 'load', function() {
-
- console.log("Load Event");
-
var domCanvas = $('canvas'),
drawingContext = domCanvas.getContext('2d'),
canvasWidth = parseInt(domCanvas.width),
@@ -32,19 +29,32 @@ shapeDefinition.restitution = 0;
shapeDefinition.density = 2;
shapeDefinition.friction = 0.9;
-//body.w = 1;
-//body.h = 1;
-
body.CreateShape(shapeDefinition);
body.SetMassFromShapes();
elements.push(body);
}
+var bodyDefinition = new b2BodyDef(),
+ body,
+ shapeDefinition;
-// TODO: figure out what the drawing interval is, what a step is, and how these values correlate to each other!
+bodyDefinition.position.Set(66, 55);
+body = world.CreateBody(bodyDefinition);
+
+shapeDefinition = new b2PolygonDef();
+shapeDefinition.SetAsBox(2.5, 2.5);
+shapeDefinition.restitution = 0;
+shapeDefinition.friction = 0.9;
+
+body.CreateShape(shapeDefinition);
+body.SetMassFromShapes();
+elements.push(body);
+
+
+// TODO: figure out what the drawing interval is, what a step is, and how these values correlate to each other!
setInterval(function() {
world.Step(1.0/60.0, 10);
@@ -80,7 +90,5 @@ setInterval(function() {
}
}
-
-
}, 1000 / 30);
});
View
@@ -82,9 +82,16 @@
content += "<li><h2>Photos</h2>";
content += "<span>" + post["date"] + "</span>";
- for (var j = 0; j < post.photos.length; j++) {
- content += '<p class="photoCaption">' + post.photos[j]['caption'] + '</p>';
- content += '<img src="' + post.photos[j]['photo-url-500'] + '" alt="' + post.photos[i]['caption'] + '">';
+ console.log(post);
+
+ if (post.photos.length) {
+ for (var j = 0; j < post.photos.length; j++) {
+ content += '<p class="photoCaption">' + post.photos[j]['caption'] + '</p>';
+ content += '<img src="' + post.photos[j]['photo-url-500'] + '" alt="' + post.photos[i]['caption'] + '">';
+ }
+ } else {
+ content += '<p class="photoCaption">' + post['photo-caption'] + '</p>';
+ content += '<img src="' + post['photo-url-500'] + '" alt="' + post['photo-caption'] + '">';
}
break;

0 comments on commit 2f6c334

Please sign in to comment.