Commit fe233ce1 authored by Eben Blaisdell's avatar Eben Blaisdell

orientation and 2 actions test

parent 281e3bfc
......@@ -441,10 +441,12 @@ Block.prototype.transformDir = function(dir){
return (dir + this.orient)%4;
}
Block.prototype.untransformDir = function(dir){
return (dir - this.orient)%4;
return (4 + dir - this.orient)%4;
}
Block.prototype.isOpen = function(dir){
console.log(dir);
dir = this.untransformDir(dir);
console.log(dir);
newx = this.x + Block.dx(dir);
newy = this.y + Block.dy(dir);
if(newx<0 || newy<0 || newx>=this.game.width || newy>=this.game.height) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment