Ninjadoodle Posted February 6, 2018 Share Posted February 6, 2018 Hi guys Just wondering if anyone has a good ‘screen shake’ code snippet/idea they might want to share. Currently I’m using a basic effect using a tween and a bounce easing setting, but it doesn’t look as good it should. Also, any ideas on a good way to shake a sprite. I’ve tried doing this but the code gets pretty long. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
enpu Posted February 6, 2018 Share Posted February 6, 2018 @Ninjadoodle Really depends on what kind of look are you trying to get. I would just put everything on a container and then randomly set it's position for certain amount of time. Then just fine-tune how much you move the container and how often to get the right look. Works exactly same for sprites. Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 6, 2018 Author Share Posted February 6, 2018 @enpu - I’ll try something like that for the ‘shake screen’ For the sprite shake, would a container shake also work if the sprite is being tweeted? Just trying to keep the code consise and easy to read. Quote Link to comment Share on other sites More sharing options...
enpu Posted February 6, 2018 Share Posted February 6, 2018 @Ninjadoodle Depends on what you are tweening. If your tween is changing sprite's position and you try to also change the position with shake function, then of course you will run into problems. Remember that container and sprite are almost same thing (Sprite extends from Container), except that sprite just does have texture that gets rendered. Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted February 6, 2018 Author Share Posted February 6, 2018 @enpu - yeah that’s what I was worried about. I must think of a good way to do this Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.