Skip to content

Commit

Permalink
Fix paths
Browse files Browse the repository at this point in the history
  • Loading branch information
yisus82 committed Apr 30, 2024
1 parent 7bb08fa commit 888aa07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { makeMap } from './utils';

const gameSetup = async () => {
// load animations
k.loadSprite('sprites', '/spritesheet.png', {
k.loadSprite('sprites', './spritesheet.png', {
sliceX: 9,
sliceY: 10,
anims: {
Expand All @@ -30,7 +30,7 @@ const gameSetup = async () => {
});

// load level 1
k.loadSprite('level-1', '/level-1.png');
k.loadSprite('level-1', './level-1.png');
const {
map: level1Map,
spawnPoints: level1SpawnPoints,
Expand Down Expand Up @@ -85,7 +85,7 @@ const gameSetup = async () => {
});

// load level 2
k.loadSprite('level-2', '/level-2.png');
k.loadSprite('level-2', './level-2.png');
const {
map: level2Layout,
spawnPoints: level2SpawnPoints,
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TiledMap } from './types';

export const makeMap = async (k: KaboomCtx, name: string) => {
let error = null;
const mapData: TiledMap = await fetch(`/${name}.json`)
const mapData: TiledMap = await fetch(`./${name}.json`)
.then(res => res.json())
.catch(e => (error = e));
const map = k.make([k.sprite(name), k.scale(SCALE), k.pos(0)]);
Expand Down

0 comments on commit 888aa07

Please sign in to comment.