improvements Cyst_Kid
This commit is contained in:
@@ -15,11 +15,11 @@ const MAP = [
|
||||
[1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,1,0,1,1,1,0,1],//5
|
||||
[1,0,0,0,0,0,1,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,0,0,0,0,1],//6
|
||||
[1,1,1,1,1,0,1,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,0,1,1,1,1,1],//7
|
||||
[2,2,2,2,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,2,2,2,2],//8
|
||||
[1,1,1,1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,1,1,1,1],//8
|
||||
[1,1,1,1,1,0,1,2,1,1,1,3,3,4,4,3,3,1,1,1,2,1,0,1,1,1,1,1],//9
|
||||
[5,2,2,2,2,0,2,2,1,8,8,8,8,8,8,8,8,8,8,1,2,2,0,2,2,2,2,5],//10
|
||||
[1,1,1,1,1,0,1,2,1,8,8,8,8,8,8,8,8,8,8,1,2,1,0,1,1,1,1,1],//11
|
||||
[2,2,2,2,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,2,2,2,2],//12
|
||||
[1,1,1,1,1,0,1,2,1,1,1,1,1,1,1,1,1,1,1,1,2,1,0,1,1,1,1,1],//12
|
||||
[1,1,1,1,1,0,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,0,1,1,1,1,1],//13
|
||||
[1,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,1],//14
|
||||
[1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1],//15
|
||||
@@ -33,6 +33,7 @@ const MAP = [
|
||||
|
||||
const PL0 = {c:14,r:16};
|
||||
const PH = [{c:12,r:10},{c:15,r:10},{c:12,r:11},{c:15,r:11}];
|
||||
const MED_SPAWNS = [{r:13,c:14}];
|
||||
|
||||
const TILE = 16;
|
||||
const HUD_TOP = 44;
|
||||
@@ -42,7 +43,29 @@ const CH = ROWS * TILE + HUD_TOP + HUD_BOT;
|
||||
const FPS = 60;
|
||||
const TICK = 1000 / FPS;
|
||||
const BASE_SPD = 2;
|
||||
const SUPER_SEC = 10;
|
||||
|
||||
// ---- Challenge timing ----
|
||||
const CHALL_FIRST_MIN = 7; // seconds before first challenge (min)
|
||||
const CHALL_FIRST_MAX = 13; // seconds before first challenge (max)
|
||||
const CHALL_NEXT_MIN = 8; // seconds between challenges (min)
|
||||
const CHALL_NEXT_MAX = 15; // seconds between challenges (max)
|
||||
const CHALL_DURATION = 10; // seconds player has to deliver the med
|
||||
|
||||
// ---- Player / Ghost ----
|
||||
const LIVES = 3; // starting lives
|
||||
const WIN_LEVEL = 3; // level at which the player wins
|
||||
const SPEED_MULT = 2; // sprint / super-mode speed multiplier
|
||||
const COLL_DIST = 0.8; // collision detection radius (in tiles)
|
||||
const GHOST_SPD_BASE = 1.2; // ghost base speed (tiles/frame)
|
||||
const GHOST_SPD_LEVEL = 0.2; // ghost speed increase per level
|
||||
const GHOST_SCARED_MULT = 0.55; // ghost speed while scared
|
||||
const GHOST_REL_INTERVAL = 80; // frames between ghost releases
|
||||
const GHOST_REL_OFFSET = 50; // frame offset for first ghost release
|
||||
|
||||
// ---- Scoring ----
|
||||
const SC_DOT = 1; // points per dot
|
||||
const SC_GHOST = 5; // points per scared ghost eaten
|
||||
const SC_CHALL = 25; // points for completing a challenge
|
||||
|
||||
const CO = {
|
||||
bg:'#87CEEB', wall:'#8B5CF6', we:'#A78BFA',
|
||||
@@ -71,45 +94,6 @@ function painOk(r,c){
|
||||
const t=tile(r,c);return t===0||t===2||t===5;
|
||||
}
|
||||
|
||||
//const COLS = 28;
|
||||
//const ROWS = 28;
|
||||
|
||||
//const PL0 = {c:14,r:23};
|
||||
//const PH = [{c:12,r:10},{c:15,r:10},{c:12,r:11},{c:15,r:11}];
|
||||
|
||||
|
||||
/* 0=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0,0,0,0,0,0,1],//14
|
||||
[1,0,1,1,1,0,1,1,0,1,1,0,1,1,1,1,0,1,1,0,1,1,0,1,1,1,0,1],//15
|
||||
[1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1],//16
|
||||
[1,1,1,0,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,1,0,1,0,1,1,1],//17
|
||||
[1,0,0,0,0,0,1,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,0,0,0,0,1],//18
|
||||
[1,0,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,1,1,1,1,0,1],//19
|
||||
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],//20
|
||||
[1,0,1,1,1,0,1,0,1,1,1,1,0,1,1,0,1,1,1,1,0,1,0,1,1,1,0,1],//24
|
||||
[1,0,0,0,0,0,1,0,0,0,0,1,0,1,1,0,1,0,0,0,0,1,0,0,0,0,0,1],//25
|
||||
[1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1],//26
|
||||
[1,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,1,0,0,0,0,0,0,0,0,0,0,1],//27
|
||||
[1,0,1,1,1,1,1,1,1,1,0,1,0,1,1,0,1,0,1,1,1,1,1,1,1,1,0,1],//28
|
||||
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],//29
|
||||
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],//30
|
||||
];*/
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user