Add more experimental tiles: gates and a skeleton key (also some tileset touchups)
This commit is contained in:
parent
fa47c28136
commit
1e79704f70
@ -1167,11 +1167,10 @@ const EDITOR_PALETTE = [{
|
||||
tiles: [
|
||||
'key_blue', 'key_red', 'key_yellow', 'key_green',
|
||||
'flippers', 'fire_boots', 'cleats', 'suction_boots',
|
||||
'bribe', 'railroad_sign', 'hiking_boots', 'speed_boots',
|
||||
'xray_eye', 'helmet', 'foil', 'lightning_bolt',
|
||||
'bowling_ball', 'dynamite', 'no_sign', 'gift_bow',
|
||||
'hiking_boots', 'speed_boots', 'lightning_bolt', 'railroad_sign',
|
||||
'helmet', 'foil', 'hook', 'xray_eye',
|
||||
'bribe', 'bowling_ball', 'dynamite', 'no_sign',
|
||||
'score_10', 'score_100', 'score_1000', 'score_2x',
|
||||
'hook',
|
||||
],
|
||||
}, {
|
||||
title: "Creatures",
|
||||
@ -1232,7 +1231,6 @@ const EDITOR_PALETTE = [{
|
||||
// - wires, wire tunnels probably a dedicated tool, placing tunnels like a tile makes no sense
|
||||
// - canopy normal tile; layering problem
|
||||
// - thin walls special rotate logic, like force floors; layering problem
|
||||
// - light switches
|
||||
// TODO should tiles that respond to wiring and/or gray buttons be highlighted, highlightable?
|
||||
}, {
|
||||
title: "Logic",
|
||||
@ -1252,7 +1250,17 @@ const EDITOR_PALETTE = [{
|
||||
'purple_floor',
|
||||
'purple_wall',
|
||||
'button_gray',
|
||||
],
|
||||
}, {
|
||||
title: "Experimental",
|
||||
tiles: [
|
||||
'circuit_block/xxx',
|
||||
'gift_bow',
|
||||
'skeleton_key',
|
||||
'gate_red',
|
||||
'gate_blue',
|
||||
'gate_yellow',
|
||||
'gate_green',
|
||||
],
|
||||
}];
|
||||
|
||||
|
||||
@ -884,6 +884,15 @@ export const LL_TILESET_LAYOUT = Object.assign({}, CC2_TILESET_LAYOUT, {
|
||||
splash_slime: [[0, 38], [1, 38], [2, 38], [3, 38]],
|
||||
player1_exit: [[8, 38], [9, 38], [10, 38], [11, 38]],
|
||||
player2_exit: [[12, 38], [13, 38], [14, 38], [15, 38]],
|
||||
|
||||
// More custom tiles
|
||||
gate_red: [0, 39],
|
||||
gate_blue: [1, 39],
|
||||
gate_yellow: [2, 39],
|
||||
gate_green: [3, 39],
|
||||
|
||||
skeleton_key: [4, 39],
|
||||
|
||||
});
|
||||
|
||||
export class Tileset {
|
||||
|
||||
118
js/tiletypes.js
118
js/tiletypes.js
@ -46,6 +46,49 @@ function blocks_leaving_thin_walls(me, actor, direction) {
|
||||
return me.type.thin_walls.has(direction) && actor.type.name !== 'ghost';
|
||||
}
|
||||
|
||||
function _define_door(key) {
|
||||
return {
|
||||
draw_layer: DRAW_LAYERS.terrain,
|
||||
// Doors can be opened by ice blocks, but not dirt blocks
|
||||
blocks_collision: COLLISION.block_cc1,
|
||||
blocks(me, level, other) {
|
||||
if (other.type.name === 'ghost')
|
||||
return false;
|
||||
return ! (other.type.has_inventory &&
|
||||
(other.has_item(key) || other.has_item('skeleton_key')));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
if (level.take_key_from_actor(other, key) ||
|
||||
level.take_tool_from_actor(other, 'skeleton_key'))
|
||||
{
|
||||
level.sfx.play_once('door', me.cell);
|
||||
level.transmute_tile(me, 'floor');
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
function _define_gate(key) {
|
||||
return {
|
||||
draw_layer: DRAW_LAYERS.item,
|
||||
// Doors can be opened by ice blocks, but not dirt blocks
|
||||
blocks_collision: COLLISION.block_cc1,
|
||||
blocks(me, level, other) {
|
||||
if (other.type.name === 'ghost')
|
||||
return false;
|
||||
return ! (other.type.has_inventory &&
|
||||
(other.has_item(key) || other.has_item('skeleton_key')));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
if (level.take_key_from_actor(other, key) ||
|
||||
level.take_tool_from_actor(other, 'skeleton_key'))
|
||||
{
|
||||
level.sfx.play_once('door', me.cell);
|
||||
level.remove_tile(me);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
function player_visual_state(me) {
|
||||
if (! me) {
|
||||
return 'normal';
|
||||
@ -538,63 +581,14 @@ const TILE_TYPES = {
|
||||
},
|
||||
|
||||
// Locked doors
|
||||
door_red: {
|
||||
draw_layer: DRAW_LAYERS.terrain,
|
||||
blocks(me, level, other) {
|
||||
if (other.type.name === 'ghost')
|
||||
return false;
|
||||
// TODO not quite sure if this one is right; there are complex interactions with monsters, e.g. most monsters can eat blue keys but can't actually use them
|
||||
return ! (other.type.has_inventory && other.has_item('key_red'));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
if (level.take_key_from_actor(other, 'key_red')) {
|
||||
level.sfx.play_once('door', me.cell);
|
||||
level.transmute_tile(me, 'floor');
|
||||
}
|
||||
},
|
||||
},
|
||||
door_blue: {
|
||||
draw_layer: DRAW_LAYERS.terrain,
|
||||
blocks(me, level, other) {
|
||||
if (other.type.name === 'ghost')
|
||||
return false;
|
||||
return ! (other.type.has_inventory && other.has_item('key_blue'));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
if (level.take_key_from_actor(other, 'key_blue')) {
|
||||
level.sfx.play_once('door', me.cell);
|
||||
level.transmute_tile(me, 'floor');
|
||||
}
|
||||
},
|
||||
},
|
||||
door_yellow: {
|
||||
draw_layer: DRAW_LAYERS.terrain,
|
||||
blocks(me, level, other) {
|
||||
if (other.type.name === 'ghost')
|
||||
return false;
|
||||
return ! (other.type.has_inventory && other.has_item('key_yellow'));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
if (level.take_key_from_actor(other, 'key_yellow')) {
|
||||
level.sfx.play_once('door', me.cell);
|
||||
level.transmute_tile(me, 'floor');
|
||||
}
|
||||
},
|
||||
},
|
||||
door_green: {
|
||||
draw_layer: DRAW_LAYERS.terrain,
|
||||
blocks(me, level, other) {
|
||||
if (other.type.name === 'ghost')
|
||||
return false;
|
||||
return ! (other.type.has_inventory && other.has_item('key_green'));
|
||||
},
|
||||
on_arrive(me, level, other) {
|
||||
if (level.take_key_from_actor(other, 'key_green')) {
|
||||
level.sfx.play_once('door', me.cell);
|
||||
level.transmute_tile(me, 'floor');
|
||||
}
|
||||
},
|
||||
},
|
||||
door_red: _define_door('key_red'),
|
||||
door_blue: _define_door('key_blue'),
|
||||
door_yellow: _define_door('key_yellow'),
|
||||
door_green: _define_door('key_green'),
|
||||
gate_red: _define_gate('key_red'),
|
||||
gate_blue: _define_gate('key_blue'),
|
||||
gate_yellow: _define_gate('key_yellow'),
|
||||
gate_green: _define_gate('key_green'),
|
||||
|
||||
// Terrain
|
||||
dirt: {
|
||||
@ -2365,28 +2359,24 @@ const TILE_TYPES = {
|
||||
blocks_collision: COLLISION.block_cc1 | (COLLISION.monster_solid & ~COLLISION.rover),
|
||||
},
|
||||
foil: {
|
||||
// TODO not implemented
|
||||
draw_layer: DRAW_LAYERS.item,
|
||||
is_item: true,
|
||||
is_tool: true,
|
||||
blocks_collision: COLLISION.block_cc1 | (COLLISION.monster_solid & ~COLLISION.rover),
|
||||
},
|
||||
lightning_bolt: {
|
||||
// TODO not implemented
|
||||
draw_layer: DRAW_LAYERS.item,
|
||||
is_item: true,
|
||||
is_tool: true,
|
||||
blocks_collision: COLLISION.block_cc1 | (COLLISION.monster_solid & ~COLLISION.rover),
|
||||
},
|
||||
speed_boots: {
|
||||
// TODO not implemented
|
||||
draw_layer: DRAW_LAYERS.item,
|
||||
is_item: true,
|
||||
is_tool: true,
|
||||
blocks_collision: COLLISION.block_cc1 | (COLLISION.monster_solid & ~COLLISION.rover),
|
||||
},
|
||||
bribe: {
|
||||
// TODO not implemented
|
||||
draw_layer: DRAW_LAYERS.item,
|
||||
is_item: true,
|
||||
is_tool: true,
|
||||
@ -2398,6 +2388,12 @@ const TILE_TYPES = {
|
||||
is_tool: true,
|
||||
blocks_collision: COLLISION.block_cc1 | (COLLISION.monster_solid & ~COLLISION.rover),
|
||||
},
|
||||
skeleton_key: {
|
||||
draw_layer: DRAW_LAYERS.item,
|
||||
is_item: true,
|
||||
is_tool: true,
|
||||
blocks_collision: COLLISION.block_cc1 | (COLLISION.monster_solid & ~COLLISION.rover),
|
||||
},
|
||||
|
||||
// Progression
|
||||
player: {
|
||||
|
||||
BIN
tileset-lexy.png
BIN
tileset-lexy.png
Binary file not shown.
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 74 KiB |
BIN
tileset-src/tileset-lexy-electric-floor.aseprite
Normal file
BIN
tileset-src/tileset-lexy-electric-floor.aseprite
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue
Block a user