Загрузить файлы в «Prehistorik»

This commit is contained in:
2026-02-23 21:16:54 +03:00
parent 3870fe54d4
commit deff698041
4 changed files with 171 additions and 0 deletions

21
Prehistorik/constants.js Normal file
View File

@@ -0,0 +1,21 @@
'use strict';
// ─── Canvas ──────────────────────────────────────────────────────────────────
const canvas = document.getElementById('gameCanvas');
const ctx = canvas.getContext('2d');
const W = canvas.width;
const H = canvas.height;
// ─── Physics ─────────────────────────────────────────────────────────────────
const GRAVITY = 0.55;
const MAX_FALL = 16;
const JUMP_POW = -12.5;
const WALK_SPD = 4;
const STOMP_BOUNCE = -11; // vy after successful stomp
// ─── Gameplay ────────────────────────────────────────────────────────────────
const ATTACK_FRAMES = 22;
const INVINC_FRAMES = 100;
const WORLD_H = 600;
const COMBO_TIMEOUT = 150; // frames before combo resets
const MAX_COMBO_MULT = 8; // maximum score multiplier