This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| oneko.js [2026/05/13 00:06] – Yuki | oneko.js [2026/05/13 00:12] (current) – Yuki | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | / | ||
| /*<code javascript> | /*<code javascript> | ||
| // oneko.js: https:// | // oneko.js: https:// | ||
| Line 25: | Line 24: | ||
| let idleAnimationFrame = 0; | let idleAnimationFrame = 0; | ||
| - | const nekoSpeed = 10; | + | const nekoSpeed = 8; |
| const spriteSets = { | const spriteSets = { | ||
| - | idle: [[-3, -0]], | + | idle: [[0, 0]], |
| alert: [[-7, -3]], | alert: [[-7, -3]], | ||
| scratchSelf: | scratchSelf: | ||
| Line 204: | Line 203: | ||
| // every ~ 20 seconds | // every ~ 20 seconds | ||
| - | if ( | + | |
| idleTime > 10 && | idleTime > 10 && | ||
| Math.floor(Math.random() * 200) == 0 && | Math.floor(Math.random() * 200) == 0 && | ||
| Line 226: | Line 225: | ||
| Math.floor(Math.random() * avalibleIdleAnimations.length) | Math.floor(Math.random() * avalibleIdleAnimations.length) | ||
| ]; | ]; | ||
| - | } | + | }*/ |
| switch (idleAnimation) { | switch (idleAnimation) { | ||
| - | case " | + | |
| if (idleAnimationFrame < 8) { | if (idleAnimationFrame < 8) { | ||
| setSprite(" | setSprite(" | ||
| Line 248: | Line 247: | ||
| resetIdleAnimation(); | resetIdleAnimation(); | ||
| } | } | ||
| - | break; | + | break;*/ |
| default: | default: | ||
| setSprite(" | setSprite(" | ||
| Line 262: | Line 261: | ||
| const distance = Math.sqrt(diffX ** 2 + diffY ** 2); | const distance = Math.sqrt(diffX ** 2 + diffY ** 2); | ||
| - | | + | if (distance < nekoSpeed || distance < 48) { |
| idle(); | idle(); | ||
| return; | return; | ||
| - | }*/ | + | } |
| idleAnimation = null; | idleAnimation = null; | ||