Hello, i apologize if the question has been already asked but i’m trying to follow a tutorial about making a dungeon-RPG with Phaser (i have this Zelda clone project). I made a map with Tiled and exported it in JSON but for now i just want to load the png file with my tiles in my preloader.ts but i have this error : Failed to process file: image “tiles”.
I don’t think it’s a path related error because i try to copy it in my scenes folder with my preloader with same results.
Here is my code with main.ts :
import Phaser from 'phaser'
import Preloader from './scenes/preloader'
import Game from './scenes/game'
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
physics: {
default: 'arcade',
arcade: {
gravity: { y: 0 }
}
},
scene: [Preloader, Game]
}
export default new Phaser.Game(config)
My game.ts :
import Phaser from 'phaser'
export default class Game extends Phaser.Scene
{
constructor()
{
super('game')
}
preload()
{
}
create()
{
this.add.image(0, 0, 'tiles')
}
}
and my preloader.ts :
import Phaser from 'phaser'
export default class Game extends Phaser.Scene
{
constructor()
{
super('game')
}
preload()
{
}
create()
{
this.add.image(0, 0, 'tiles')
}
}
Thank you very much for your help.