游戏地图关卡制作器_pygame game map maker

"""
游戏地图关卡制作器,按空格键切换方块,按鼠标左键放置方块,按鼠标右键清除方块。
要保存地图,只要设一个按键,然后把update后的screen保存到磁盘上即可。
"""

__author__ = "李兴球"
__date__ = "2019/6/8"
__website__ = "www.lixingqiu.com"

import glob
import pygame
from pygame.locals import *

width,height = 480,360

screen = pygame.display.set_mode((width,height))
pygame.display.set_caption("游戏地图关卡制作器,www.lixingqiu.com")

black = pygame.Surface((48,48))
black.fill((0,0,0))
 
gamemap = pygame.Surface((width,height))

index = 0
squares = glob.glob("images/*.png")
squares = [pygame.image.load(image).convert_alpha() for image in squares]
amounts = len(squares)
image = squares[index]
rect = image.get_rect()

running = True

You must log in to read the rest of this article. Please log in or register as a user.