UNPKG

@osbjs/osbjs

Version:

a minimalist osu! storyboarding framework

17 lines (16 loc) 564 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.oscillateX = void 0; function oscillateX(commandable, frequency, amplitude, startTime, endTime, originX = 320) { let x = originX; let t = startTime, _t = 0; const timestep = 1000 / frequency; do { const newX = amplitude * Math.sin(_t) + originX - amplitude; commandable.MoveX(t, t + timestep, x, newX); x = newX; t += timestep; _t += timestep; } while (t <= endTime); } exports.oscillateX = oscillateX;