Extend the CC2 tile definition with some custom stuff
This commit is contained in:
parent
9e66bc46bb
commit
ddfa7f562a
@ -6,7 +6,7 @@ import * as dat from './format-dat.js';
|
|||||||
import * as format_util from './format-util.js';
|
import * as format_util from './format-util.js';
|
||||||
import { Level } from './game.js';
|
import { Level } from './game.js';
|
||||||
import CanvasRenderer from './renderer-canvas.js';
|
import CanvasRenderer from './renderer-canvas.js';
|
||||||
import { Tileset, CC2_TILESET_LAYOUT, TILE_WORLD_TILESET_LAYOUT } from './tileset.js';
|
import { Tileset, CC2_TILESET_LAYOUT, LL_TILESET_LAYOUT, TILE_WORLD_TILESET_LAYOUT } from './tileset.js';
|
||||||
import TILE_TYPES from './tiletypes.js';
|
import TILE_TYPES from './tiletypes.js';
|
||||||
import { random_choice, mk, promise_event, fetch, walk_grid } from './util.js';
|
import { random_choice, mk, promise_event, fetch, walk_grid } from './util.js';
|
||||||
|
|
||||||
@ -1758,7 +1758,7 @@ async function main() {
|
|||||||
else if (query.get('tileset') === 'lexy') {
|
else if (query.get('tileset') === 'lexy') {
|
||||||
tilesheet.src = 'tileset-lexy.png';
|
tilesheet.src = 'tileset-lexy.png';
|
||||||
tilesize = 32;
|
tilesize = 32;
|
||||||
tilelayout = CC2_TILESET_LAYOUT;
|
tilelayout = LL_TILESET_LAYOUT;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
tilesheet.src = 'tileset-tworld.png';
|
tilesheet.src = 'tileset-tworld.png';
|
||||||
|
|||||||
@ -534,6 +534,30 @@ export const TILE_WORLD_TILESET_LAYOUT = {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const LL_TILESET_LAYOUT = Object.assign({}, CC2_TILESET_LAYOUT, {
|
||||||
|
// Completed teeth sprites
|
||||||
|
teeth: Object.assign({}, CC2_TILESET_LAYOUT.teeth, {
|
||||||
|
north: [[0, 32], [1, 32], [2, 32], [1, 32]],
|
||||||
|
}),
|
||||||
|
|
||||||
|
// Extra player sprites
|
||||||
|
player: Object.assign({}, CC2_TILESET_LAYOUT.player, {
|
||||||
|
skating: {
|
||||||
|
north: [0, 33],
|
||||||
|
east: [1, 33],
|
||||||
|
south: [2, 33],
|
||||||
|
west: [3, 33],
|
||||||
|
},
|
||||||
|
forced: 'skating',
|
||||||
|
burned: {
|
||||||
|
north: [4, 33],
|
||||||
|
east: [5, 33],
|
||||||
|
south: [6, 33],
|
||||||
|
west: [7, 33],
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
});
|
||||||
|
|
||||||
export class Tileset {
|
export class Tileset {
|
||||||
constructor(image, layout, size_x, size_y) {
|
constructor(image, layout, size_x, size_y) {
|
||||||
this.image = image;
|
this.image = image;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user