added friends' neko to scene page
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import { friendsCursorPositions } from "../../events/friend-cursor";
|
||||
import { appData } from "../../events/app-data";
|
||||
import { activeDollSpriteUrl } from "../../events/active-doll-sprite";
|
||||
import { friendActiveDollSpriteUrls } from "../../events/friend-active-doll-sprite";
|
||||
import { sceneInteractive } from "../../events/scene-interactive";
|
||||
import {
|
||||
friendsPresenceStates,
|
||||
@@ -26,6 +27,17 @@
|
||||
targetY={$cursorPositionOnScreen.raw.y}
|
||||
spriteUrl={$activeDollSpriteUrl}
|
||||
/>
|
||||
{#each Object.entries($friendsCursorPositions) as [friendId, position] (friendId)}
|
||||
{#if $friendActiveDollSpriteUrls[friendId]}
|
||||
<Neko
|
||||
targetX={position.raw.x}
|
||||
targetY={position.raw.y}
|
||||
spriteUrl={$friendActiveDollSpriteUrls[friendId]}
|
||||
initialX={position.raw.x}
|
||||
initialY={position.raw.y}
|
||||
/>
|
||||
{/if}
|
||||
{/each}
|
||||
<div id="debug-bar">
|
||||
<DebugBar
|
||||
isInteractive={$sceneInteractive}
|
||||
|
||||
@@ -8,14 +8,17 @@
|
||||
targetX: number;
|
||||
targetY: number;
|
||||
spriteUrl: string;
|
||||
initialX?: number;
|
||||
initialY?: number;
|
||||
}
|
||||
|
||||
let { targetX, targetY, spriteUrl }: Props = $props();
|
||||
let { targetX, targetY, spriteUrl, initialX = 32, initialY = 32 }: Props =
|
||||
$props();
|
||||
|
||||
let nekoEl: HTMLDivElement;
|
||||
let animationFrameId: number;
|
||||
|
||||
let nekoPos = $state({ x: 32, y: 32 });
|
||||
let nekoPos = $state({ x: initialX, y: initialY });
|
||||
let frameCount = 0;
|
||||
let idleTime = 0;
|
||||
let idleAnimation: string | null = $state(null);
|
||||
|
||||
Reference in New Issue
Block a user