2時間半でだいたい下準備は完成
うち30分ぐらいはスプラ3のフェスで息抜き
import time
import pygame
from pygame.locals import *
screen = pygame.display.set_mode((1200, 800))
def write_board(bd):
font = pygame.font.SysFont("notosansmonocjkjp", 23)
for y in range(32):
for x in range(48):
pygame.draw.rect(screen, (0,255,0), Rect(x*24+24,y*24+12+7,23,23))
text = font.render(bd[y*75+x], True, (255,255,255))
screen.blit(text, [x*24+24, y*24+12])
def gamemain():
bd=" 餅"*75*50
while 1:
screen.fill((0,0,0))
write_board(bd)
pygame.display.update()
pygame.time.wait(500)
for event in pygame.event.get():
if event.type == pygame.QUIT:
pygame.quit()
quit()
if event.type == MOUSEBUTTONUP and event.button == 1:
x, y = event.pos
cx,cy = (x-24)//24,(y-19)//24
print(cx,cy)
pygame.init()
gamemain()
pygame.quit()