Skip to content

Commit

Permalink
Fix door npc display
Browse files Browse the repository at this point in the history
  • Loading branch information
shezard committed Jul 7, 2023
1 parent f648331 commit 78ad628
Show file tree
Hide file tree
Showing 11 changed files with 7 additions and 23 deletions.
20 changes: 0 additions & 20 deletions src/components/Npc.svelte

This file was deleted.

5 changes: 3 additions & 2 deletions src/components/Script.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,9 @@
<Box
x={script.x}
y={script.y}
wx={Math.abs(Math.cos($player.position.t))}
wy={Math.abs(Math.sin($player.position.t))}
wx={script.depth ?? 0}
wy={1}
rz={script.t}
on:click={handleNpc(script)}
{texture}
color={script.color}
Expand Down
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export type Npc = {
texture: string[];
dialogs: string[];
color?: number;
depth?: number;
} & OrientedPosition;

export type AiMode = 'idle' | 'attack-on-sight';
Expand Down
1 change: 1 addition & 0 deletions src/lib/Npc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export const makeNpc = function (npcName: string, id: number, x: number, y: numb
x: x,
y: y,
t: 0,
depth: 0,
dialogs: []
};
};
2 changes: 1 addition & 1 deletion src/maps/level-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
{
"id": 8,
"type": "panel",
"content": ["Press I to access the inventory"],
"content": ["Tips: Press I to access the inventory"],
"collision": false,
"texture": ["panel-1", "panel-1", "panel-1", "panel-0", "panel-0", "panel-0"],
"x": 5,
Expand Down
1 change: 1 addition & 0 deletions src/maps/level-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@
"x": 4,
"y": 3,
"t": 0,
"depth": 1,
"dialogs": ["locked-door"]
},
{
Expand Down
Binary file added static/textures/npc-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/textures/npc-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/textures/npc-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/textures/npc-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/textures/npc-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 78ad628

Please sign in to comment.