Hello everyone, I’m new to phaser 3 and video game development.
I would like to create a prototype of roguelike, for that I have a tileset representing ASCII characters in one image (the fonts are withe) :
For the moment I’ve created a rectangular level:
export default class LoadingSprites extends Phaser.Scene {
constructor() {
super('bootGame')
}
preload() {
this.load.image('fontTiles', 'src/assets/glyphs_8x8.png');
}
create() {
const atlas = {
empty: 0,
point: 1,
at: 64
}
const level = []
for(let y = 0; y < 30; y++) {
level.push(new Array(50).fill(atlas.point));
}
const map = this.make.tilemap({ data: level, tileWidth: 8, tileHeight: 8 });
const tiles = map.addTilesetImage('fontTiles');
const layer = map.createStaticLayer(0, tiles, 0, 0);
}
}
I’d like to represent the player with the arobase character, but I don’t know how to select this particular character on the tileset, in order to display it.
On all the resources I consulted, the different objects of the game were on separate files in order to animate them.
So I don’t know in which direction to look for this kind of tileset where all the elements are on the same image.
Thank for help me