#!/usr/bin/env python3 """Build the separate cutscene example; never modifies the user's assets/ maps.""" from pathlib import Path import math import struct import wave ROOT = Path(__file__).resolve().parents[1] / "examples/cutscene_demo" def write_map(name, *, spawn, angle, events=(), strings=(), transitions=(), autoplay=False): grid = bytearray(1024) for x in range(32): grid[x] = grid[31*32+x] = 1 for y in range(32): grid[y*32] = grid[y*32+31] = 1 for y in range(1, 18): grid[y*32+16] = 3 for x, y in ((6,6),(10,5),(12,12),(4,10)): grid[y*32+x] = 7 for t in transitions: grid[t[1]*32+t[0]] = 10 sprites = [(7*64+32,5*64+32,11,65536,0,0),(11*64+32,7*64+32,10,65536,0,0)] header = struct.pack("