fixes and minor improvements

This commit is contained in:
catarrh committed 2026-07-26 03:25:12 +03:00
1 parent 7ee45eb48e
commit ebf5a2f0d1
1 file changed
+7 -4
+7 -4
View File
@@ -138,11 +138,14 @@ export const EXPLOSION_TYPES = {
draw(explosion, foreground, terrain) { draw(explosion, foreground, terrain) {
const {x, y, cr, osc, pattern} = explosion; const {x, y, cr, osc, pattern} = explosion;
let row = []; const nextRow = Math.floor(cr);
for (let cx=0; cx < 1+cr*2; cx++) { if (nextRow >= pattern.length) {
row.push(randomInt(0, 3) === 0); let row = [];
for (let cx=0; cx < 1+nextRow*2; cx++) {
row.push(randomInt(0, 3) === 0);
}
pattern.push(row);
} }
pattern.push(row);
for (let cy=0; cy<pattern.length; cy++) { for (let cy=0; cy<pattern.length; cy++) {
const row = pattern[cy]; const row = pattern[cy];