• Question
  • How to make looped sprites have stats

ok so i have been trying to make smth that would make it so sprites that were made by loops could have stats on each individual sprite (like for example value)

function drawGridsRow(y) {
  var x = 25;
  for (var i = 0; i < 8; i++) {
    createGrids(x, y);
    x += 50;
  }
}

function drawGrids() {
  var y = 125;
  for (var i = 0; i < 6; i++) {
    drawGridsRow(y);
    y += 50;
  }
}

store the sprites in an array and to set/get the stats of any of the sprites use array[index]

i don't recommend using very large grids in CDO tho becoz CDO can't handle giant for loops without a 90% decrease in FPS tho, so use a smaller grid if u can

    this dudes got so many questions you could make a playlist of all of them

      ok why whenever i wake up my brain is using 100% of its power in programing

      ackvonhuelio This is partially true... however, it can handle images super well just not draw calls, by introducing surfaces that can hold a chached grid you can render a bigger grid without having to deal with that type of drawback it just requires a lot more foresight best case of showcasing that aspect is my amaze game that can handle 20x20 grids without said drawback though I will admit it doesn't have the full performance with this trick, you can definitely get away with bigger grids
      https://studio.code.org/projects/gamelab/k1LElJ9BCfbxgz4Kot6gAU_EHb6JCxhFJLj6DT-pXDA/ anywho this is what i got for real time particle rendering or at least the most acceptable movement along with it not slowing down for me.... this site wasn't based around performance though and was surprised i was able to get this much out of it especially with how sandboxed it is

      Chat