Difference between revisions of "Team:Carnegie Mellon/game"

Line 1: Line 1:
 
{{:Team:Carnegie_Mellon/navbar}}
 
{{:Team:Carnegie_Mellon/navbar}}
 
+
<!DOCTYPE html>
<html>
+
<html lang="en">
  
 
<head>
 
<head>
 
<title>Luciferase: The Game</title>
 
<title>Luciferase: The Game</title>
+
<meta charset="UTF-8">
 
<link rel="stylesheet" media="screen" href="http://openfontlibrary.org/face/dancing" rel="stylesheet" type="text/css"/>  
 
<link rel="stylesheet" media="screen" href="http://openfontlibrary.org/face/dancing" rel="stylesheet" type="text/css"/>  
 
<style type="text/css">
 
<style type="text/css">
Line 243: Line 243:
 
}
 
}
 
}
 
}
if(this.luminescence>STARTLUMINANCE+this.radius){
+
if(this.luminescence>STARTLUMINANCE+this.radius && !this.isComputer){
 
this.luminescence -= LIGHTDECREASERATE;
 
this.luminescence -= LIGHTDECREASERATE;
 
}
 
}
Line 872: Line 872:
 
function restart(){
 
function restart(){
 
var temp = new Cell(false, "mainPlayer"); //NOT a computer
 
var temp = new Cell(false, "mainPlayer"); //NOT a computer
                        _myCell.resize(temp.radius);
+
            _myCell.resize(temp.radius);
                        _myCell.destroy();
+
            _myCell.destroy();
 
temp.spawnCell();
 
temp.spawnCell();
 
updateDarkness(temp);
 
updateDarkness(temp);
                        _myCell=temp;
+
            _myCell=temp;
 
}
 
}
 
 
Line 882: Line 882:
 
//make border and boundaries;
 
//make border and boundaries;
 
var gameWrapper = document.getElementById("gameWrapper");
 
var gameWrapper = document.getElementById("gameWrapper");
 +
gameWrapper.removeChild(document.getElementById("message"));
 
width=gameWrapper.offsetWidth;
 
width=gameWrapper.offsetWidth;
 
height=gameWrapper.offsetHeight;
 
height=gameWrapper.offsetHeight;
Line 892: Line 893:
 
_div.style.outline = "#FF0000 dotted thick";
 
_div.style.outline = "#FF0000 dotted thick";
 
bindEvents();
 
bindEvents();
 
 
_myCell = new Cell(false, "mainPlayer"); //NOT a computer
 
_myCell = new Cell(false, "mainPlayer"); //NOT a computer
 
_myCell.spawnCell();
 
_myCell.spawnCell();
Line 904: Line 904:
 
Spike.SpawnSpikes(SPIKESTARTSPAWN);
 
Spike.SpawnSpikes(SPIKESTARTSPAWN);
 
/*end server */
 
/*end server */
 +
 
setInterval(gameLoop, MSPF);
 
setInterval(gameLoop, MSPF);
 
}
 
}
Line 911: Line 912:
 
<body>
 
<body>
 
<div style="width:50px;background-color:red"> <a href="https://2015.igem.org/Team:Carnegie_Mellon">Home</a> </div>
 
<div style="width:50px;background-color:red"> <a href="https://2015.igem.org/Team:Carnegie_Mellon">Home</a> </div>
<div id="gameWrapper" onclick="main();" style="width:800px; height:800px; position:absolute; background-color:MidnightBlue;overflow:hidden;border-style:outset;border-width:10px;border-color:green">
+
<div id="gameWrapper" onclick="main();" style="width:400px; height:400px; position:absolute; background-color:MidnightBlue;overflow:hidden;border-style:outset;border-width:10px;border-color:green">
 
<div id="message">Press to Play</div>
 
<div id="message">Press to Play</div>
 
</div>
 
</div>
 +
 
</body>
 
</body>
  
 
</html>
 
</html>

Revision as of 17:47, 24 August 2015

<!DOCTYPE html> Luciferase: The Game
Home
Press to Play