(width, height)
| 98 | } |
| 99 | |
| 100 | drawGrid(width, height) { |
| 101 | const ctx = this.ctx; |
| 102 | ctx.strokeStyle = this.colors.grid; |
| 103 | ctx.lineWidth = 0.5; |
| 104 | |
| 105 | const gridSize = 50; |
| 106 | for (let x = 0; x < width; x += gridSize) { |
| 107 | ctx.beginPath(); |
| 108 | ctx.moveTo(x, 0); |
| 109 | ctx.lineTo(x, height); |
| 110 | ctx.stroke(); |
| 111 | } |
| 112 | for (let y = 0; y < height; y += gridSize) { |
| 113 | ctx.beginPath(); |
| 114 | ctx.moveTo(0, y); |
| 115 | ctx.lineTo(width, y); |
| 116 | ctx.stroke(); |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | drawHUD(width, height) { |
| 121 | const ctx = this.ctx; |