Skip to content

Commit

Permalink
Increase interactivity range
Browse files Browse the repository at this point in the history
  • Loading branch information
damien.fayol committed Jul 19, 2023
1 parent 2da38ec commit c212452
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
10 changes: 10 additions & 0 deletions src/lib/dialogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,14 @@ const lockedDoor: GraphDialog = {
]
};

const greta : GraphDialog = {
content: 'Hello !',
};

const bob : GraphDialog = {
content: 'Welcome to my shop !',
};

const makeDialogs = (graph: GraphDialog, ref = ''): Record<string, NpcDialog | PlayerDialog> => {
ref = graph.ref ?? ref;
let refIndex = 1;
Expand Down Expand Up @@ -202,5 +210,7 @@ const makeDialogs = (graph: GraphDialog, ref = ''): Record<string, NpcDialog | P
export const dialogs: Record<string, NpcDialog | PlayerDialog> = {
...makeDialogs(ted, 'ted'),
...makeDialogs(ned, 'ned'),
...makeDialogs(greta, 'greta'),
...makeDialogs(bob, 'bob'),
...makeDialogs(lockedDoor, 'locked-door')
};
2 changes: 1 addition & 1 deletion src/lib/scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export const scripts = [
},
{
x: 6,
y: 9,
y: 8,
predicate: () => true,
doWalk: animateOnce((t) => {
store.update((store) => {
Expand Down
8 changes: 4 additions & 4 deletions src/maps/level-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -310,26 +310,26 @@
{
"id": 9,
"type": "npc",
"name": "man",
"name": "Bob",
"collision": true,
"texture": ["npc-4"],
"x": 8,
"y": 10,
"t": 1.5707,
"depth": 0,
"dialogs": []
"dialogs": ["bob"]
},
{
"id": 10,
"type": "npc",
"name": "man",
"name": "Greta",
"collision": true,
"texture": ["npc-3"],
"x": 10,
"y": 8,
"t": 0,
"depth": 0,
"dialogs": []
"dialogs": ["greta"]
},
{
"id": 12,
Expand Down
2 changes: 1 addition & 1 deletion src/stores/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export type CursorName = 'interact' | 'attack' | null;

export const pointer = writable<CursorName>(null);

export const INTERACTIVITY_DISTANCE = 1.6;
export const INTERACTIVITY_DISTANCE = 2.6;

0 comments on commit c212452

Please sign in to comment.