Starting on shaped tile hitboxes

This commit is contained in:
2025-06-19 23:49:53 -05:00
parent 6b16c97c64
commit 1022f45565
17 changed files with 360 additions and 48 deletions

View File

@ -0,0 +1,32 @@
import sys, os
import argparse
from datetime import datetime
import json
import math
# Check if the script is run with the correct arguments
parser = argparse.ArgumentParser(description="Generate chunk header files")
parser.add_argument('--output', required=True, help='Dir to output headers')
parser.add_argument('--input', required=True, help='Input JSON file from tiled')
args = parser.parse_args()
# Ensure outdir exists
outputDir = args.output
os.makedirs(outputDir, exist_ok=True)
# Create world directory if it does not exist
worldDir = os.path.join(outputDir, "world")
os.makedirs(worldDir, exist_ok=True)
# Some vars used during printing
now = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
# Read the input JSON file
inputFile = args.input
if not os.path.isfile(inputFile):
print(f"Error: Input file '{inputFile}' does not exist.")
sys.exit(1)
with open(inputFile, 'r') as f:
data = json.load(f)