Proper screen shakes, how they should be.
Approw
Member Posts: 703
During the development of Two Guns, I needed to have good screen shakes. The method from tshirtbooth is way to complicated to make minor tweaks, way to many timers and interpolates, and on top of that they look terrible if you don't know what you're doing.
So I decided to share my technique, it's not complicated or groundbreaking, just a nice setup to create the amazing professional screenshakes we see in these fast arcade platformer games.
This template far more easy to tweak compared to the older method, it looks great, you can trigger screen shakes rapidly after eachother, and its very lightweight on the cpu.
Cheers!
Comments
Nice one. Seems very simple to tweak, and the shake looks good. Thanks for sharing!
Mental Donkey Games
Website - Facebook - Twitter
Thanks for sharing! Be sure to put this on the spare code thread!
My GameSalad Academy Courses! ◦ Check out my quality templates! ◦ Add me on Skype: braydon_sfx
Forgot to change something. this one has to be sin instead of cos. my bad;)
@NipaDidIt @Braydon_SFX Thanks guys enjoy:) thanks for the reminder, I will post it in the spare code thread.
Very nice way of doing it. I was just working up a screen shake for a project I'm working on as well.
http://jamie-cross.net/posts/ ✮ Udemy: Introduction to Mobile Games Development ✮ Learn Mobile Game Development in One Day Using Gamesalad ✮ My Patreon Page
Nice !
If you make the angle that cos and sin both operate on the same you will always get a diagonal movement, if you slow down your shake (for example make the interpolate and the timer 4 seconds long) and switch on the Shake on X axis behaviour - you will see the actors are always moving in a lower left to upper right diagonal movement. I thought it already looked great with just the vertical movement.
Also you can dump the timer and simply place the Shake on Y axis constrain in a rule that says . . 'When self.Shake Distance' > 0
o.
@jamie_c Cheers:)! @Socks Ah that is a good one, now its 100% free of timers, great input as alway! Yes I know, you could randomize the attributes, and/or give the X and Y constrains different input values.
I like it you could get rid of the timer in the hero by simply doing if overlaps or collides with ground change game.shake to true and in the shaker actor do if self.timer = 0.6 change game.shake to false if you didn't need lots of quick shakes i.e. for a simple game over or hero death.
My method was to change the camera X&Y origin to random -4,4 every 0.1 seconds but i like yours better
Nice work!