Proper screen shakes, how they should be.

ApprowApprow Member Posts: 703
edited May 2015 in Working with GS (Mac)

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

  • MentalDonkeyGamesMentalDonkeyGames Member Posts: 1,276

    Nice one. Seems very simple to tweak, and the shake looks good. Thanks for sharing!

    Mental Donkey Games
    Website - Facebook - Twitter

  • Braydon_SFXBraydon_SFX Member, Sous Chef, PRO, Bowlboy Sidekick Posts: 9,271

    Thanks for sharing! Be sure to put this on the spare code thread!

  • ApprowApprow Member Posts: 703

    Forgot to change something. this one has to be sin instead of cos. my bad;)

  • ApprowApprow Member Posts: 703

    @NipaDidIt @Braydon_SFX Thanks guys enjoy:) thanks for the reminder, I will post it in the spare code thread.

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Very nice way of doing it. I was just working up a screen shake for a project I'm working on as well. :)

  • SocksSocks London, UK.Member Posts: 12,822
    edited May 2015

    @Approw said:
    Forgot to change something. this one has to be sin instead of cos. my bad;)

    Nice ! :smile:

    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.

  • ApprowApprow Member Posts: 703

    @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.

  • UtopianGamesUtopianGames Member Posts: 5,692
    edited May 2015

    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!

Sign In or Register to comment.