A tile gains Collision scale: below 1 each blocking cell pulls in on the sides without a blocking neighbour and stays flush towards its neighbours, so a wall of bushes becomes a narrower wall without gaps and the inner corner of an L closes cleanly; above 1 the cell grows at its open sides; on several layers the largest value counts, and the merged rectangles work in fractions of a cell with exactly the old result at 1 (#140)
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
4728f4fab5
commit
bffa508ee7
6 files changed
+366
-74
No files matched your search
@@ -20,7 +20,15 @@ import {
|
||||
type VariableKind,
|
||||
} from './kinds';
|
||||
import { findAssetOf, type Project } from '../model/Project';
|
||||
import { TILE_FPS_KEY, TILE_KIND_KEY, TILE_PLAYBACK_KEY, TILE_SOLID_KEY } from '../model/tile';
|
||||
import {
|
||||
TILE_COLLISION_SCALE_KEY,
|
||||
TILE_COLLISION_SCALE_MAX,
|
||||
TILE_COLLISION_SCALE_MIN,
|
||||
TILE_FPS_KEY,
|
||||
TILE_KIND_KEY,
|
||||
TILE_PLAYBACK_KEY,
|
||||
TILE_SOLID_KEY,
|
||||
} from '../model/tile';
|
||||
import { TILEMAP_COLUMNS_KEY, TILEMAP_MAX_CELLS, TILEMAP_ROWS_KEY, TILEMAP_TILE_KEY } from '../model/tilemap';
|
||||
import { SLICE_SCALE_KEY } from '../model/texture';
|
||||
import type { SceneObject } from '../model/SceneObject';
|
||||
@@ -249,6 +257,17 @@ const ASSET_SCHEMAS: Record<AssetType, PropertySchema> = {
|
||||
},
|
||||
// Solid is what the tile *is* – water, a wall – so it holds wherever the tile lies (#132).
|
||||
{ key: TILE_SOLID_KEY, label: 'Solid', kind: 'boolean', default: false },
|
||||
// Below 1 a cell blocks less than its square, above 1 more – but only on the sides without a
|
||||
// blocking neighbour, so a wall of such cells stays closed (#140).
|
||||
{
|
||||
key: TILE_COLLISION_SCALE_KEY,
|
||||
label: 'Collision scale',
|
||||
kind: 'number',
|
||||
default: 1,
|
||||
min: TILE_COLLISION_SCALE_MIN,
|
||||
max: TILE_COLLISION_SCALE_MAX,
|
||||
step: 0.05,
|
||||
},
|
||||
],
|
||||
// The layers and their cells are intrinsic data on the asset (see TilemapAsset); these three say
|
||||
// how far the grid reaches and how big one cell is drawn. A tile's own pictures are scaled onto
|
||||
|
||||
Reference in new issue
Block a user