hello,
what is that?
everytime it works, but this time it does not
$(function() { //jquery doc ready
world = createWorld(); // box2DWorld
ctx = $('#game').getContext('2d'); // 2
var canvasElm = $('#game');
return;
canvasWidth = parseInt(canvasElm.width);
canvasHeight = parseInt(canvasElm.height);
initGame(); // 3
step(); // 4
// 5
window.addEventListener('keydown',handleKeyDown,true);
window.addEventListener('keyup',handleKeyUp,true);
});
What is wrong here? WHy no get context?
and html:
<html>
<body>
<head>
<!--[if IE]><script src="lib/excanvas.js"></script><![endif]-->
<!--<script src="libs/prototype-1.6.0.2.js"></script> -->
<!-- <script src="//ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js"></script> -->
<script type="text/javascript" src="libs/jquery-1.7.1.min.js"></script>
<!-- box2djs -->
<script src="libs/Box2dWeb-2.1.a.3.min.js"></script>
<script src='js/box2dutils.js'></script>
<script src='js/game.js'></script>
</head>
<canvas id="game" width="600" height="400"></canvas>
</body>
</html>