export class Item { constructor(name, type, level, stats) { this.name = name; this.type = type; // 'weapon', 'armor', 'potion' this.level = level; this.stats = stats || {}; // { damage: 5 } or { defense: 2 } this.x = 0; this.y = 0; this.symbol = '?'; this.color = '#ffff00'; if (type === 'weapon') this.symbol = ')'; if (type === 'armor') this.symbol = '['; if (type === 'shield') this.symbol = ']'; if (type === 'potion') this.symbol = '!'; if (type === 'map') { this.symbol = '?'; this.color = '#ffd700'; } } }