So I'm doing the 2048 game in python (pygame) and it's already working but I wanted to replace the numbers with some images I made and I can't do it. I would really appreciate if someone would help me. Thanks in advance.
I tried this (where j
and k
are the line and column of the number ; str(value(game,j,k))
is the value in j,k
; wood
is the name of the image I uploaded)
for j in range(1,5):
for k in range(1,5):
number=str(value(game,j,k))
if number==2:
number = wood
in this case I wanted to replace the 2's with the wood image