Jump to content

Search the Community

Showing results for tags 'array ajax json canvas game'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • HTML5 Game Coding
    • News
    • Game Showcase
    • Facebook Instant Games
    • Web Gaming Standards
    • Coding and Game Design
    • Paid Promotion (Buy Banner)
  • Frameworks
    • Pixi.js
    • Phaser 3
    • Phaser 2
    • Babylon.js
    • Panda 2
    • melonJS
    • Haxe JS
    • Kiwi.js
  • General
    • General Talk
    • GameMonetize
  • Business
    • Collaborations (un-paid)
    • Jobs (Hiring and Freelance)
    • Services Offered
    • Marketplace (Sell Apps, Websites, Games)

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Skype


Location


Interests

Found 1 result

  1. Hi, I want to quad my board game, I don't know how to do...., after I must to add weapons and characters on it. My characters must to move 3 cells max. I need to draw gridlines to retrieve (or display) the coordinates of each box in order to have a good base, I do not want to make a table .. I have worries because I do not master well json, I feel lost. I have weapons to add to the canvas but there are outside ... I must absolutely use the file json where is the images of the weapons and insert it inside the canvas so to it with mapArray . Sorry for my english? I need your help !! Thanks var mapArray = [ [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 0] ]; function drawMap() { var col = []; var table = document.createElement("table"); for (var i = 0; i < mapArray.length; i++) { for (var j = 0; j < mapArray[i].length; j++) { if (parseInt(mapArray[i][j]) == 0) { $('#canvas').append('<div class="grass"></div>'); } if (parseInt(mapArray[i][j]) == 1) { $('#canvas').append('<div class="wall"></div>'); }}}} $('document').ready(function() { drawMap(); }); $(document).ready(function(){ $.ajax({ url:"item.json", type:"GET", success:function(data){ console.log(data.myImages); $.each(data.myImages, function (i, f) { $("#canvas").append("<img src=" + f.url+ " / >"); }); }, error:function(jqXHR,textStatus,errorThrown){ alert(textStatus + errorThrown); }
×
×
  • Create New...