Flags with Rectangles

From ProgZoo
Revision as of 17:32, 9 July 2023 by Andr3w (talk | contribs)
Jump to navigation Jump to search

Movement in Squares

function drawFlag(ctx)
{
  ctx.fillStyle = 'white';
  ctx.fillRect(0,0,240,240);
  for(let y=0;y<12;y++){
    for(let x=0;x<24;x++){
       if ((x+y)%2==1){
         ctx.fillRect(240*x/24,240*y/12,240/24,240/12);
       }
    }
  }
}  
function drawFlag(ctx)
{
  ctx.fillStyle = 'green';
  ctx.fillRect(0,0,150,100);
}