Jump to content

quesion about the ScreenShake Plugin


leaf37
 Share

Recommended Posts

Hey friends have you ever use this plugin?

I was finding the shake function for I used to make flash game by flixel ,and there's a class called FlxG which contains a function called shake,

And I found that there is a plugin named ScreenShake in Phaser.It works good but only work in condition that the we won't use the follow function of camera,

as soon as I use the camera to follow something,this plugin won't work..

 

I think it may caused by this code mode , if the camera is follow something, the pos of camera is controlled by camera manager but not the code below? 

if(this._settings.shakesCount % 2){
        this.game.camera.x += this._settings.shakeX ? sens : 0;
        this.game.camera.y += this._settings.shakeY ? sens : 0;
      }
      else{
        this.game.camera.x -= this._settings.shakeX ? sens : 0;
        this.game.camera.y -= this._settings.shakeY ? sens : 0;
      }
 

Do some one could give me some advise how I can use this plugin when use the follow function of camera?

Link to comment
Share on other sites

51 minutes ago, WombatTurkey said:

What do you mean? Shake when the camera is following a player?

I just want a simple shake effects like that when the player fall on the ground with high speed...

If I don't use this code, this plugin works,

game.camera.follow(player);

 

but if use this code , this won't work just like I never use this plugin..

 

you know that I can't give up the follow function of camera to make a small room game just because of a simple effect ..

Link to comment
Share on other sites

19 hours ago, leaf37 said:

I just want a simple shake effects like that when the player fall on the ground with high speed...

If I don't use this code, this plugin works,


game.camera.follow(player);

 

but if use this code , this won't work just like I never use this plugin..

 

you know that I can't give up the follow function of camera to make a small room game just because of a simple effect ..

 

Aww I get you.

 

When you have game.camera.follow attached (or should I say following), you cannot then manipulate the game.camera's offsets, right?

Might want to make a SO post, or post in the github. I am not sure if this is intended, or a bug.

 

I think it's a bug because we should be able to manipulate the game camera when it's following someone? Rich has to make that call though.

 

 

Link to comment
Share on other sites

On Monday, February 15, 2016 at 0:13 PM, WombatTurkey said:

 

Aww I get you.

 

When you have game.camera.follow attached (or should I say following), you cannot then manipulate the game.camera's offsets, right?

Might want to make a SO post, or post in the github. I am not sure if this is intended, or a bug.

 

I think it's a bug because we should be able to manipulate the game camera when it's following someone? Rich has to make that call though.

 

 

Sorry for so late to see this (The new year work is so much in our company...)

I've found some other way to solve this 

To set a deadzone to camera and modify the ScreenShake plugin a little , but this way seems a little strange.

I think it may be a bug ,shake camera effect is a common used effect I think :-D

Thank you for your help~~

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...