Team:StuyGem NYC

From 2014hs.igem.org

(Difference between revisions)
Line 174: Line 174:
     </script>
     </script>
<script>
<script>
-
var canvas = document.getElementById('gameCanvas');
+
var canvas = document.getElementById('c');
-
var ctx = canvas.getContext('2d');
+
var ctx = canvas.getContext('2d');
-
var imageObj = new Image();
+
var imageObj = new Image();
       imageObj.onload = function() {
       imageObj.onload = function() {
         ctx.drawImage(imageObj, 75, 170);
         ctx.drawImage(imageObj, 75, 170);
Line 197: Line 197:
       imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/9/92/Project.png';
       imageObj4.src = 'https://static.igem.org/mediawiki/2014hs/9/92/Project.png';
-
function getMousePos(canvas, evt) {
+
 +
 +
 +
 +
  function getMousePos(canvas, evt) {
var rect = canvas.getBoundingClientRect();
var rect = canvas.getBoundingClientRect();
return {
return {
Line 204: Line 208:
};
};
  }
  }
-
canvas.addEventListener('mousemove', function(evt){
+
 
 +
 
 +
  canvas.addEventListener('mousemove', function(evt){
  var mousePos = getMousePos(canvas, evt);
  var mousePos = getMousePos(canvas, evt);
if ((mousePos.x < 250) && (mousePos.y < 250)) {
if ((mousePos.x < 250) && (mousePos.y < 250)) {
Line 232: Line 238:
  }
  }
  );
  );
-
 
-
 
</script>
</script>
   </body>
   </body>
</html>
</html>

Revision as of 03:03, 17 April 2014


StuyGem NYC





Get in touch!

Visit Our Twitter Page!