File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -112,6 +112,10 @@ const REFILL_BODY_SIZE = Math.max(4, Math.round(WORLD.tile * 0.5));
112112const REFILL_CONSUME_FREEZE_TIME = 0.05 ;
113113const DEATH_SHAKE_DURATION_MS = 120 ;
114114const DEATH_SHAKE_INTENSITY = 0.0026 ;
115+ const PLAYER_LIGHT_OFFSET_Y = {
116+ normal : - 8 ,
117+ crouched : - 3 ,
118+ } as const ;
115119const SPAWN_WIPE_HEIGHT = VIEWPORT . height + SPAWN_WIPE_VISUALS . edgeOverscan * 2 ;
116120const DEBUG_HITBOX_COLOR = 0xff0000 ;
117121const DEBUG_HURTBOX_COLOR = 0x00ff00 ;
@@ -1446,10 +1450,13 @@ export class GameScene extends Phaser.Scene {
14461450 }
14471451
14481452 private renderLighting ( snapshot : ReturnType < Player [ "getSnapshot" ] > ) : void {
1453+ const playerLightOffsetY = snapshot . isCrouched
1454+ ? PLAYER_LIGHT_OFFSET_Y . crouched
1455+ : PLAYER_LIGHT_OFFSET_Y . normal ;
14491456 const lights : LightingSource [ ] = [
14501457 {
1451- x : snapshot . centerX ,
1452- y : snapshot . centerY - 2 ,
1458+ x : snapshot . x ,
1459+ y : snapshot . y + playerLightOffsetY ,
14531460 radius : 48 ,
14541461 color : COLORS . dust ,
14551462 intensity : 0.12 ,
You can’t perform that action at this time.
0 commit comments