From 7c7fd0f87b2938eb7c4a9f2464489d5c4d237ec3 Mon Sep 17 00:00:00 2001 From: Luiz Bills Date: Tue, 12 May 2026 19:53:27 -0300 Subject: [PATCH] v0.207.1 * fix `sfx()` --- package.json | 2 +- src/index.js | 5 +++-- src/version.js | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 5530709..aae15e3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "litecanvas", - "version": "0.207.0", + "version": "0.207.1", "description": "Lightweight HTML5 canvas 2D game engine suitable for small projects and creative coding. Inspired by PICO-8 and p5.js/Processing.", "license": "MIT", "author": "Luiz Bills ", diff --git a/src/index.js b/src/index.js index 7aad289..1d5bec8 100644 --- a/src/index.js +++ b/src/index.js @@ -1026,10 +1026,11 @@ export default function litecanvas(settings = {}) { zzfxParams ||= _defaultSound // if has other arguments, copy the sound to not change the original - if (pitchSlide || volumeFactor) { + if (pitchSlide || volumeFactor >= 0) { zzfxParams = zzfxParams.slice() - zzfxParams[0] = (volumeFactor || 1) * (zzfxParams[0] || 1) + zzfxParams[0] = volumeFactor * (zzfxParams[0] || 1) zzfxParams[10] = ~~zzfxParams[10] + pitchSlide + console.log(zzfxParams) } zzfx.apply(0, zzfxParams) diff --git a/src/version.js b/src/version.js index eae9ab9..735812c 100644 --- a/src/version.js +++ b/src/version.js @@ -1,2 +1,2 @@ // Generated by genversion. -export const version = '0.207.0' +export const version = '0.207.1'