Skip to content
Snippets Groups Projects
Commit aeb5ed9f authored by Manuel Herrmann's avatar Manuel Herrmann
Browse files

translation fix for ff.. todo for later

parent ad4c4220
No related branches found
No related tags found
No related merge requests found
...@@ -51,8 +51,9 @@ Camera.prototype.updatePosition = function() { ...@@ -51,8 +51,9 @@ Camera.prototype.updatePosition = function() {
var translation = Vec.add(Vec.flipSign(this.translation), Vec.mul(Game.config.size, 0.5)); // move subject to center var translation = Vec.add(Vec.flipSign(this.translation), Vec.mul(Game.config.size, 0.5)); // move subject to center
if(translation[0] > 0) translation[0] = 0; if(translation[0] > 0) translation[0] = 0;
if(translation[1] > 0) translation[1] = 0; if(translation[1] > 0) translation[1] = 0;
if(translation[0] < (Game.config.size[0] - svg.clientWidth)) translation[0] = Game.config.size[0] - svg.clientWidth; // @TODO: rework for firefox
if(translation[1] < (Game.config.size[1] - svg.clientHeight)) translation[1] = Game.config.size[1] - svg.clientHeight; //if(translation[0] < (Game.config.size[0] - svg.clientWidth)) translation[0] = Game.config.size[0] - svg.clientWidth;
//if(translation[1] < (Game.config.size[1] - svg.clientHeight)) translation[1] = Game.config.size[1] - svg.clientHeight;
root.style.left = translation[0]+'px'; root.style.left = translation[0]+'px';
root.style.top = translation[1]+'px'; root.style.top = translation[1]+'px';
}; };
......
...@@ -77,12 +77,12 @@ Game.prototype.loadMap = function(map) { ...@@ -77,12 +77,12 @@ Game.prototype.loadMap = function(map) {
// test animation // test animation
var ship = svg.select("#shipGroup"); /*var ship = svg.select("#shipGroup");
ship ship
.attr("transform", function(d,i) { return "translate(200,000)"; }); .attr("transform", function(d,i) { return "translate(200,000)"; });
ship.transition() ship.transition()
.duration(3000) .duration(3000)
.attr("transform", function(d,i) { return "translate(0,0)"; }); .attr("transform", function(d,i) { return "translate(0,0)"; });*/
done(); done();
}); });
...@@ -113,7 +113,7 @@ Game.prototype.loadMap = function(map) { ...@@ -113,7 +113,7 @@ Game.prototype.loadMap = function(map) {
function startMainLoop(){ function startMainLoop(){
Game.mainLoop = setInterval(function() { Game.mainLoop = setInterval(function() {
if (Game.char.loaded) { if (Game.char && Game.char.loaded) {
// move player // move player
Game.char.physics(); Game.char.physics();
Game.char.animate(); Game.char.animate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment