Commit 4709e245 authored by Eben Blaisdell's avatar Eben Blaisdell

orientation and 2 actions test

parent cac02bac
......@@ -461,6 +461,7 @@ Block.prototype.move = function(dir){
}
this.actions--;
if(this.isOpen(dir)) {
dir = parseInt(dir);
dir = this.untransformDir(dir);
newx = this.x + Block.dx(dir);
newy = this.y + Block.dy(dir);
......@@ -475,6 +476,7 @@ Block.prototype.attack = function(dir) {
return;
}
this.actions--;
dir = parseInt(dir);
dir = this.untransformDir(dir);
attackx = this.x + Block.dx(dir);
attacky = this.y + Block.dy(dir);
......@@ -492,11 +494,12 @@ Block.prototype.onTurn =function (){
Block.prototype.sendMessage = function(dir){
//console.log("onMessage");
//console.log(dir);
dir = parseInt(dir);
dir = this.untransformDir(dir);
messagex = this.x + Block.dx(dir);
messagey = this.y + Block.dy(dir);
if(messagex>=0 && messagey>=0 && messagex<this.game.width && messagey<this.game.height && this.game.board[messagex][messagey] != null) {
this.game.board[messagex][messagey].onMessage(((parseInt(dir)+2)%4).toString());
this.game.board[messagex][messagey].onMessage(((dir+2)%4).toString());
}
}
Block.prototype.onMessage = function(dir){
......
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