Skip to content
Browse files

Merge branch 'master' of github.com:ericz/shot3

  • Loading branch information...
2 parents 3ae6fc0 + 09cf689 commit 3f4e8df650aa5985c84ecea2b14c18e8cf0e3208 @ericz committed Feb 18, 2012
Showing with 10 additions and 5 deletions.
  1. +4 −3 admin/public/js/display.js
  2. +6 −2 physics.js
View
7 admin/public/js/display.js
@@ -39,7 +39,6 @@ var frameGap;
var draw = function( drawables) {
var ballTop = drawables.ball.y - drawables.ball.radius;
var ballLeft = drawables.ball.x - drawables.ball.radius;
- console.log(ballTop);
$("#ball").offset({ top: ballTop, left: ballLeft});
//console.log(JSON.stringify(drawables.ball));
$("#paddle").offset({top: drawables.paddle.x1, left: drawables.paddle.x2});
@@ -51,8 +50,10 @@ window.onload = function() {
console.log("ONLOAD");
bridge.ready(function() {
bridge.joinChannel('shot3', { draw: draw}, function(){});
- bridge.getService("physics", function(x) {
- x.debug([[{x: 0, y: 0}, {x: 200, y: 200}],[{x: 50, y: 200},{x:250,y:400}]]);
+ bridge.getService("admin", function(x) {
+ x.addRect($(window).width(), $(window).height(), function(rotate, tl) {
+ console.log(tl, rotate);
+ });
});
});
};
View
8 physics.js
@@ -78,7 +78,7 @@ physics = {
var monitors = physics.translate(rawmonitors);
monitors.sort(physics.sortByY);
-
+ console.log(monitors);
// Top edge.
var topL = { x: monitors[0].x, y: monitors[0].y };
var topR = { x: monitors[0].x + monitors[0].width, y: monitors[0].y };
@@ -89,13 +89,16 @@ physics = {
// Set of all defining corners.
var corners = [];
-
+ console.log('before for loop');
for (var i in monitors) {
var m = monitors[i];
var tl = { x: m.x, y: m.y };
var br = { x: m.x + m.width, y: m.y + m.height };
var rotate = physics.genericRotation(m.orientation);
+ m.callback[0](rotate, tl);
+ console.log('hi');
+
var pair = [tl, br, rotate];
corners.push(pair);
@@ -117,6 +120,7 @@ physics = {
botR.x = Math.max(br.x, botR.x);
}
}
+ console.log(monitors);
var sharad = {
corners: corners,
softs: {

0 comments on commit 3f4e8df

Please sign in to comment.
Something went wrong with that request. Please try again.