Skip to content

Commit

Permalink
merged with master
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedeboer committed Nov 16, 2011
2 parents d672ec3 + a50ae55 commit bbbef7c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion public_html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<title>Mario Kart!</title>
<script src="/socket.io/socket.io.js"></script>
<script src="socket.io/socket.io.js"></script>
<script src="mariokart-0.2.js"></script>
<style type="text/css" media="all">
#mariokartcontainer img {
Expand Down
15 changes: 8 additions & 7 deletions public_html/mariokart-0.2.js
Original file line number Diff line number Diff line change
Expand Up @@ -417,13 +417,13 @@ function MarioKart() {
return;
}
oSpriteCtr.style.display = "block";
var fSpriteSize = 32 * fSpriteScale * fScale;
oSpriteCtr.style.left = (iX - fSpriteSize / 2) + "px";
oSpriteCtr.style.top = (iY - fSpriteSize / 2) + "px";
var fSpriteSize = Math.round(32 * fSpriteScale * fScale);
oSpriteCtr.style.left = Math.round(iX - fSpriteSize / 2) + "px";
oSpriteCtr.style.top = Math.round(iY - fSpriteSize / 2) + "px";
oImg.style.height = fSpriteSize + "px";
oSpriteCtr.style.width = fSpriteSize + "px";
oSpriteCtr.style.height = fSpriteSize + "px";
oImg.style.left = -(fSpriteSize * iActiveState) + "px";
oImg.style.left = -Math.round(fSpriteSize * iActiveState) + "px";
}
this.setState = function(iState) {
iActiveState = iState;
Expand Down Expand Up @@ -455,7 +455,7 @@ function MarioKart() {
}
oImg1.src = "media/bg_" + strImage + ".png";
oCanvas1.style.width = Math.round(iLayerWidth / 2 * iScreenScale + iScreenScale) + "px"
oCanvas1.style.height = (10 * iScreenScale) + "px";
oCanvas1.style.height = Math.round(10 * iScreenScale) + "px";
oCanvas1.style.position = "absolute";
oCanvas1.style.left = "0px";
var oCanvas2 = document.createElement("canvas");
Expand All @@ -466,7 +466,7 @@ function MarioKart() {
}
oImg2.src = "media/bg_" + strImage + ".png";
oCanvas2.style.width = Math.round(iLayerWidth / 2 * iScreenScale) + "px";
oCanvas2.style.height = (10 * iScreenScale) + "px";
oCanvas2.style.height = Math.round(10 * iScreenScale) + "px";
oCanvas2.style.position = "absolute";
oCanvas2.style.left = Math.round(iLayerWidth * iScreenScale) + "px";
oLayer.appendChild(oCanvas1);
Expand Down Expand Up @@ -557,6 +557,7 @@ function MarioKart() {
fAngle -= 360;
var iAngleStep = Math.round(fAngle / (360 / 22));
if (iAngleStep == 22) iAngleStep = 0;

oKart.sprite.setState(iAngleStep);
oKart.sprite.div.style.zIndex = Math.round(zIndexBase - fTransY);
oKart.sprite.draw(((iWidth / 2) + fViewX) * iScreenScale, (iHeight - iViewY) * iScreenScale, fFocal / (fFocal + (fTransY)));
Expand Down Expand Up @@ -1087,4 +1088,4 @@ onDomReady(function() {
exports.MarioKart = new MarioKart();
});

})(self);
})(self);

0 comments on commit bbbef7c

Please sign in to comment.