Skip to content

Commit

Permalink
Fixed a bug with the loading order in editor; moved the inputs around…
Browse files Browse the repository at this point in the history
… to make more sense
  • Loading branch information
Jono Xia committed Jan 21, 2012
1 parent 1d4e173 commit c7e303d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
36 changes: 17 additions & 19 deletions webrunner-edit.js
Expand Up @@ -17,12 +17,8 @@ function adjustToScreen() {
}

function showhide(id) {
var div = $("#" + id);
if (div.css("display") != "none") {
div.css("display", "none");
} else {
div.css("display", "block");
}
$(".hidden-panel").css("display", "none");
$("#" + id).css("display", "block");
}

function GenericPlacementTool(cons) {
Expand Down Expand Up @@ -370,7 +366,7 @@ function makeFancyButton(constructorName) {
var obj = new cons(loader);
loader.loadThemAll( function() {
obj.boxInit(0, 0, width, height);
obj.draw(ctx);
//obj.draw(ctx);
});
container.append("<br/>");
}
Expand Down Expand Up @@ -444,15 +440,6 @@ $(document).ready(function() {
$("#level-goal-url").val(TheWorld.goalUrl);
$("#level-music-url").val(TheWorld.musicUrl);

var resizeTimer = null;
adjustToScreen();
$(window).resize(function() {
if (resizeTimer) {
clearTimeout(resizeTimer);
}
resizeTimer = setTimeout(adjustToScreen, 500);
});

for (var prop in PhysicsConstants) {
$("#" + prop).val( PhysicsConstants[prop] );
}
Expand All @@ -461,9 +448,20 @@ $(document).ready(function() {
$("#publish").attr("checked", "checked");
}

loader.loadThemAll(redraw, function(progress) {
progressBar.draw(0.5 + 0.5 * progress);
});
loader.loadThemAll(
function() {
var resizeTimer = null;
adjustToScreen();
$(window).resize(function() {
if (resizeTimer) {
clearTimeout(resizeTimer);
}
resizeTimer = setTimeout(adjustToScreen, 500);
});
},
function(progress) {
progressBar.draw(0.5 + 0.5 * progress);
});
};

// Playing online or offline?
Expand Down
6 changes: 3 additions & 3 deletions webrunner-mobs.js
Expand Up @@ -85,19 +85,19 @@ Mob.prototype = {
this.vx = 0;
this.left = intercept.x - this.width;
this.top = intercept.y;
playSfx("bonk-sfx")
playSfx("bonk-sfx");
break;
case "right":
this.vx = 0;
this.left = intercept.x;
this.top = intercept.y;
playSfx("bonk-sfx")
playSfx("bonk-sfx");
break;
case "bottom":
this.vy = 0;
this.left = intercept.x;
this.top = intercept.y;
playSfx("bonk-sfx")
playSfx("bonk-sfx");
break;
}
},
Expand Down

0 comments on commit c7e303d

Please sign in to comment.