Files
42_INT_14_transcendence/src/shared_js/constants.ts
LuckyLaszlo 7f248b5449 find a way to sharing init
+ vector.normalized()
+ misc
2022-11-28 04:33:27 +01:00

20 lines
673 B
TypeScript

export const CanvasWidth = 1500;
export const CanvasRatio = 1.66666;
/* ratio 5/3 (1.66) */
export const w = CanvasWidth;
export const h = CanvasWidth / CanvasRatio;
export const w_mid = Math.floor(w/2);
export const h_mid = Math.floor(h/2);
export const pw = Math.floor(w/60);
export const ph = pw*6;
export const ballSize = pw;
export const wallSize = Math.floor(w/100);
export const racketSpeed = Math.floor(w/1.5); // pixel per second
export const ballSpeed = Math.floor(w/2); // pixel per second
export const ballSpeedIncrease = ballSpeed/20; // pixel per second
export const matchStartDelay = 3000; // millisecond
export const newRoundDelay = 1500; // millisecond