Array Index Out of Bounds error on PGraphics.text()

Rather than using 2 separated lists to refer to the same thing, why not those 3 values in 1 list? :bulb:

def show(self): image(self.pg, 0, 0)


def set(self, x, y, c): self.chars.append(x, y, c)


def update(self):
    if not len(self.chars): return

    s = tileSize
    t = s - 1

    with self.pg.beginDraw():
        for ch in self.chars:
            x, y, c = ch
            xs = x*s
            ys = y*s

            self.pg.fill(0)
            self.pg.rect(xs, ys, t, t)

            self.pg.fill(0340)
            self.pg.text(c, float(xs), ys, s, s)