Skip to content
Snippets Groups Projects
Commit cca1d355 authored by mcmlxxix's avatar mcmlxxix
Browse files

bug fixes

parent 06a99879
No related branches found
No related tags found
No related merge requests found
......@@ -228,7 +228,7 @@ function lobby()
var gameNumber=getNewGameNumber();
var rootFileName=getRootFileName(gameNumber);
var maze=new Maze(rootFileName,gameNumber);
sendFiles(rootFileName + ".maz");
sendFiles(maze.mazeFile);
joinMaze(maze,user.alias);
mazes[maze.gameNumber]=maze;
}
......@@ -281,10 +281,7 @@ function lobby()
file.open('r+',true);
file.iniSetValue("players",player);
file.close();
var update=new Packet("PLAYER");
update.dataFile=maze.dataFile;
update.name=player;
stream.send(update);
sendFiles(maze.dataFile);
}
function loadMaze(gameNumber)
{
......
......@@ -82,7 +82,6 @@ function Maze(rootFile,gameNumber)
}
this.goToStartingPosition=function(player)
{
log(this.start);
player.coords=new Coords(this.start.x,this.start.y);
}
this.findStartFinish=function()
......@@ -98,8 +97,6 @@ function Maze(rootFile,gameNumber)
this.maze.data[x][y].attr=14;
}
if(this.start && this.finish) {
log("start: " + this.start.x + "," + this.start.y +
" finish: " + this.finish.x + "," + this.finish.y);
return true;
}
}
......@@ -126,7 +123,6 @@ function Maze(rootFile,gameNumber)
file.close();
for(var p in players) {
log("loading player: " + players[p]);
if(!this.players[players[p]]) {
this.players[players[p]]=new Player(players[p],this.pcolors.shift(),100);
}
......
......@@ -35,9 +35,10 @@ function Timer(color)
console.putmsg(this.color + time);
console.attributes=ANSI_NORMAL;
}
this.countDown=function(difference)
this.countDown=function()
{
if(this.countdown<=0) return false;
var difference=time()-this.lastupdate;
this.countdown-=difference;
this.lastupdate=time();
return true;
......
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