barkour/js/consts.js

18 lines
864 B
JavaScript
Raw Normal View History

// Shared constants for sim + render. Logical resolution is exactly the tile grid.
export const TILE = 12, GW = 80, GH = 45;
export const W = GW * TILE, H = GH * TILE; // 960 x 540
// Tile types. PAD is the side-view bounce block (solid); PADTOP is the
// top-down launch pad (walkable floor tile).
export const T = { EMPTY: 0, SOLID: 1, PLAT: 2, SPIKE: 3, PAD: 4, CRYSTAL: 5, PIT: 6, PADTOP: 7 };
// Input bitmask. JUMP rides on the up keys (side view); HOP is the dedicated
// hop key (Space / comma) so the top-down mode can move north without hopping.
export const B = { L: 1, R: 2, U: 4, D: 8, JUMP: 16, ATK: 32, SPC: 64, ITM: 128, HOP: 256 };
export const ITEMS = ['ball', 'bomb', 'shield', 'boost', 'heal'];
export const GRAV = 0.42, MAXFALL = 9.5;
export const STOCKS = 3;
export const SNAP_EVERY = 2; // host sends a snapshot every N sim ticks (30/s)