Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- IN APP.JS
- (currentGameState == gameStates.running)
- {
- context.textBaseline = 'middle';
- context.textAlign = "center";
- context.font = '40pt Calibri';
- policeSize = 40;
- context.fillStyle = 'white';
- context.textBaseline = 'middle';
- context.textAlign = 'center';
- clearCanvas();
- dessinerMap(1,context); // NO ERRORS BUT NOT DRAWING :(
- context.fillStyle = "#FF0000";
- context.fillRect(100,100,250,175); // WORKING
- context.drawImage(brique, 250, 80); // WORKING because "brique" is created at the beginning of the file
- -------------------------------------------------------------------------------------------------
- IN MAP.JS
- function drawMap(index, canvas){
- $.ajax(
- {
- url : '../map/' + "level"+index+'.json',
- type : 'GET',
- dataType : 'json',
- success: function(result){
- console.log(result.tilesets[0].name);
- var image = new Image();
- image.src = 'images/'+result.tilesets[0].name+'.png';
- image.onload = function() {
- console.log(image.src);
- canvas.drawImage(image, 0, 0);
- };
- }});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement