File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,22 @@ export class Obstacle {
4141 this . acceleration = 200 + score * 5 ;
4242 }
4343 if ( movementType === "flutter" ) {
44- this . flutterAmplitude = Phaser . Math . Between ( 5 , 15 ) ;
45- this . flutterFrequency = Phaser . Math . FloatBetween ( 3 , 6 ) ;
44+ const ampBase = 5 ;
45+ const ampMax = 50 ;
46+ this . flutterAmplitude = Phaser . Math . Clamp (
47+ ampBase + score * 0.5 ,
48+ ampBase ,
49+ ampMax
50+ ) ;
51+
52+ const freqBase = 3 ;
53+ const freqMax = 10 ;
54+ this . flutterFrequency = Phaser . Math . Clamp (
55+ freqBase + score * 0.2 ,
56+ freqBase ,
57+ freqMax
58+ ) ;
59+
4660 this . flutterOffset = Phaser . Math . FloatBetween ( 0 , Math . PI * 2 ) ;
4761 }
4862 }
Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ export class GameScene extends Phaser.Scene {
187187
188188 handlePlayerHit ( ) {
189189 if ( this . player . isInvincible ( ) ) return ;
190+ this . cameras . main . shake ( 200 , 0.01 ) ;
190191
191192 const lives = this . player . getLives ( ) ;
192193 if ( lives <= 1 ) {
You can’t perform that action at this time.
0 commit comments