Skip to content

Instantly share code, notes, and snippets.

@dowoge
dowoge / create_spritesheet.bat
Created July 2, 2024 01:11
sprite sheet generator
@echo off
if "%1"=="" (
echo Please provide the input file as the first argument.
goto :eof
)
if "%2"=="" (
echo Please provide the scale as the third argument.
goto :eof
)
--return the target angle needed between segments to join them via a semi-circle (radius=pi)
local pi=math.pi
local deg=math.deg
local function CalculateAngle(SegmentLength,DistanceBetweenPoints)
local NSegments=(pi*DistanceBetweenPoints/2)/SegmentLength
local SegmentAngle=pi/NSegments
return deg(SegmentAngle)
end
@dowoge
dowoge / sky and lighting.lua
Created June 6, 2023 23:28
sky and lighting script generator
local numberFloatNumberRounding = 5 --5 decimal places
local LightingProperties = {
'Ambient',
'Brightness',
'ClockTime',
'ColorShift_Bottom',
'ColorShift_Top',
'EnvironmentDiffuseScale',
'EnvironmentSpecularScale',
local http_request = require('./http.lua')
local API = {}
local API_KEY = require('./apikey.lua')
local API_URL = 'https://api.strafes.net/v1/'
local API_HEADER = { {'Content-Type','application/json'}, { 'api-key', API_KEY } }
local t=tostring
local r=function(n,nd) return tonumber(string.format('%.' .. (nd or 0) .. 'f', n)) end
local GAMES={BHOP=1,SURF=2,[1]='bhop',[2]='surf'}